------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  STATA_Chapter4
       log:  C:\Dropbox\PilesOfVariance\Chapter4\STATA\STATA_Chapter4_Output.smcl
  log type:  smcl
 opened on:  21 Oct 2014, 09:20:47


. . display as result "Chapter 4 Example: Means by StudyDay for Positive Mood outcome" Chapter 4 Example: Means by StudyDay for Positive Mood outcome

. tabulate studyday, summarize(posmood)

studyday: | Day of | Summary of posmood: Positive Mood Study (1 to | Rating (1 to 5) 7) | Mean Std. Dev. Freq. ------------+------------------------------------ 1 | 3.6983522 .75932519 192 2 | 3.7608782 .74191965 195 3 | 3.6976149 .75112316 194 4 | 3.7009648 .76038526 197 5 | 3.7429638 .72979766 197 6 | 3.7014449 .71098376 196 7 | 3.7190701 .74504013 199 ------------+------------------------------------ Total | 3.7173899 .74151661 1370

. . display as result "Ch 4: Saturated Means, Unstructured R-Only Model" Ch 4: Saturated Means, Unstructured R-Only Model

. display as result "Test for mean differences across days" Test for mean differences across days

. mixed posmood i.studyday, /// > || personid: , noconstant variance reml covariance(unstructured) /// > residuals(unstructured,t(studyday)),

Obtaining starting values by EM:

Performing gradient-based optimization:

Iteration 0: log restricted-likelihood = -1547.1828 (not concave) Iteration 1: log restricted-likelihood = -1066.1668 Iteration 2: log restricted-likelihood = -1010.9925 Iteration 3: log restricted-likelihood = -1004.4558 Iteration 4: log restricted-likelihood = -1004.0025 Iteration 5: log restricted-likelihood = -1004.0011 Iteration 6: log restricted-likelihood = -1004.0011

Computing standard errors:

Mixed-effects REML regression Number of obs = 1370 Group variable: personid Number of groups = 200

Obs per group: min = 4 avg = 6.8 max = 7



Wald chi2(6) = 4.65 Log restricted-likelihood = -1004.0011 Prob > chi2 = 0.5894

------------------------------------------------------------------------------ posmood | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- studyday | 2 | .0479807 .0367583 1.31 0.192 -.0240642 .1200256 3 | -.012323 .0428554 -0.29 0.774 -.0963181 .0716721 4 | -.0182561 .0426912 -0.43 0.669 -.1019294 .0654172 5 | .0230229 .0420647 0.55 0.584 -.0594224 .1054683 6 | -.0172376 .0448114 -0.38 0.700 -.1050664 .0705911 7 | -.011488 .0478975 -0.24 0.810 -.1053653 .0823893 | _cons | 3.734786 .054963 67.95 0.000 3.627061 3.842512 ------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ personid: (empty) | -----------------------------+------------------------------------------------ Residual: Unstructured | var(e1) | .5954834 .0611572 .4869112 .7282652 var(e2) | .5640254 .0574053 .4620247 .6885447 var(e3) | .5772321 .0588677 .4726532 .70495 var(e4) | .5883853 .0595182 .4825679 .7174063 var(e5) | .5417469 .0548186 .4442879 .6605845 var(e6) | .5119749 .0518979 .4197242 .6245011 var(e7) | .5570255 .0560184 .4573748 .6783875 cov(e1,e2) | .4503922 .0528631 .3467826 .5540019 cov(e1,e3) | .4097711 .0516285 .3085812 .510961 cov(e1,e4) | .4152337 .0518406 .313628 .5168393 cov(e1,e5) | .397019 .0496511 .2997046 .4943334 cov(e1,e6) | .3592537 .0471811 .2667803 .451727 cov(e1,e7) | .3517675 .0483655 .2569729 .4465621 cov(e2,e3) | .3988206 .0500033 .3008159 .4968254 cov(e2,e4) | .4284519 .0513819 .3277451 .5291586 cov(e2,e5) | .4088366 .0491871 .3124316 .5052416 cov(e2,e6) | .3549192 .0460214 .264719 .4451195 cov(e2,e7) | .3684874 .0478115 .2747785 .4621963 cov(e3,e4) | .412896 .0510796 .3127817 .5130102 cov(e3,e5) | .4145386 .0498226 .3168882 .512189 cov(e3,e6) | .3528624 .046431 .2618594 .4438655 cov(e3,e7) | .3887702 .0491039 .2925283 .4850121 cov(e4,e5) | .4244063 .0503958 .3256323 .5231802 cov(e4,e6) | .4137844 .0491111 .3175284 .5100404 cov(e4,e7) | .3868429 .0492697 .2902761 .4834098 cov(e5,e6) | .3639662 .0456866 .2744221 .4535104 cov(e5,e7) | .3822045 .0476426 .2888268 .4755823 cov(e6,e7) | .3419375 .0452543 .2532408 .4306342 ------------------------------------------------------------------------------ LR test vs. linear regression: chi2(27) = 1086.36 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.

. estat ic, n(200),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 200 . -1004.001 35 2078.002 2193.443 ----------------------------------------------------------------------------- Note: N=200 used in calculating BIC

. estat wcorrelation, covariance,

Covariances for personid = 1:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- 1 | 0.595 2 | 0.450 0.564 3 | 0.410 0.399 0.577 4 | 0.415 0.428 0.413 0.588 5 | 0.397 0.409 0.415 0.424 0.542 6 | 0.359 0.355 0.353 0.414 0.364 0.512 7 | 0.352 0.368 0.389 0.387 0.382 0.342 0.557

. estat wcorrelation,

Standard deviations and correlations for personid = 1:

Standard deviations:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- sd | 0.772 0.751 0.760 0.767 0.736 0.716 0.746

Correlations:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- 1 | 1.000 2 | 0.777 1.000 3 | 0.699 0.699 1.000 4 | 0.701 0.744 0.708 1.000 5 | 0.699 0.740 0.741 0.752 1.000 6 | 0.651 0.660 0.649 0.754 0.691 1.000 7 | 0.611 0.657 0.686 0.676 0.696 0.640 1.000

. contrast i.studyday,

Contrasts of marginal linear predictions

Margins : asbalanced

------------------------------------------------ | df chi2 P>chi2 -------------+---------------------------------- posmood | studyday | 6 4.65 0.5894 ------------------------------------------------

. margins i.studyday,

Adjusted predictions Number of obs = 1370

Expression : Linear prediction, fixed portion, predict()

