Hi All,
I am trying to assess the effect of my IV (h_score) on my DV (lop_score), but I want to see if sex is an effect modifier of this association.
IV is continuous
DV is continuous
Sex (0 = male, 1 = female)
What I have done so far is the following code:
regress lop_score h_score
regress iop_score h_score if sex==0
regress iop_score h_score if sex==1
Which gives me the crude lop_score, as well as the lop_score for each sex.
Then, I realized the slopes and the coefficient are different between sexes
So I then assessed formally for an interaction by running:
regress lop_score h_score lop_score#c.h_score

lop_score  Coef. Std. Err. t P>t [95% Conf. Interval]
+
h_score  .3087371 .074398 4.15 0.000 .1628855 .4545888
sex  .4225724 .1000699 4.22 0.000 .6187519 .2263929

sex#c.h_score 
1  .0682006 .0999594 0.68 0.495 .2641637 .1277624

_cons  17.08114 .0748511 228.20 0.000 16.9344 17.22788

Then I did a Factorial ANOVA:
anova lop_score##c.h_score
Number of obs = 5,146 Rsquared = 0.0075
Root MSE = 3.45848 Adj Rsquared = 0.0069
Source  Partial SS df MS F Prob>F
+
Model  466.29203 3 155.43068 12.99 0.0000

h_score  361.16054 1 361.16054 30.19 0.0000
sex  213.28778 1 213.28778 17.83 0.0000
sex#h_score 5.5680037 1 5.5680037 0.47 0.4951

Residual  61503.882 5,142 11.961082
+
Total  61970.174 5,145 12.044737
I am hoping somebody can clarify for me:
1. Is running a factorial ANOVA technically the same thing as a linear regression, in terms of a p value? The p value is interestingly the same for my Beta coefficient for interaction term in my Lin Reg and the for the Prob>F value in my ANOVA corresponding to the interaction term .
2. What is the difference between # and ## if any?
3. This is a hybrid interaction as one term is continuous and the other is not; would I interpret this as:
"for every one unit increase in h_score, in females, the lop_score decreases 0.068 (.2641637  0.1277624, 95%CI)?"
4. Is it possible that you can have an interaction term in a regression that ends up not significant, even if you've run univariable regressions, seperated by sex, and seen that the B values are different from each other?
Thanks all for any clarification whatsoever; most of this is new to me and I'm trying my best to become as knowledgeable about this as possible.
I am trying to assess the effect of my IV (h_score) on my DV (lop_score), but I want to see if sex is an effect modifier of this association.
IV is continuous
DV is continuous
Sex (0 = male, 1 = female)
What I have done so far is the following code:
regress lop_score h_score
regress iop_score h_score if sex==0
regress iop_score h_score if sex==1
Which gives me the crude lop_score, as well as the lop_score for each sex.
Then, I realized the slopes and the coefficient are different between sexes
So I then assessed formally for an interaction by running:
regress lop_score h_score lop_score#c.h_score

lop_score  Coef. Std. Err. t P>t [95% Conf. Interval]
+
h_score  .3087371 .074398 4.15 0.000 .1628855 .4545888
sex  .4225724 .1000699 4.22 0.000 .6187519 .2263929

sex#c.h_score 
1  .0682006 .0999594 0.68 0.495 .2641637 .1277624

_cons  17.08114 .0748511 228.20 0.000 16.9344 17.22788

Then I did a Factorial ANOVA:
anova lop_score##c.h_score
Number of obs = 5,146 Rsquared = 0.0075
Root MSE = 3.45848 Adj Rsquared = 0.0069
Source  Partial SS df MS F Prob>F
+
Model  466.29203 3 155.43068 12.99 0.0000

h_score  361.16054 1 361.16054 30.19 0.0000
sex  213.28778 1 213.28778 17.83 0.0000
sex#h_score 5.5680037 1 5.5680037 0.47 0.4951

Residual  61503.882 5,142 11.961082
+
Total  61970.174 5,145 12.044737
I am hoping somebody can clarify for me:
1. Is running a factorial ANOVA technically the same thing as a linear regression, in terms of a p value? The p value is interestingly the same for my Beta coefficient for interaction term in my Lin Reg and the for the Prob>F value in my ANOVA corresponding to the interaction term .
2. What is the difference between # and ## if any?
3. This is a hybrid interaction as one term is continuous and the other is not; would I interpret this as:
"for every one unit increase in h_score, in females, the lop_score decreases 0.068 (.2641637  0.1277624, 95%CI)?"
4. Is it possible that you can have an interaction term in a regression that ends up not significant, even if you've run univariable regressions, seperated by sex, and seen that the B values are different from each other?
Thanks all for any clarification whatsoever; most of this is new to me and I'm trying my best to become as knowledgeable about this as possible.
Comment