Dear Statalist users,
I am using Stata 14 SE. The dataset I am working on is repeated measures survey data, gathered before and after an experiment (one year after). ID is the code for each individual, and wave refers to Wave 1 and Wave 3. (There was also a wave 2 but it is not part of this dataset). The dependent variable is 'factor1_w'. The treatment variable is 'Group'. Group that received the treatment is Group==1.
I am trying to understand if the treatment had caused a significant change on the variable titled 'factor1_w'.
I ran three xtmixed commands: one where I interact Group and the time variable (wave), and another where I limit the analysis to the Control and then the Treatment group and add 'wave' as a covariate.
I expect the results to be the same, but they are not.
While the interaction of time and treatment shows no significant effect, the analysis where I look at only the Treatment Group shows that 'wave' has a statistically significant negative effect, and the analysis on Control Group only shows that 'wave' does not have any significant effect.
If time (variable 'wave') has a significant effect on the dependent variable in the Treatment Group, should not it also be present in the effect of the interaction term?
I placed the sample data below, using dataex .
The two commands and the output is also below.
Any help is appreciated.
Regards,
Sule
I am using Stata 14 SE. The dataset I am working on is repeated measures survey data, gathered before and after an experiment (one year after). ID is the code for each individual, and wave refers to Wave 1 and Wave 3. (There was also a wave 2 but it is not part of this dataset). The dependent variable is 'factor1_w'. The treatment variable is 'Group'. Group that received the treatment is Group==1.
I am trying to understand if the treatment had caused a significant change on the variable titled 'factor1_w'.
I ran three xtmixed commands: one where I interact Group and the time variable (wave), and another where I limit the analysis to the Control and then the Treatment group and add 'wave' as a covariate.
I expect the results to be the same, but they are not.
While the interaction of time and treatment shows no significant effect, the analysis where I look at only the Treatment Group shows that 'wave' has a statistically significant negative effect, and the analysis on Control Group only shows that 'wave' does not have any significant effect.
If time (variable 'wave') has a significant effect on the dependent variable in the Treatment Group, should not it also be present in the effect of the interaction term?
I placed the sample data below, using dataex .
The two commands and the output is also below.
Any help is appreciated.
Regards,
Sule
Code:
clear input double ID byte wave double(Group Male NRGAgeN NRGEducN) float factor1_w 11001 1 0 0 2 1 .7437461 11001 3 0 0 2 1 .5075265 11002 1 0 1 3 2 .9770322 11002 3 0 1 3 2 . 11003 1 0 0 3 3 1.579619 11003 3 0 0 3 3 . 11004 1 0 0 2 3 1.9388603 11004 3 0 0 2 3 1.1451527 11005 1 0 0 3 4 1.5843916 11005 3 0 0 3 4 .9314132 end
Code:
xtmixed factor1_w wave##Group || ID:, var reml xtmixed factor1_w i.wave if Group==1 || ID:, var reml xtmixed factor1_w i.wave if Group==0 || ID:, var reml
Comment