------------------------------------------------------------------------------ | Delta-method | Margin Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- studyday | 1 | 3.734786 .054963 67.95 0.000 3.627061 3.842512 2 | 3.782767 .0533208 70.94 0.000 3.67826 3.887274 3 | 3.722463 .0540112 68.92 0.000 3.616603 3.828324 4 | 3.71653 .0543587 68.37 0.000 3.609989 3.823071 5 | 3.757809 .0521661 72.04 0.000 3.655566 3.860053 6 | 3.717549 .0507882 73.20 0.000 3.618006 3.817092 7 | 3.723298 .052829 70.48 0.000 3.619756 3.826841 ------------------------------------------------------------------------------

. margins i.studyday, pwcompare(pveffects)

Pairwise comparisons of adjusted predictions

Expression : Linear prediction, fixed portion, predict()

----------------------------------------------------- | Delta-method Unadjusted | Contrast Std. Err. z P>|z| -------------+--------------------------------------- studyday | 2 vs 1 | .0479807 .0367583 1.31 0.192 3 vs 1 | -.012323 .0428554 -0.29 0.774 4 vs 1 | -.0182561 .0426912 -0.43 0.669 5 vs 1 | .0230229 .0420647 0.55 0.584 6 vs 1 | -.0172376 .0448114 -0.38 0.700 7 vs 1 | -.011488 .0478975 -0.24 0.810 3 vs 2 | -.0603037 .0420789 -1.43 0.152 4 vs 2 | -.0662368 .0388804 -1.70 0.088 5 vs 2 | -.0249578 .0383903 -0.65 0.516 6 vs 2 | -.0652184 .0432831 -1.51 0.132 7 vs 2 | -.0594687 .0441493 -1.35 0.178 4 vs 3 | -.0059331 .0417194 -0.14 0.887 5 vs 3 | .0353459 .0386444 0.91 0.360 6 vs 3 | -.0049146 .0443572 -0.11 0.912 7 vs 3 | .000835 .0426672 0.02 0.984 5 vs 4 | .041279 .0378446 1.09 0.275 6 vs 4 | .0010184 .0373721 0.03 0.978 7 vs 4 | .0067681 .0433284 0.16 0.876 6 vs 5 | -.0402606 .040743 -0.99 0.323 7 vs 5 | -.0345109 .0411119 -0.84 0.401 7 vs 6 | .0057496 .0441701 0.13 0.896 -----------------------------------------------------

. . display as result "Ch 4: Empty Means, Unstructured R-Only Model" Ch 4: Empty Means, Unstructured R-Only Model

. display as result "Best-fitting and least parsimonious baseline" Best-fitting and least parsimonious baseline

. mixed posmood , /// > || personid: , noconstant variance reml covariance(unstructured) /// > residuals(unstructured,t(studyday)),

Obtaining starting values by EM:

Performing gradient-based optimization:

Iteration 0: log restricted-likelihood = -1536.7281 (not concave) Iteration 1: log restricted-likelihood = -1055.8937 Iteration 2: log restricted-likelihood = -999.93878 Iteration 3: log restricted-likelihood = -992.21623 Iteration 4: log restricted-likelihood = -991.55536 Iteration 5: log restricted-likelihood = -991.5533 Iteration 6: log restricted-likelihood = -991.5533

Computing standard errors:

Mixed-effects REML regression Number of obs = 1370 Group variable: personid Number of groups = 200

Obs per group: min = 4 avg = 6.8 max = 7



Wald chi2(0) = . Log restricted-likelihood = -991.5533 Prob > chi2 = .

------------------------------------------------------------------------------ posmood | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _cons | 3.735287 .0449729 83.06 0.000 3.647142 3.823433 ------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ personid: (empty) | -----------------------------+------------------------------------------------ Residual: Unstructured | var(e1) | .5953499 .0610296 .4869846 .727829 var(e2) | .5631702 .0573903 .4612085 .6876732 var(e3) | .5774636 .0588131 .4729683 .7050456 var(e4) | .5884928 .0594675 .4827551 .7173902 var(e5) | .5406841 .0546713 .4434802 .6591934 var(e6) | .5121272 .0518758 .4199094 .6245974 var(e7) | .5565283 .0559129 .4570559 .6776497 cov(e1,e2) | .4495077 .0527821 .3460568 .5529587 cov(e1,e3) | .4107404 .051598 .3096102 .5118706 cov(e1,e4) | .415833 .0517968 .3143132 .5173528 cov(e1,e5) | .3969976 .0495731 .299836 .4941591 cov(e1,e6) | .360047 .0471634 .2676083 .4524856 cov(e1,e7) | .3525828 .0483205 .2578763 .4472893 cov(e2,e3) | .3974823 .0499162 .2996484 .4953162 cov(e2,e4) | .4265111 .0512419 .3260787 .5269434 cov(e2,e5) | .4082761 .0491782 .3118885 .5046637 cov(e2,e6) | .3534403 .0459387 .2634022 .4434785 cov(e2,e7) | .3671575 .0477108 .273646 .4606691 cov(e3,e4) | .4139152 .051089 .3137827 .5140477 cov(e3,e5) | .4140917 .0497372 .3166085 .5115749 cov(e3,e6) | .3540279 .0464611 .2629659 .44509 cov(e3,e7) | .3895517 .049086 .2933449 .4857585 cov(e4,e5) | .4236609 .0502866 .3251011 .5222208 cov(e4,e6) | .4146427 .0491303 .3183491 .5109363 cov(e4,e7) | .3876445 .0492596 .2910975 .4841916 cov(e5,e6) | .3636233 .0456202 .2742094 .4530371 cov(e5,e7) | .3817583 .0475456 .2885706 .474946 cov(e6,e7) | .3427667 .045267 .254045 .4314884 ------------------------------------------------------------------------------ LR test vs. linear regression: chi2(27) = 1090.35 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.

. estat ic, n(200),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 200 . -991.5533 29 2041.107 2136.758 ----------------------------------------------------------------------------- Note: N=200 used in calculating BIC

. estat wcorrelation, covariance,

Covariances for personid = 1:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- 1 | 0.595 2 | 0.450 0.563 3 | 0.411 0.397 0.577 4 | 0.416 0.427 0.414 0.588 5 | 0.397 0.408 0.414 0.424 0.541 6 | 0.360 0.353 0.354 0.415 0.364 0.512 7 | 0.353 0.367 0.390 0.388 0.382 0.343 0.557

. estat wcorrelation,

