I'm currently trying to replicate a piece of analysis originally done on SPSS in Stata 17 (Mac OS); specifically, a repeated-measures ANOVA.
The original SPSS code is:
Code:
GLM confrontT1 confrontT3 WITH changeconfrontCOVID /WSFACTOR=toename_confront_speed 2 Polynomial /METHOD=SSTYPE(3) /EMMEANS=TABLES(toename_confront_speed) WITH(changeconfrontCOVID=-30)COMPARE ADJ(LSD) /EMMEANS=TABLES(toename_confront_speed) WITH(changeconfrontCOVID=0)COMPARE ADJ(LSD) /EMMEANS=TABLES(toename_confront_speed) WITH(changeconfrontCOVID=30)COMPARE ADJ(LSD) /PRINT=DESCRIPTIVE ETASQ /CRITERIA=ALPHA(.05) /WSDESIGN=toename_confront_speed /DESIGN=changeconfrontCOVID.
The analysis was done on a dataset in wide format. I first reshaped the dataset into long format. The variables "confrontT1" and "confrontT3" are now "confrontT", "real_id" is an individual identifier, and "t" is time. The variable changeconfrontCOVID is a non-integer ranging from -100 to 100. A sample of the long format dataset is below,
Code:
* Example generated by -dataex-. For more info, type help dataex clear input double confrontT float real_id byte t double changeconfrontCOVID 5 3 1 -29.5 4 3 3 -29.5 6 5 1 18 6 5 3 18 4.5 7 1 . 1 7 3 . 6 19 1 -7.5 7 19 3 -7.5 1.5 21 1 30 1.5 21 3 30 5 23 1 -65 3.5 23 3 -65 1 24 1 22.5 1 24 3 22.5 4 32 1 62 end
Code:
anova confrontT c.changeconfrontCOVID / i.real_id | c.changeconfrontCOVID t c.changeconfrontCOVID#t, repeat(t)
invalid interaction specification;
'|' requires a factor variable on each side
'|' requires a factor variable on each side
changeconfrontCOVID: factor variables may not contain noninteger values
Best regards,
Miguel Fonseca
0 Response to Repeated measures ANOVA
Post a Comment