1 / 19

Topic 17: Interaction Models

Topic 17: Interaction Models. Interaction Models. With several explanatory variables, we need to consider the possibility that the effect of one variable depends on the value of another variable Special cases One binary variable (Y/N) and one continuous variable Two continuous variables.

archie
Télécharger la présentation

Topic 17: Interaction Models

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Topic 17: Interaction Models

  2. Interaction Models • With several explanatory variables, we need to consider the possibility that the effect of one variable depends on the value of another variable • Special cases • One binary variable (Y/N) and one continuous variable • Two continuous variables

  3. One binary variable and one continuous variable • X1 takes values 0 and 1 corresponding to two different groups • X2 is a continuous variable • Model: Y= β0+ β1X1 + β2X2 + β3X1X2 + e • When X1 = 0 : Y= β0 + β2X2 + e • When X1 = 1 : Y= (β0 + β1)+ (β2 + β3) X2 + e

  4. One binary and one continuous • β0 is the intercept for Group 1 • β0+ β1 is the intercept for Group 2 • Similar relationship for slopes (β2 and β3) • H0: β1 = β3 = 0 tests the hypothesis that the regression lines are the same • H0: β1 = 0 tests equal intercepts • H0: β3 = 0 tests equal slopes

  5. KNNL Example p316 • Y is number of months for an insurance company to adopt an innovation • X1 is the size of the firm (a continuous variable • X2 is the type of firm (a qualitative or categorical variable)

  6. The question • X2 takes the value 0 if it is a mutual fund firm and 1 if it is a stock fund firm • We ask whether or not stock firms adopt the innovation slower or faster than mutual firms • We ask the question across all firms, regardless of size

  7. Plot the data symbol1 v=M i=sm70 c=black l=1; symbol2 v=S i=sm70 c=black l=3; proc sort data=a1; by stock size; proc gplot data=a1; plot months*size=stock; run;

  8. Two symbols on plot

  9. Interaction effects • Interaction expresses the idea that the effect of one explanatory variable on the response depends on another explanatory variable • In the KNNL example, this would mean that the slope of the line depends on the type of firm

  10. Are both lines the same? • From scatterplot, looks like different intercepts but can use the test statement for formal assessment Data a1; set a1; sizestock=size*stock; Proc reg data=a1; model months=size stock sizestock; test stock, sizestock; run;

  11. Output Reject H0.There is a difference in the linear relationship across groups

  12. Output • How are they different? No difference in slopes assuming different intercepts Potentially different intercepts assuming different slopes

  13. Two parallel lines? proc reg data=a1; model months=size stock; run;

  14. Output

  15. Output Int for stock firms is 33.87+8.05 = 41.92 Common slope is –0.10

  16. Plot the two fitted lines symbol1 v=M i=rl c=black l=1; symbol2 v=S i=rl c=black l=3; proc gplot data=a1; plot months*size=stock; run;

  17. The plot

  18. Two continuous variables • Y= β0 + β1X1 + β2X2 + β3X1X2 + e • Can be rewritten as follows • Y= β0 + (β1 + β3X2)X1 + β2X2 + e • Y= β0 + β1X1 + (β2 + β3X1) X2 + e • The coefficient of one explanatory variable depends on the value of the other explanatory variable

  19. Last slide • We went over KNNL 8.2 – 8.7 • We used programs Topic17.sas to generate the output for today

More Related