Standard deviations and correlations for personid = 1:

Standard deviations:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- sd | 0.772 0.750 0.760 0.767 0.735 0.716 0.746

Correlations:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- 1 | 1.000 2 | 0.776 1.000 3 | 0.701 0.697 1.000 4 | 0.703 0.741 0.710 1.000 5 | 0.700 0.740 0.741 0.751 1.000 6 | 0.652 0.658 0.651 0.755 0.691 1.000 7 | 0.613 0.656 0.687 0.677 0.696 0.642 1.000

. estimates store UN,

. . display as result "Ch 4: Empty Means, Compound Symmetry R-Only Model" Ch 4: Empty Means, Compound Symmetry R-Only Model

. display as result "Worst-fitting and most parsimonious baseline" Worst-fitting and most parsimonious baseline

. mixed posmood , /// > || personid: , noconstant variance reml covariance(unstructured) /// > residuals(exchangeable,t(studyday)), Note: t() not required for this residual structure; ignored

Obtaining starting values by EM:

Performing gradient-based optimization:

Iteration 0: log restricted-likelihood = -1536.7281 Iteration 1: log restricted-likelihood = -1015.6142 Iteration 2: log restricted-likelihood = -1014.6019 Iteration 3: log restricted-likelihood = -1014.6006 Iteration 4: log restricted-likelihood = -1014.6006

Computing standard errors:

Mixed-effects REML regression Number of obs = 1370 Group variable: personid Number of groups = 200

Obs per group: min = 4 avg = 6.8 max = 7



Wald chi2(0) = . Log restricted-likelihood = -1014.6006 Prob > chi2 = .

------------------------------------------------------------------------------ posmood | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _cons | 3.735623 .0455563 82.00 0.000 3.646335 3.824912 ------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ personid: (empty) | -----------------------------+------------------------------------------------ Residual: Exchangeable | var(e) | .5604235 .0421149 .4836709 .6493558 cov(e) | .3899991 .0417079 .3082531 .4717452 ------------------------------------------------------------------------------ LR test vs. linear regression: chi2(1) = 1044.25 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.

. estat ic, n(200),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 200 . -1014.601 3 2035.201 2045.096 ----------------------------------------------------------------------------- Note: N=200 used in calculating BIC

. estat wcorrelation, covariance,

Covariances for personid = 1:

obs | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- 1 | 0.560 2 | 0.390 0.560 3 | 0.390 0.390 0.560 4 | 0.390 0.390 0.390 0.560 5 | 0.390 0.390 0.390 0.390 0.560 6 | 0.390 0.390 0.390 0.390 0.390 0.560 7 | 0.390 0.390 0.390 0.390 0.390 0.390 0.560

. estat wcorrelation,

Standard deviations and correlations for personid = 1:

Standard deviations:

obs | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- sd | 0.749 0.749 0.749 0.749 0.749 0.749 0.749

Correlations:

obs | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- 1 | 1.000 2 | 0.696 1.000 3 | 0.696 0.696 1.000 4 | 0.696 0.696 0.696 1.000 5 | 0.696 0.696 0.696 0.696 1.000 6 | 0.696 0.696 0.696 0.696 0.696 1.000 7 | 0.696 0.696 0.696 0.696 0.696 0.696 1.000

. estimates store CS,

. lrtest UN CS,

Likelihood-ratio test LR chi2(26) = 46.09 (Assumption: CS nested in UN) Prob > chi2 = 0.0089

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. Note: LR tests based on REML are valid only when the fixed-effects specification is identical for both models.

. . display as result "Ch 4: Empty Means, First-Order Auto-Regressive R-Only Model" Ch 4: Empty Means, First-Order Auto-Regressive R-Only Model

. mixed posmood , /// > || personid: , noconstant variance reml covariance(unstructured) /// > residuals(ar1,t(studyday)), Note: time gaps exist in the estimation data

Obtaining starting values by EM:

Performing gradient-based optimization:

Iteration 0: log restricted-likelihood = -1536.7281 Iteration 1: log restricted-likelihood = -1363.0029 Iteration 2: log restricted-likelihood = -1143.4914 Iteration 3: log restricted-likelihood = -1139.9882 Iteration 4: log restricted-likelihood = -1139.8961 Iteration 5: log restricted-likelihood = -1139.8961

Computing standard errors:

Mixed-effects REML regression Number of obs = 1370 Group variable: personid Number of groups = 200

Obs per group: min = 4 avg = 6.8 max = 7



Wald chi2(0) = . Log restricted-likelihood = -1139.8961 Prob > chi2 = .

------------------------------------------------------------------------------ posmood | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _cons | 3.731198 .0375553 99.35 0.000 3.657591 3.804805 ------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ personid: (empty) | -----------------------------+------------------------------------------------ Residual: AR(1) | rho | .7129477 .0181635 .6754792 .746744 var(e) | .5627133 .0331484 .501354 .6315822 ------------------------------------------------------------------------------ LR test vs. linear regression: chi2(1) = 793.66 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.

. estat ic, n(200),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 200 . -1139.896 3 2285.792 2295.687 ----------------------------------------------------------------------------- Note: N=200 used in calculating BIC

. estat wcorrelation, covariance,

Covariances for personid = 1:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- 1 | 0.563 2 | 0.401 0.563 3 | 0.286 0.401 0.563 4 | 0.204 0.286 0.401 0.563 5 | 0.145 0.204 0.286 0.401 0.563 6 | 0.104 0.145 0.204 0.286 0.401 0.563 7 | 0.074 0.104 0.145 0.204 0.286 0.401 0.563

. estat wcorrelation,

Standard deviations and correlations for personid = 1:

Standard deviations:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- sd | 0.750 0.750 0.750 0.750 0.750 0.750 0.750

Correlations:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- 1 | 1.000 2 | 0.713 1.000 3 | 0.508 0.713 1.000 4 | 0.362 0.508 0.713 1.000 5 | 0.258 0.362 0.508 0.713 1.000 6 | 0.184 0.258 0.362 0.508 0.713 1.000 7 | 0.131 0.184 0.258 0.362 0.508 0.713 1.000

. estimates store AR1,

. lrtest UN AR1,

Likelihood-ratio test LR chi2(26) = 296.69 (Assumption: AR1 nested in UN) 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. Note: LR tests based on REML are valid only when the fixed-effects specification is identical for both models.

. . display as result "Ch 4: Empty Means, n-1 Lag Toeplitz R-Only Model" Ch 4: Empty Means, n-1 Lag Toeplitz R-Only Model

