Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Interpreting a Model in which the slopes are allowed to differ across groups Suppose Y is regressed on X1, Dummy1 (an indicator variable for group membership),

Similar presentations


Presentation on theme: "1 Interpreting a Model in which the slopes are allowed to differ across groups Suppose Y is regressed on X1, Dummy1 (an indicator variable for group membership),"— Presentation transcript:

1 1 Interpreting a Model in which the slopes are allowed to differ across groups Suppose Y is regressed on X1, Dummy1 (an indicator variable for group membership), and Dummy1 * X1. The coefficient for Dummy1 * X1 will indicate how the effect of X1 differs across groups. For example, if the coefficient is positive, this means that X1 has a larger effect (i.e. more positive or less negative) in group 1 than it does in the other group. For example, we might think that whites gain more from each year of education than do blacks. Or, we might even think that the effect of a variable is positive in one group and zero or negative in another. Friday, 19 December 20147:16 AM

2 2 Interpreting a Model in which the slopes are allowed to differ across groups The coefficient for X1 is the effect (i.e. slope) of X1 for those not in group 1; b1 + b dummy X1 is the effect (slope) of X1 on those in group 1. When interaction terms are added, lines are no longer parallel, and you get something like … Friday, 19 December 20147:16 AM

3 3 Interpreting a Model in which the slopes are allowed to differ across groups For both groups, as X increases, Y increases. However, the increase (slope) is much greater for group 1 than it is for group 2. The t value for the interaction term tells you whether the slope for that group differs significantly from the slope for the reference group. Friday, 19 December 20147:16 AM

4 4 Interpreting a Model in which the slopes are allowed to differ across groups This exercise is loosely based on "How can I compare regression coefficients between two groups?""How can I compare regression coefficients between two groups?" Sometimes your research hypothesis may predict that the size of a regression coefficient should be bigger for one group than for another. For example, you might believe that the regression coefficient of height predicting weight would be higher for men than for women. We have a data file with 10 fictional females and 10 fictional males, along with their height in inches and their weight in pounds. Friday, 19 December 20147:16 AM

5 5 Interpreting a Model in which the slopes are allowed to differ across groups This exercise is loosely based on “How can I compare regression coefficients between two groups?” http://www.ats.ucla.edu/stat/spss/faq/compreg2.htm http://www.ats.ucla.edu/stat/spss/faq/compreg2.htm Sometimes your research hypothesis may predict that the size of a regression coefficient should be bigger for one group than for another. For example, you might believe that the regression coefficient of height predicting weight would be higher for men than for women. We have a data file with 10 fictional females and 10 fictional males, along with their height in inches and their weight in pounds. Friday, 19 December 20147:16 AM

6 6 Interpreting a Model in which the slopes are allowed to differ across groups We analyse their data separately using the regression commands below. Note that we have to do two regressions, one with the data for females only and one with the data for males only. We can use the split file command to split the data file by gender and then run the regression. The parameter estimates (coefficients) for females and males are shown below, and the results do seem to suggest that height is a stronger predictor of weight for males (3.19) than for females (2.10). Friday, 19 December 20147:16 AM

7 7 Interpreting a Model in which the slopes are allowed to differ across groups Data > Split File Friday, 19 December 20147:16 AM

8 8 Interpreting a Model in which the slopes are allowed to differ across groups SORT CASES BY gender. SPLIT FILE LAYERED BY gender. Friday, 19 December 20147:16 AM

9 9 Interpreting a Model in which the slopes are allowed to differ across groups Now perform the regression Analyze > Regression > Linear Friday, 19 December 20147:16 AM

10 10 Interpreting a Model in which the slopes are allowed to differ across groups REGRESSION /MISSING LISTWISE /STATISTICS COEFF OUTS R ANOVA /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT weight /METHOD=ENTER height. Friday, 19 December 20147:16 AM

11 11 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM

