Hi,

Why the SE's of estimated marginal means differ in this case? And which one should be used if we want to estimate the factor level means?
(Note: EMMEANS is equivalent to margins, asbalanced when called after fitting other fixed-factor anova models without any repeated factors.)
Stata/SE 15.1 vs IBM SPSS 22

Stata code:
anova y subject time, repeated(time)
margins time

SPSS code:
GLM y.1 y.2 y.3 y.4
/WSFACTOR=j 4 Polynomial
/METHOD=SSTYPE(3)
/EMMEANS=TABLES(time)
/CRITERIA=ALPHA(.05)
/WSDESIGN=time.


Array

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float(y subject time)
20 1 1
24 1 2
28 1 3
28 1 4
15 2 1
18 2 2
23 2 3
24 2 4
18 3 1
19 3 2
24 3 3
23 3 4
26 4 1
26 4 2
30 4 3
30 4 4
22 5 1
24 5 2
28 5 3
26 5 4
19 6 1
21 6 2
27 6 3
25 6 4
end