. mixed posmood , /// > || personid: , noconstant variance reml covariance(unstructured) /// > residuals(toeplitz6,t(studyday)), Note: time gaps exist in the estimation data

Obtaining starting values by EM:

Performing gradient-based optimization:

Iteration 0: log restricted-likelihood = -1536.7281 (not concave) Iteration 1: log restricted-likelihood = -1290.0003 (not concave) Iteration 2: log restricted-likelihood = -1127.4645 Iteration 3: log restricted-likelihood = -1103.9003 Iteration 4: log restricted-likelihood = -1045.7564 Iteration 5: log restricted-likelihood = -1010.5271 Iteration 6: log restricted-likelihood = -1004.9793 Iteration 7: log restricted-likelihood = -1004.9531 Iteration 8: log restricted-likelihood = -1004.9531

Computing standard errors:

Mixed-effects REML regression Number of obs = 1370 Group variable: personid Number of groups = 200

Obs per group: min = 4 avg = 6.8 max = 7



Wald chi2(0) = . Log restricted-likelihood = -1004.9531 Prob > chi2 = .

------------------------------------------------------------------------------ posmood | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _cons | 3.735746 .0455171 82.07 0.000 3.646534 3.824958 ------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ personid: (empty) | -----------------------------+------------------------------------------------ Residual: Toeplitz(6) | cov1 | .3985692 .0420015 .3162478 .4808906 cov2 | .4062513 .0419684 .3239948 .4885078 cov3 | .3850755 .0419538 .3028475 .4673035 cov4 | .3823008 .042189 .2996118 .4649897 cov5 | .3709108 .042686 .2872478 .4545738 cov6 | .3477053 .0439774 .2615112 .4338995 var(e) | .5609115 .0421003 .4841788 .6498049 ------------------------------------------------------------------------------ LR test vs. linear regression: chi2(6) = 1063.55 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.

. estat ic, n(200),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 200 . -1004.953 8 2025.906 2052.293 ----------------------------------------------------------------------------- Note: N=200 used in calculating BIC

. estat wcorrelation, covariance,

Covariances for personid = 1:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- 1 | 0.561 2 | 0.399 0.561 3 | 0.406 0.399 0.561 4 | 0.385 0.406 0.399 0.561 5 | 0.382 0.385 0.406 0.399 0.561 6 | 0.371 0.382 0.385 0.406 0.399 0.561 7 | 0.348 0.371 0.382 0.385 0.406 0.399 0.561

. estat wcorrelation,

Standard deviations and correlations for personid = 1:

Standard deviations:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- sd | 0.749 0.749 0.749 0.749 0.749 0.749 0.749

Correlations:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- 1 | 1.000 2 | 0.711 1.000 3 | 0.724 0.711 1.000 4 | 0.687 0.724 0.711 1.000 5 | 0.682 0.687 0.724 0.711 1.000 6 | 0.661 0.682 0.687 0.724 0.711 1.000 7 | 0.620 0.661 0.682 0.687 0.724 0.711 1.000

. estimates store TOEP7,

. lrtest UN TOEP7,

Likelihood-ratio test LR chi2(21) = 26.80 (Assumption: TOEP7 nested in UN) Prob > chi2 = 0.1776

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. Note: LR tests based on REML are valid only when the fixed-effects specification is identical for both models.

. lrtest TOEP7 CS,

Likelihood-ratio test LR chi2(5) = 19.30 (Assumption: CS nested in TOEP7) Prob > chi2 = 0.0017

Note: LR tests based on REML are valid only when the fixed-effects specification is identical for both models.

. lrtest TOEP7 AR1,

Likelihood-ratio test LR chi2(5) = 269.89 (Assumption: AR1 nested in TOEP7) Prob > chi2 = 0.0000

Note: LR tests based on REML are valid only when the fixed-effects specification is identical for both models.

. . display as result "Ch 4: Empty Means, Random Intercept in G" Ch 4: Empty Means, Random Intercept in G

. display as result "Diagonal R" Diagonal R

. mixed posmood , /// > || personid: , variance reml covariance(unstructured) /// > residuals(independent,t(studyday)), Note: single-variable random-effects specification in personid equation; covariance structure set to identity Note: t() not required for this residual structure; ignored

Performing EM optimization:

Performing gradient-based optimization:

Iteration 0: log restricted-likelihood = -1014.6006 Iteration 1: log restricted-likelihood = -1014.6006

Computing standard errors:

Mixed-effects REML regression Number of obs = 1370 Group variable: personid Number of groups = 200

Obs per group: min = 4 avg = 6.8 max = 7



Wald chi2(0) = . Log restricted-likelihood = -1014.6006 Prob > chi2 = .

------------------------------------------------------------------------------ posmood | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _cons | 3.735623 .0455563 82.00 0.000 3.646335 3.824912 ------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ personid: Identity | var(_cons) | .3899992 .0417079 .3162518 .4809438 -----------------------------+------------------------------------------------ var(Residual) | .1704244 .0070485 .1571546 .1848146 ------------------------------------------------------------------------------ LR test vs. linear regression: chibar2(01) = 1044.25 Prob >= chibar2 = 0.0000

. estat ic, n(200),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 200 . -1014.601 3 2035.201 2045.096 ----------------------------------------------------------------------------- Note: N=200 used in calculating BIC

. estat icc,

Intraclass correlation

------------------------------------------------------------------------------ Level | ICC Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ personid | .6959008 .0244804 .6459137 .7416536 ------------------------------------------------------------------------------

. estat recovariance, relevel(personid),

Random-effects covariance matrix for level personid

| _cons -------------+----------- _cons | .3899992

. estat recovariance, relevel(personid) correlation,

Random-effects correlation matrix for level personid

| _cons -------------+----------- _cons | 1

. estat wcorrelation, covariance,

Covariances for personid = 1:

obs | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- 1 | 0.560 2 | 0.390 0.560 3 | 0.390 0.390 0.560 4 | 0.390 0.390 0.390 0.560 5 | 0.390 0.390 0.390 0.390 0.560 6 | 0.390 0.390 0.390 0.390 0.390 0.560 7 | 0.390 0.390 0.390 0.390 0.390 0.390 0.560

. estat wcorrelation,

Standard deviations and correlations for personid = 1:

Standard deviations:

obs | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- sd | 0.749 0.749 0.749 0.749 0.749 0.749 0.749

Correlations:

