13_Interaction_ANSWERS

docx

School

University of Pittsburgh *

*We aren’t endorsed by this school

Course

0036

Subject

Medicine

Date

Dec 6, 2023

Type

docx

Pages

9

Uploaded by MateComputerTapir16

Report
1 Linear Regression – Interactions In this homework you will be learning about interactions. The data is fake, not from the GSS. There are two sets of variables. Set 1: IV1: HrsTherapy1 – Number of Hours of Therapy per Month IV2: Medicine1 – Whether someone is receiving an antidepressant (1) or not (0) DV: Mood1 – higher is a better mood Set 2: IV1: HrsTherapy2 – Number of Hours of Therapy per Month IV2: Medicine2 – How much antidepressant someone is receiving from 0 to 4 mg DV: Mood2 – higher is a better mood All of the variables should be set at continuous, except Medicine1 which is binary. First, run the linear regression Mood1~ HrsTherapy1 + Medicine1 Based on the regression results, do you think that therapy is helpful? It has a significant positive influence **See Estimate 4.22 which is significant in the table It has no significant influence It has a significant negative influence Based on the regression results, do you think that the medicine is helpful? It has a significant positive influence **See Estimate 22.27 which is significant in table It has no significant influence It has a significant negative influence
2 Now, you are going to test for an interaction. Before doing so, it would be nice to visualize the data and see if there is any evidence of an interaction. To do this, click on the + Modules button at the top right of jamovi -> jamovi library ->Flexplot and install flexplot. Once you have done this, there should be an icon called Flexplot under Analyses next to Factor. Click on Flexolot, and add Mood1 (continuous) as the Outcome Variable and HrsTherapy (continuous) and Medicine1 (Nominal) as Predictor variables. For the Fitted Line, select Regression. From looking at the figure, do you think that there is an effect of HrsTherapy1 on Mood 1 within the no medicine (0) group? Positive influence of HrsTherapy1 on Mood1 within the no medicine (0) group ***In the figure above, the slope for the red line is positive. You might not be entirely sure if it is significant from looking at it. No influence of HrsTherapy1 on Mood1 within the no medicine (0) group
3 Negative influence of HrsTherapy1 on Mood1 within the no medicine (0) group From looking at the figure, do you think that there is a difference in slopes for the no medicine (0) group vs. the medicine (1) group? A difference of slopes would show up in the regression in the interaction term. Medicine group has more positive slope than no medicine ** In the figure above, the slope for the green line (Medicine) is more positive than the slope for the red (no medicine) group. No difference Medicine group has a more negative slope than no medicine From looking at the figure, do you think that the Medicine group has better or worse mood than the no-medicine group when HrsTherapy1 is zero. Stated another way, when someone does not receive any therapy, do you think that the medicine makes a difference? (This will also appear as the Medicine1 line in the regression.) Medicine group has more positive mood when HrsTherapy1 = 0 No difference ** In reality, there is not a significant difference. See in the figure below where I made the red circle. At this point, the lines for the two groups are overlapping – that is what the grey ‘confidence band’ around the lines mean. You can see that the two lines actually cross near 1, and near 0 they are still largely overlapping. Medicine group has more negative mood when HrsTherapy1 = 0 Now, run a regression to test for an interaction. Run the linear regression Mood1~ HrsTherapy1 + Medicine1 + HrsTherapy1*Medicine1
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
4 Note, sometimes this is also abbreviated as Mood1~ HrsTherapy1*Medicine1 The way to run this model is, after entering Mood1 as the DV, and HrsTherapy1 and Medicine1 as Covariates, click on Model Builder, and then click on both HrsTherapy1 and Medicine1 while holding down shift, and then move them both into Block 1. So it should appear as HrsTherapy1*Medicine1. When you run the regression there should be 4 rows: Intercept, HrsTherapy1, Medicine1, HrsTherapy1*Medicine1. Is the HrsTherapy1 regression term significantly positive or negative? Note, this row tests whether HrsTherapy1 is significant for the no medicine (Medicine1 = 0) group. Positive influence of HrsTherapy1 on Mood1 within the no medicine (0) group **See estimate 1.55 which is significant No influence of HrsTherapy1 on Mood1 within the no medicine (0) group Negative influence of HrsTherapy1 on Mood1 within the no medicine (0) group Is there a significant interaction? Note, if this is positive, it means that the slope of HrsTherapy1 is more positive for the Medicine (1) group than the no-medicine (0) group. Medicine group has more positive slope than no medicine **see estimate of 6.04 which is positive and significant No difference Medicine group has a more negative slope than no medicine Is the Medicine1 regression term significant? This tests whether more medicine is associated with better mood when HrsTherapy1 is zero. Stated another way, when someone does not receive any therapy, does the medicine makes a difference? Medicine group has more positive mood when HrsTherapy1 = 0 No difference **see estimate -5.88 which is not significant. This corresponds again to the red circle in the figure above. Medicine group has more negative mood when HrsTherapy1 = 0
5 Here is a summary of key points about interactions in regressions: First, if you don’t test for an interaction, like in the first regression that you ran, you would not know if there are or aren’t different slopes. Second, when you test for an interaction, the slope for the main IV (HrsTherapy1) in the regression is the slope when the other variable (Medicine1) is zero. Third, the interaction term is the difference in slopes between the Medicine vs. no medicine group. Fourth, something to remember about regressions is that you can use the regression outputs to predict the DV for a new person. In this regression, the estimates were: Intercept: 16.94 HrsTherapy1: 1.55 Medicine1: -5.88 HrsTherapy1*Medicine1: 6.04 So the regression equation is: Mood1 = 16.94 + 1.55 (Number hours of therapy per month) + 5.88 (1 if they got the medicine, 0 if not) + 6.04 (Number hours of therapy per month)(1 if they got the medicine, 0 if not) So, if someone did 5 hours of therapy per month and didn’t get the medicine, we would predict that their mood would be: 16.94 + 1.55(5) - 5.88(0) + 6.04(5)(0) = 24.69 See how this falls right on the red line, cool! And, if someone did 4 hours of therapy per month and did get the medicine, we would predict that their mood would be: 16.94 + 1.55(5) - 5.88(1) + 6.04(5)(1) = 49.01 See how this falls right on the teal line. Cool! Always good to verify that things are working multiple ways! So far in class we have mainly talked about interactions between two IVs in which one is continuous and another is binary . This case is easy to understand because you can plot it as two lines, one for each level. What happens if both the IVs are continuous?
6 I made a second set of data called Mood2, HrsTherapy2, and Medicine 2. In this dataset, now instead of receiving medicine or not, it is the amount of medicine with four levels: none (0), a little (1), medium (2), or a lot (3). Make a Flexplot putting Mood2 as the Outcome Variable and HrsTherapy2 and Medicine2 as the Predictor Variables. Describe what you see and explain what it means. There are four slopes. The slope is flat for the no-medicine group, and the slopes get progressively stronger with more medicine. This can be described like a fan or like a hand with spread-out fingers. This means that there is a synergistic effect between therapy and medicine – with more medicine, the influence of therapy on mood has a bigger influence. Or, it could also be stated in another way – with higher levels of therapy, the benefits of medicine becomes bigger! Now run a regression with HrsTherapy2, Medicine2, and their interaction as predictors of Mood2.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
7 Is the HrsTherapy2 regression term significantly positive or negative? Note, this row tests whether HrsTherapy2 is significant for the no medicine (Medicine2 = 0) group. Positive influence of HrsTherapy1 on Mood1 within the no medicine (0) group No influence of HrsTherapy1 on Mood1 within the no medicine (0) group **Estimate = 0.07, p-value non-significant. You can see that the slope is flat for the purple (medicine 0) group. Negative influence of HrsTherapy1 on Mood1 within the no medicine (0) group Is there a significant interaction? Note, if this is positive, it means that the slope of HrsTherapy1 is more positive for increasing levels of medicine. So it is more positive for group 3 than 2 than 1 than 0. Positive interaction **Estimate is 2.05, p<.001. This tests whether for more medicine, the slope for therapy increases. Or likewise, for higher amounts of therapy, the benefit of medicine increases. This is the fanning-out pattern in the graph. No difference Negative interaction Is the Medicine2 regression term significant? This tests whether more medicine is associated with better mood when HrsTherapy2 is zero. Stated another way, when someone does not receive any therapy, does the medicine makes a difference? Medicine group has more positive mood when HrsTherapy1 = 0 *See estimate 4.76, p<.001. In the graph below, in the circled red part, when HrsTherapy2 is 0, the purple line does look somewhat lower than the blue, green, and yellow lines. Note, only the yellow line goes all the way to zero – this is because the lowest numbers of therapy for observations in the other groups is around 1. But what this term in the regression tests for is, if we were to extend these lines to 0, whether there is a general increase in where these lines hit HrsTherapy=0. No difference Medicine group has more negative mood when HrsTherapy1 = 0
8 Suppose we want to predict someone’s Mood who goes to 6 hours of therapy per month, and is on the medium dose (2) of the medicine. What would their mood be? The estimates we got are below: So the regression equation is: Mood = 8.8 + .07(HrsTherapy) + 4.7(Medicine) + 2.1(HrsTherapy)(Medicine) 8.8 + .07(6) + 4.7(2) + 2.1(6)(2) = 43.8 Notice how 43.8 falls on the green line when HrsTherapy=6!
9 What do you understand about interactions now that you didn’t understand before about interactions? Answers will vary for different students What do you still not understand about interactions? Answers will vary for different students If you feel like you still don’t understand something important, how will you get this information? NA – I think I understand the most important things Re-watch lecture videos Ask my group members Go to office hours Good job learning about interactions!
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help