12 12 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM The parameter estimates (coefficients) for females and males are shown, and the results do seem to suggest that height is a stronger predictor of weight for males (3.19) than for females (2.10).

13 13 Interpreting a Model in which the slopes are allowed to differ across groups Alternately employ a single model, so remove the split. Note reset if you wish to remove previous split (not essential). Data > Split File Friday, 19 December 20147:16 AM

14 14 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM split file off.

15 15 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM We can compare the regression coefficients of males with females to test the null hypothesis Ho: B f = B m, where B f is the regression coefficient for females, and B m is the regression coefficient for males. To do this analysis, we first make a dummy variable called female that is coded 1 for female and 0 for male, and a variable femht that is the product of female and height. We then use female, height and femht as predictors in the regression equation. Now generate variables and repeat regression.

16 16 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM Transform > Recode into Different Variables

17 17 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM Set Name then employ Old and New Values

18 18 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM Having already mapped F to 1 add the mapping of M to 0 (add).

19 19 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM Finally Continue

20 20 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM Finally OK RECODE gender ('F'=1) ('M'=0) INTO female. EXECUTE.

21 21 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM Transform > Compute Variable

22 22 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM compute femht = female * height. execute.

23 23 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM Finally perform the regression Analyze > Regression > Linear

24 24 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM REGRESSION /MISSING LISTWISE /STATISTICS COEFF OUTS R ANOVA /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT weight /METHOD=ENTER female height femht.

25 25 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM

26 26 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM The term femht tests the null hypothesis Ho: B f = B m. The t value is -6.52 and is significant, indicating that the regression coefficient B f is significantly different from B m. Let's look at the parameter estimates to get a better understanding of what they mean and how they are interpreted. First, recall that our dummy variable female is 1 if female and 0 if male; therefore, females are the omitted group. This is needed for proper interpretation of the estimates.

27 27 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM

28 28 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM Recall

29 29 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM It is also possible to run such an analysis using glm, using syntax like that below. To make the SPSS results match those from other packages, you need to create a new variable that has the opposite coding (i.e., switching the zeros and ones). We do this with the male variable.

30 30 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM Transform > Recode into Different Variables

31 31 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM Do not forget to reset first, to remove previous recoding.

32 32 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM

33 33 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM RECODE female (0=1) (1=0) INTO male. EXECUTE.

34 34 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM Now for the glm Analyze > General Linear Model > Univariate

35 35 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM

36 36 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM Set the model Use Ctrl and Shift to select multiple variables (product).

37 37 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM Use options to display parameter estimates. UNIANOVA weight BY male WITH height /METHOD=SSTYPE(3) /INTERCEPT=INCLUDE /PRINT=PARAMETER /CRITERIA=ALPHA(0.05) /DESIGN=male height height*male.

38 38 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM

39 39 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM As you see, the glm output corresponds to the output obtained by regression. The parameter estimates appear at the end of the glm output. They also correspond to the output from regression. The term male tests the null hypothesis Ho: B f = B m. The t value is - 6.52 and is significant, indicating that the regression coefficient B f is significantly different from B m.

40 40 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM Let's look at the parameter estimates to get a better understanding of what they mean and how they are interpreted. First, recall that our dummy variable female is 1 if female and 0 if male; therefore, females are the omitted group. This is needed for proper interpretation of the estimates.

41 41 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM

42 42 Interpreting a Model in which the slopes are allowed to differ across groups Friday, 19 December 20147:16 AM Easy methods for extracting individual regression slopes: Comparing SPSS, R, and Excel Easy methods for extracting individual regression slopes: Comparing SPSS, R, and Excel Roland Pfister, Katharina Schwarz, Robyn Carson and Markus Jancyzk Tutorials in Quantitative Methods for Psychology 2013 2(9) 72-78


Download ppt "1 Interpreting a Model in which the slopes are allowed to differ across groups Suppose Y is regressed on X1, Dummy1 (an indicator variable for group membership),"

Similar presentations


Ads by Google