obs | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- 1 | 1.000 2 | 0.696 1.000 3 | 0.696 0.696 1.000 4 | 0.696 0.696 0.696 1.000 5 | 0.696 0.696 0.696 0.696 1.000 6 | 0.696 0.696 0.696 0.696 0.696 1.000 7 | 0.696 0.696 0.696 0.696 0.696 0.696 1.000

. estimates store RIDIAG,

. lrtest UN RIDIAG, force

Likelihood-ratio test LR chi2(26) = 46.09 (Assumption: RIDIAG nested in UN) Prob > chi2 = 0.0089

. . display as result "Ch 4: Empty Means, Random Intercept in G" Ch 4: Empty Means, Random Intercept in G

. display as result "Diagonal Heterogeneous R" Diagonal Heterogeneous R

. mixed posmood , /// > || personid: , variance reml covariance(unstructured) /// > residuals(banded0,t(studyday)), Note: single-variable random-effects specification in personid equation; covariance structure set to identity

Obtaining starting values by EM:

Performing gradient-based optimization:

Iteration 0: log restricted-likelihood = -1014.6006 Iteration 1: log restricted-likelihood = -1010.2695 Iteration 2: log restricted-likelihood = -1009.3552 Iteration 3: log restricted-likelihood = -1009.3536 Iteration 4: log restricted-likelihood = -1009.3536

Computing standard errors:

Mixed-effects REML regression Number of obs = 1370 Group variable: personid Number of groups = 200

Obs per group: min = 4 avg = 6.8 max = 7



Wald chi2(0) = . Log restricted-likelihood = -1009.3536 Prob > chi2 = .

------------------------------------------------------------------------------ posmood | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _cons | 3.737317 .0457261 81.73 0.000 3.647695 3.826938 ------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ personid: Identity | var(_cons) | .3936441 .0420571 .3192722 .4853404 -----------------------------+------------------------------------------------ Residual: Banded(0) | var(e1) | .1886439 .0220104 .1500814 .2371147 var(e2) | .1529311 .0183265 .1209184 .1934191 var(e3) | .1761755 .0206031 .1400879 .2215595 var(e4) | .1477523 .0176886 .1168505 .1868263 var(e5) | .1353809 .0164482 .1066939 .1717809 var(e6) | .1785993 .0208261 .1421094 .2244589 var(e7) | .2115856 .0238248 .1696835 .263835 ------------------------------------------------------------------------------ LR test vs. linear regression: chi2(7) = 1054.75 Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

. estat ic, n(200),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 200 . -1009.354 9 2036.707 2066.392 ----------------------------------------------------------------------------- Note: N=200 used in calculating BIC

. estat recovariance, relevel(personid),

Random-effects covariance matrix for level personid

| _cons -------------+----------- _cons | .3936441

. estat recovariance, relevel(personid) correlation,

Random-effects correlation matrix for level personid

| _cons -------------+----------- _cons | 1

. estat wcorrelation, covariance,

Covariances for personid = 1:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- 1 | 0.582 2 | 0.394 0.547 3 | 0.394 0.394 0.570 4 | 0.394 0.394 0.394 0.541 5 | 0.394 0.394 0.394 0.394 0.529 6 | 0.394 0.394 0.394 0.394 0.394 0.572 7 | 0.394 0.394 0.394 0.394 0.394 0.394 0.605

. estat wcorrelation,

Standard deviations and correlations for personid = 1:

Standard deviations:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- sd | 0.763 0.739 0.755 0.736 0.727 0.756 0.778

Correlations:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- 1 | 1.000 2 | 0.698 1.000 3 | 0.683 0.705 1.000 4 | 0.701 0.724 0.709 1.000 5 | 0.709 0.732 0.717 0.736 1.000 6 | 0.682 0.704 0.689 0.707 0.715 1.000 7 | 0.663 0.684 0.670 0.688 0.696 0.669 1.000

. estimates store RIDIAGH,

. lrtest UN RIDIAGH, force

Likelihood-ratio test LR chi2(20) = 35.60 (Assumption: RIDIAGH nested in UN) Prob > chi2 = 0.0171

. lrtest RIDIAGH RIDIAG, force

Likelihood-ratio test LR chi2(6) = 10.49 (Assumption: RIDIAG nested in RIDIAGH) Prob > chi2 = 0.1053

. . display as result "Ch 4: Empty Means, Random Intercept in G" Ch 4: Empty Means, Random Intercept in G

. display as result "First-Order Autoregressive R" First-Order Autoregressive R

. mixed posmood , /// > || personid: , variance reml covariance(unstructured) /// > residuals(ar1,t(studyday)), Note: single-variable random-effects specification in personid equation; covariance structure set to identity Note: time gaps exist in the estimation data

Obtaining starting values by EM:

Performing gradient-based optimization:

Iteration 0: log restricted-likelihood = -1014.6006 Iteration 1: log restricted-likelihood = -1013.7119 Iteration 2: log restricted-likelihood = -1013.7108 Iteration 3: log restricted-likelihood = -1013.7108

Computing standard errors:

Mixed-effects REML regression Number of obs = 1370 Group variable: personid Number of groups = 200

Obs per group: min = 4 avg = 6.8 max = 7



Wald chi2(0) = . Log restricted-likelihood = -1013.7108 Prob > chi2 = .

------------------------------------------------------------------------------ posmood | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _cons | 3.735589 .0455582 82.00 0.000 3.646297 3.824882 ------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ personid: Identity | var(_cons) | .3875076 .0417653 .3137171 .4786546 -----------------------------+------------------------------------------------ Residual: AR(1) | rho | .049051 .0370822 -.0237603 .1213446 var(e) | .1729692 .0075578 .1587726 .1884351 ------------------------------------------------------------------------------ LR test vs. linear regression: chi2(2) = 1046.03 Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

. estat ic, n(200),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 200 . -1013.711 4 2035.422 2048.615 ----------------------------------------------------------------------------- Note: N=200 used in calculating BIC

. estat recovariance, relevel(personid),

Random-effects covariance matrix for level personid

| _cons -------------+----------- _cons | .3875076

. estat recovariance, relevel(personid) correlation,

Random-effects correlation matrix for level personid

| _cons -------------+----------- _cons | 1

. estat wcorrelation, covariance,

Covariances for personid = 1:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- 1 | 0.560 2 | 0.396 0.560 3 | 0.388 0.396 0.560 4 | 0.388 0.388 0.396 0.560 5 | 0.388 0.388 0.388 0.396 0.560 6 | 0.388 0.388 0.388 0.388 0.396 0.560 7 | 0.388 0.388 0.388 0.388 0.388 0.396 0.560

