. use "exercise.dta"
. reshape long y, i(id) j(day)
. drop if (day==2 | day==10)
. xtmixed y i.group##i.day || id: , noconst ///
residuals(unstructured, t(day)) reml
Obtaining starting values by EM:
Performing gradient-based optimization:
Iteration 0: log restricted-likelihood = -446.73626 (not concave)
Iteration 1: log restricted-likelihood = -336.60468 (not concave)
Iteration 2: log restricted-likelihood = -316.61872 (not concave)
Iteration 3: log restricted-likelihood = -308.25196
Iteration 4: log restricted-likelihood = -304.16332
Iteration 5: log restricted-likelihood = -300.16614
Iteration 6: log restricted-likelihood = -298.69424
Iteration 7: log restricted-likelihood = -298.66997
Iteration 8: log restricted-likelihood = -298.66995
Computing standard errors:
Mixed-effects REML regression Number of obs = 173
Group variable: id Number of groups = 37
Obs per group: min = 3
avg = 4.7
max = 5
Wald chi2(9) = 43.31
Log restricted-likelihood = -298.66995 Prob > chi2 = 0.0000
------------------------------------------------------------------------------
y | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
2.group | 1.360119 1.031825 1.32 0.187 -.6622198 3.382458
|
day |
4 | 1.125 .341683 3.29 0.001 .4553136 1.794686
6 | 1.360171 .3873741 3.51 0.000 .600932 2.119411
8 | 1.584576 .5048459 3.14 0.002 .5950964 2.574056
12 | 1.623562 .5537523 2.93 0.003 .5382271 2.708896
|
group#day |
2 4 | -.169159 .4548987 -0.37 0.710 -1.060744 .722426
2 6 | .2112572 .5123693 0.41 0.680 -.7929682 1.215483
2 8 | -.1309186 .6714468 -0.19 0.845 -1.44693 1.185093
2 12 | .320518 .7532375 0.43 0.670 -1.1558 1.796836
|
_cons | 79.6875 .7773465 102.51 0.000 78.16393 81.21107
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
id: (empty) |
-----------------------------+------------------------------------------------
Residual: Unstructured |
sd(e0) | 3.109386 .371632 2.460025 3.930155
sd(e4) | 3.542606 .423616 2.802452 4.47824
sd(e6) | 3.262157 .3913439 2.57864 4.126854
sd(e8) | 3.740391 .4528304 2.9503 4.742067
sd(e12) | 3.734224 .4619653 2.9302 4.758867
corr(e0,e4) | .92373 .0248559 .8569743 .9599994
corr(e0,e6) | .884732 .0370517 .7867599 .9392225
corr(e0,e8) | .8437012 .0495937 .714624 .9172148
corr(e0,e12) | .810174 .0610429 .6523348 .9006626
corr(e4,e6) | .9597348 .0135117 .9227051 .9792164
corr(e4,e8) | .9493895 .0173758 .9015372 .9743002
corr(e4,e12) | .9016954 .0346425 .8068786 .9512169
corr(e6,e8) | .9577076 .0162689 .9108241 .9801979
corr(e6,e12) | .9112646 .0304676 .8283414 .9551135
corr(e8,e12) | .939416 .0223507 .8764453 .9707927
------------------------------------------------------------------------------
LR test vs. linear regression: chi2(14) = 296.13 Prob > chi2 = 0.0000
Note: The reported degrees of freedom assumes the null hypothesis is not on the
boundary of the parameter space. If this is not true, then the reported
test is conservative.
Autoregressive Covariance (REML Estimation)
. gen visit=day
. recode visit (0=1) (4=2) (6=3) (8=4) (12=5)
(visit: 185 changes made)
. xtmixed y i.group##i.day || id: , noconst residuals(ar 1, t(visit)) reml
Note: time gaps exist in the estimation data
Obtaining starting values by EM:
Performing gradient-based optimization:
Iteration 0: log restricted-likelihood = -446.73626 (not concave)
Iteration 1: log restricted-likelihood = -320.11973
Iteration 2: log restricted-likelihood = -310.59396
Iteration 3: log restricted-likelihood = -310.53595
Iteration 4: log restricted-likelihood = -310.53589
Iteration 5: log restricted-likelihood = -310.53589
Computing standard errors:
Mixed-effects REML regression Number of obs = 173
Group variable: id Number of groups = 37
Obs per group: min = 3
avg = 4.7
max = 5
Wald chi2(9) = 39.73
Log restricted-likelihood = -310.53589 Prob > chi2 = 0.0000
------------------------------------------------------------------------------
y | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
2.group | 1.360119 1.143159 1.19 0.234 -.8804318 3.60067
|
day |
4 | 1.125 .2978976 3.78 0.000 .5411315 1.708869
6 | 1.311971 .418601 3.13 0.002 .4915281 2.132414
8 | 1.534932 .5036625 3.05 0.002 .547772 2.522093
12 | 1.615939 .5745615 2.81 0.005 .4898188 2.742059
|
group#day |
2 4 | -.2143965 .3976147 -0.54 0.590 -.9937071 .564914
2 6 | .2594575 .5535425 0.47 0.639 -.8254658 1.344381
2 8 | -.0477374 .670704 -0.07 0.943 -1.362293 1.266818
2 12 | .3589018 .7788361 0.46 0.645 -1.167589 1.885392
|
_cons | 79.6875 .8612227 92.53 0.000 77.99953 81.37547
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
id: (empty) |
-----------------------------+------------------------------------------------
Residual: AR(1) |
rho | .9401763 .0145141 .9041454 .9629272
sd(e) | 3.444891 .3703569 2.790382 4.252921
------------------------------------------------------------------------------
LR test vs. linear regression: chi2(1) = 272.40 Prob > chi2 = 0.0000
Note: The reported degrees of freedom assumes the null hypothesis is not on the
boundary of the parameter space. If this is not true, then the reported
test is conservative.
Exponential Covariance (REML Estimation)
. xtmixed y i.group##i.day || id: , noconst residuals(exponential, t(day)) reml
Obtaining starting values by EM:
Performing gradient-based optimization:
Iteration 0: log restricted-likelihood = -428.20643 (not concave)
Iteration 1: log restricted-likelihood = -317.28453
Iteration 2: log restricted-likelihood = -309.28173
Iteration 3: log restricted-likelihood = -309.27294
Iteration 4: log restricted-likelihood = -309.27293
Computing standard errors:
Mixed-effects REML regression Number of obs = 173
Group variable: id Number of groups = 37
Obs per group: min = 3
avg = 4.7
max = 5
Wald chi2(9) = 34.63
Log restricted-likelihood = -309.27293 Prob > chi2 = 0.0001
------------------------------------------------------------------------------
y | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
2.group | 1.360119 1.143527 1.19 0.234 -.8811522 3.60139
|
day |
4 | 1.125 .3511182 3.20 0.001 .436821 1.813179
6 | 1.310419 .4279933 3.06 0.002 .4715678 2.149271
8 | 1.571879 .4890739 3.21 0.001 .6133114 2.530446
12 | 1.60783 .5898073 2.73 0.006 .4518286 2.763831
|
group#day |
2 4 | -.210826 .4678108 -0.45 0.652 -1.127718 .7060664
2 6 | .2610093 .566663 0.46 0.645 -.8496297 1.371648
2 8 | -.0735649 .6507037 -0.11 0.910 -1.348921 1.201791
2 12 | .3498045 .8031588 0.44 0.663 -1.224358 1.923967
|
_cons | 79.6875 .8614997 92.50 0.000 77.99899 81.37601
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
id: (empty) |
-----------------------------+------------------------------------------------
Residual: Exponential |
rho | .9785563 .0052913 .9653241 .9868081
sd(e) | 3.445999 .3689702 2.793671 4.250647
------------------------------------------------------------------------------
LR test vs. linear regression: chi2(1) = 274.93 Prob > chi2 = 0.0000
Note: The reported degrees of freedom assumes the null hypothesis is not on the
boundary of the parameter space. If this is not true, then the reported
test is conservative.