. estat wcorrelation,

Standard deviations and correlations for personid = 1:

Standard deviations:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- sd | 0.749 0.749 0.749 0.749 0.749 0.749 0.749

Correlations:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- 1 | 1.000 2 | 0.707 1.000 3 | 0.692 0.707 1.000 4 | 0.691 0.692 0.707 1.000 5 | 0.691 0.691 0.692 0.707 1.000 6 | 0.691 0.691 0.691 0.692 0.707 1.000 7 | 0.691 0.691 0.691 0.691 0.692 0.707 1.000

. estimates store RIAR1,

. lrtest UN RIAR1, force

Likelihood-ratio test LR chi2(25) = 44.31 (Assumption: RIAR1 nested in UN) Prob > chi2 = 0.0100

. lrtest RIAR1 AR1, force

Likelihood-ratio test LR chi2(1) = 252.37 (Assumption: AR1 nested in RIAR1) Prob > chi2 = 0.0000

. lrtest RIAR1 RIDIAG, force

Likelihood-ratio test LR chi2(1) = 1.78 (Assumption: RIDIAG nested in RIAR1) Prob > chi2 = 0.1822

. . display as result "Ch 4: Empty Means, Random Intercept in G" Ch 4: Empty Means, Random Intercept in G

. display as result "1-Lag Toeplitz R" 1-Lag Toeplitz R

. mixed posmood , /// > || personid: , variance reml covariance(unstructured) /// > residuals(toeplitz1,t(studyday)), Note: single-variable random-effects specification in personid equation; covariance structure set to identity Note: time gaps exist in the estimation data

Obtaining starting values by EM:

Performing gradient-based optimization:

Iteration 0: log restricted-likelihood = -1014.6006 Iteration 1: log restricted-likelihood = -1013.8696 Iteration 2: log restricted-likelihood = -1013.8687 Iteration 3: log restricted-likelihood = -1013.8687

Computing standard errors:

Mixed-effects REML regression Number of obs = 1370 Group variable: personid Number of groups = 200

Obs per group: min = 4 avg = 6.8 max = 7



Wald chi2(0) = . Log restricted-likelihood = -1013.8687 Prob > chi2 = .

------------------------------------------------------------------------------ posmood | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _cons | 3.73559 .0455582 82.00 0.000 3.646298 3.824883 ------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ personid: Identity | var(_cons) | .3880861 .0417458 .3143155 .4791709 -----------------------------+------------------------------------------------ Residual: Toeplitz(1) | cov1 | .0068289 .0056637 -.0042717 .0179294 var(e) | .1723496 .0073825 .1584709 .1874438 ------------------------------------------------------------------------------ LR test vs. linear regression: chi2(2) = 1045.72 Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

. estat ic, n(200),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 200 . -1013.869 4 2035.737 2048.931 ----------------------------------------------------------------------------- Note: N=200 used in calculating BIC

. estat recovariance, relevel(personid),

Random-effects covariance matrix for level personid

| _cons -------------+----------- _cons | .3880861

. estat recovariance, relevel(personid) correlation,

Random-effects correlation matrix for level personid

| _cons -------------+----------- _cons | 1

. estat wcorrelation, covariance,

Covariances for personid = 1:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- 1 | 0.560 2 | 0.395 0.560 3 | 0.388 0.395 0.560 4 | 0.388 0.388 0.395 0.560 5 | 0.388 0.388 0.388 0.395 0.560 6 | 0.388 0.388 0.388 0.388 0.395 0.560 7 | 0.388 0.388 0.388 0.388 0.388 0.395 0.560

. estat wcorrelation,

Standard deviations and correlations for personid = 1:

Standard deviations:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- sd | 0.749 0.749 0.749 0.749 0.749 0.749 0.749

Correlations:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- 1 | 1.000 2 | 0.705 1.000 3 | 0.692 0.705 1.000 4 | 0.692 0.692 0.705 1.000 5 | 0.692 0.692 0.692 0.705 1.000 6 | 0.692 0.692 0.692 0.692 0.705 1.000 7 | 0.692 0.692 0.692 0.692 0.692 0.705 1.000

. estimates store RITOEP2,

. lrtest UN RITOEP2, force

Likelihood-ratio test LR chi2(25) = 44.63 (Assumption: RITOEP2 nested in UN) Prob > chi2 = 0.0092

. lrtest RITOEP2 RIDIAG, force

Likelihood-ratio test LR chi2(1) = 1.46 (Assumption: RIDIAG nested in RITOEP2) Prob > chi2 = 0.2263

. . display as result "Ch 4: Empty Means, Random Intercept in G" Ch 4: Empty Means, Random Intercept in G

. display as result "2-Lag Toeplitz R" 2-Lag Toeplitz R

. mixed posmood , /// > || personid: , variance reml covariance(unstructured) /// > residuals(toeplitz2,t(studyday)), Note: single-variable random-effects specification in personid equation; covariance structure set to identity Note: time gaps exist in the estimation data

Obtaining starting values by EM:

Performing gradient-based optimization:

Iteration 0: log restricted-likelihood = -1014.6006 Iteration 1: log restricted-likelihood = -1008.6157 Iteration 2: log restricted-likelihood = -1008.3885 Iteration 3: log restricted-likelihood = -1008.3883 Iteration 4: log restricted-likelihood = -1008.3883

Computing standard errors:

Mixed-effects REML regression Number of obs = 1370 Group variable: personid Number of groups = 200

Obs per group: min = 4 avg = 6.8 max = 7



Wald chi2(0) = . Log restricted-likelihood = -1008.3883 Prob > chi2 = .

------------------------------------------------------------------------------ posmood | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _cons | 3.736045 .0455345 82.05 0.000 3.646799 3.825291 ------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ personid: Identity | var(_cons) | .3796504 .0418025 .3059567 .4710942 -----------------------------+------------------------------------------------ Residual: Toeplitz(2) | cov1 | .0165299 .0074017 .0020227 .031037 cov2 | .0228999 .0069343 .0093089 .0364909 var(e) | .1805455 .0085265 .164584 .1980551 ------------------------------------------------------------------------------ LR test vs. linear regression: chi2(3) = 1056.68 Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

. estat ic, n(200),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 200 . -1008.388 5 2026.777 2043.268 ----------------------------------------------------------------------------- Note: N=200 used in calculating BIC

. estat recovariance, relevel(personid),

Random-effects covariance matrix for level personid

| _cons -------------+----------- _cons | .3796504

. estat recovariance, relevel(personid) correlation,

Random-effects correlation matrix for level personid

| _cons -------------+----------- _cons | 1

. estat wcorrelation, covariance,

Covariances for personid = 1:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- 1 | 0.560 2 | 0.396 0.560 3 | 0.403 0.396 0.560 4 | 0.380 0.403 0.396 0.560 5 | 0.380 0.380 0.403 0.396 0.560 6 | 0.380 0.380 0.380 0.403 0.396 0.560 7 | 0.380 0.380 0.380 0.380 0.403 0.396 0.560

. estat wcorrelation,

Standard deviations and correlations for personid = 1:

Standard deviations:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- sd | 0.748 0.748 0.748 0.748 0.748 0.748 0.748

Correlations:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- 1 | 1.000 2 | 0.707 1.000 3 | 0.719 0.707 1.000 4 | 0.678 0.719 0.707 1.000 5 | 0.678 0.678 0.719 0.707 1.000 6 | 0.678 0.678 0.678 0.719 0.707 1.000 7 | 0.678 0.678 0.678 0.678 0.719 0.707 1.000

. estimates store RITOEP3,

. lrtest UN RITOEP3, force

Likelihood-ratio test LR chi2(24) = 33.67 (Assumption: RITOEP3 nested in UN) Prob > chi2 = 0.0907

. lrtest RITOEP3 RITOEP2, force

Likelihood-ratio test LR chi2(1) = 10.96 (Assumption: RITOEP2 nested in RITOEP3) Prob > chi2 = 0.0009

. . display as result "Ch 4: Empty Means, Random Intercept in G" Ch 4: Empty Means, Random Intercept in G

. display as result "3-Lag Toeplitz R" 3-Lag Toeplitz R

. mixed posmood , /// > || personid: , variance reml covariance(unstructured) /// > residuals(toeplitz3,t(studyday)), Note: single-variable random-effects specification in personid equation; covariance structure set to identity Note: time gaps exist in the estimation data

Obtaining starting values by EM:

Performing gradient-based optimization:

Iteration 0: log restricted-likelihood = -1014.6006 Iteration 1: log restricted-likelihood = -1008.3161 Iteration 2: log restricted-likelihood = -1007.9107 Iteration 3: log restricted-likelihood = -1007.9089 Iteration 4: log restricted-likelihood = -1007.9089

Computing standard errors:

Mixed-effects REML regression Number of obs = 1370 Group variable: personid Number of groups = 200

Obs per group: min = 4 avg = 6.8 max = 7



Wald chi2(0) = . Log restricted-likelihood = -1007.9089 Prob > chi2 = .

------------------------------------------------------------------------------ posmood | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _cons | 3.736328 .0455149 82.09 0.000 3.647121 3.825536 ------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ personid: Identity | var(_cons) | .3756339 .0419819 .3017395 .4676247 -----------------------------+------------------------------------------------ Residual: Toeplitz(3) | cov1 | .0208167 .0088329 .0035045 .0381289 cov2 | .0270731 .0081924 .0110164 .0431299 cov3 | .0083732 .0085676 -.0084189 .0251653 var(e) | .1843458 .0096796 .1663178 .2043281 ------------------------------------------------------------------------------ LR test vs. linear regression: chi2(4) = 1057.64 Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

. estat ic, n(200),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 200 . -1007.909 6 2027.818 2047.608 ----------------------------------------------------------------------------- Note: N=200 used in calculating BIC

. estat recovariance, relevel(personid),

Random-effects covariance matrix for level personid

| _cons -------------+----------- _cons | .3756339

. estat recovariance, relevel(personid) correlation,

Random-effects correlation matrix for level personid

| _cons -------------+----------- _cons | 1

. estat wcorrelation, covariance,

Covariances for personid = 1:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- 1 | 0.560 2 | 0.396 0.560 3 | 0.403 0.396 0.560 4 | 0.384 0.403 0.396 0.560 5 | 0.376 0.384 0.403 0.396 0.560 6 | 0.376 0.376 0.384 0.403 0.396 0.560 7 | 0.376 0.376 0.376 0.384 0.403 0.396 0.560

. estat wcorrelation,

Standard deviations and correlations for personid = 1:

Standard deviations:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- sd | 0.748 0.748 0.748 0.748 0.748 0.748 0.748

Correlations:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- 1 | 1.000 2 | 0.708 1.000 3 | 0.719 0.708 1.000 4 | 0.686 0.719 0.708 1.000 5 | 0.671 0.686 0.719 0.708 1.000 6 | 0.671 0.671 0.686 0.719 0.708 1.000 7 | 0.671 0.671 0.671 0.686 0.719 0.708 1.000

. estimates store RITOEP4,

. lrtest UN RITOEP4, force

Likelihood-ratio test LR chi2(23) = 32.71 (Assumption: RITOEP4 nested in UN) Prob > chi2 = 0.0862

. lrtest RITOEP4 RITOEP3, force

Likelihood-ratio test LR chi2(1) = 0.96 (Assumption: RITOEP3 nested in RITOEP4) Prob > chi2 = 0.3275

. . display as result "Ch 4: Empty Means, Random Intercept in G" Ch 4: Empty Means, Random Intercept in G

. display as result "4-Lag Toeplitz R" 4-Lag Toeplitz R

. mixed posmood , /// > || personid: , variance reml covariance(unstructured) /// > residuals(toeplitz4,t(studyday)), Note: single-variable random-effects specification in personid equation; covariance structure set to identity Note: time gaps exist in the estimation data

Obtaining starting values by EM:

Performing gradient-based optimization:

Iteration 0: log restricted-likelihood = -1014.6006 Iteration 1: log restricted-likelihood = -1006.5191 Iteration 2: log restricted-likelihood = -1006.0853 Iteration 3: log restricted-likelihood = -1006.083 Iteration 4: log restricted-likelihood = -1006.083

Computing standard errors:

Mixed-effects REML regression Number of obs = 1370 Group variable: personid Number of groups = 200

Obs per group: min = 4 avg = 6.8 max = 7



Wald chi2(0) = . Log restricted-likelihood = -1006.083 Prob > chi2 = .

------------------------------------------------------------------------------ posmood | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _cons | 3.73621 .0455064 82.10 0.000 3.647019 3.825401 ------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ personid: Identity | var(_cons) | .3645197 .0424291 .2901639 .4579295 -----------------------------+------------------------------------------------ Residual: Toeplitz(4) | cov1 | .0324198 .0114522 .0099738 .0548658 cov2 | .0408367 .0115906 .0181196 .0635539 cov3 | .0193606 .0105275 -.0012728 .0399941 cov4 | .0189988 .0100417 -.0006825 .0386801 var(e) | .1958136 .0123129 .1731085 .2214966 ------------------------------------------------------------------------------ LR test vs. linear regression: chi2(5) = 1061.29 Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

. estat ic, n(200),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 200 . -1006.083 7 2026.166 2049.254 ----------------------------------------------------------------------------- Note: N=200 used in calculating BIC

. estat recovariance, relevel(personid),

Random-effects covariance matrix for level personid

| _cons -------------+----------- _cons | .3645197

. estat recovariance, relevel(personid) correlation,

Random-effects correlation matrix for level personid

| _cons -------------+----------- _cons | 1

. estat wcorrelation, covariance,

Covariances for personid = 1:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- 1 | 0.560 2 | 0.397 0.560 3 | 0.405 0.397 0.560 4 | 0.384 0.405 0.397 0.560 5 | 0.384 0.384 0.405 0.397 0.560 6 | 0.365 0.384 0.384 0.405 0.397 0.560 7 | 0.365 0.365 0.384 0.384 0.405 0.397 0.560

. estat wcorrelation,

Standard deviations and correlations for personid = 1:

Standard deviations:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- sd | 0.749 0.749 0.749 0.749 0.749 0.749 0.749

Correlations:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- 1 | 1.000 2 | 0.708 1.000 3 | 0.723 0.708 1.000 4 | 0.685 0.723 0.708 1.000 5 | 0.684 0.685 0.723 0.708 1.000 6 | 0.651 0.684 0.685 0.723 0.708 1.000 7 | 0.651 0.651 0.684 0.685 0.723 0.708 1.000

. estimates store RITOEP5,

. lrtest UN RITOEP5, force

Likelihood-ratio test LR chi2(22) = 29.06 (Assumption: RITOEP5 nested in UN) Prob > chi2 = 0.1432

. lrtest RITOEP5 RITOEP4, force

Likelihood-ratio test LR chi2(1) = 3.65 (Assumption: RITOEP4 nested in RITOEP5) Prob > chi2 = 0.0560

. . display as result "Ch 4: Empty Means, Random Intercept in G" Ch 4: Empty Means, Random Intercept in G

. display as result "5-Lag Toeplitz R" 5-Lag Toeplitz R

. mixed posmood , /// > || personid: , variance reml covariance(unstructured) /// > residuals(toeplitz5,t(studyday)), Note: single-variable random-effects specification in personid equation; covariance structure set to identity Note: time gaps exist in the estimation data

Obtaining starting values by EM:

Performing gradient-based optimization:

Iteration 0: log restricted-likelihood = -1014.6006 Iteration 1: log restricted-likelihood = -1014.4112 Iteration 2: log restricted-likelihood = -1005.6461 Iteration 3: log restricted-likelihood = -1004.9563 Iteration 4: log restricted-likelihood = -1004.9531 Iteration 5: log restricted-likelihood = -1004.9531

Computing standard errors:

Mixed-effects REML regression Number of obs = 1370 Group variable: personid Number of groups = 200

Obs per group: min = 4 avg = 6.8 max = 7



Wald chi2(0) = . Log restricted-likelihood = -1004.9531 Prob > chi2 = .

------------------------------------------------------------------------------ posmood | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _cons | 3.735746 .045517 82.07 0.000 3.646534 3.824958 ------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ personid: Identity | var(_cons) | .3477049 .0439777 .2713631 .4455236 -----------------------------+------------------------------------------------ Residual: Toeplitz(5) | cov1 | .0508638 .0173193 .0169187 .084809 cov2 | .0585459 .0170787 .0250722 .0920196 cov3 | .0373702 .0162133 .0055926 .0691477 cov4 | .0345954 .014628 .005925 .0632659 cov5 | .0232054 .0154535 -.007083 .0534938 var(e) | .2132062 .0178604 .1809232 .2512496 ------------------------------------------------------------------------------ LR test vs. linear regression: chi2(6) = 1063.55 Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

. estat ic, n(200),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 200 . -1004.953 8 2025.906 2052.293 ----------------------------------------------------------------------------- Note: N=200 used in calculating BIC

. estat recovariance, relevel(personid),

Random-effects covariance matrix for level personid

| _cons -------------+----------- _cons | .3477049

. estat recovariance, relevel(personid) correlation,

Random-effects correlation matrix for level personid

| _cons -------------+----------- _cons | 1

. estat wcorrelation, covariance,

Covariances for personid = 1:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- 1 | 0.561 2 | 0.399 0.561 3 | 0.406 0.399 0.561 4 | 0.385 0.406 0.399 0.561 5 | 0.382 0.385 0.406 0.399 0.561 6 | 0.371 0.382 0.385 0.406 0.399 0.561 7 | 0.348 0.371 0.382 0.385 0.406 0.399 0.561

. estat wcorrelation,

Standard deviations and correlations for personid = 1:

Standard deviations:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- sd | 0.749 0.749 0.749 0.749 0.749 0.749 0.749

Correlations:

studyday | 1 2 3 4 5 6 7 -------------+-------------------------------------------------------- 1 | 1.000 2 | 0.711 1.000 3 | 0.724 0.711 1.000 4 | 0.687 0.724 0.711 1.000 5 | 0.682 0.687 0.724 0.711 1.000 6 | 0.661 0.682 0.687 0.724 0.711 1.000 7 | 0.620 0.661 0.682 0.687 0.724 0.711 1.000

. estimates store RITOEP6,

. lrtest UN RITOEP6, force

Likelihood-ratio test LR chi2(21) = 26.80 (Assumption: RITOEP6 nested in UN) Prob > chi2 = 0.1776

. lrtest RITOEP6 RITOEP5, force

Likelihood-ratio test LR chi2(1) = 2.26 (Assumption: RITOEP5 nested in RITOEP6) Prob > chi2 = 0.1328

. . ****** END CHAPTER 4 MODELS ****** . . * Close log . log close STATA_Chapter4 name: STATA_Chapter4 log: C:\Dropbox\PilesOfVariance\Chapter4\STATA\STATA_Chapter4_Output.smcl log type: smcl closed on: 21 Oct 2014, 09:25:39 ------------------------------------------------------------------------------------------------------------------------------------------------------