-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
name: STATA_Chapter7b
log: C:\Dropbox\PilesOfVariance\Chapter7b\STATA\STATA_Chapter7b_Output.smcl
log type: smcl
opened on: 12 Jan 2015, 13:00:49
.
. display as result "Chapter 7b: Descriptive Statistics for Time-Invariant Variables"
Chapter 7b: Descriptive Statistics for Time-Invariant Variables
. preserve
. collapse attitude12, by(personid)
. summarize attitude12
Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
attitude12 | 200 3.9505 .6024956 2.437367 5
. restore
.
. display as result "Chapter 7b: Descriptive Statistics for Time-Varying Variables"
Chapter 7b: Descriptive Statistics for Time-Varying Variables
. summarize age risky
Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
age | 1400 15.00103 2.004174 11.53088 18.33688
risky | 1400 19.38489 5.301359 10 36.28243
.
. display as result "Ch 7b: Empty Means, Random Intercept Model"
Ch 7b: Empty Means, Random Intercept Model
. mixed risky , ///
> || personid: , variance mle covariance(unstructured),
Note: single-variable random-effects specification in personid equation; covariance structure set to identity
Performing EM optimization:
Performing gradient-based optimization:
Iteration 0: log likelihood = -4148.3084
Iteration 1: log likelihood = -4148.3084
Computing standard errors:
Mixed-effects ML regression Number of obs = 1400
Group variable: personid Number of groups = 200
Obs per group: min = 7
avg = 7.0
max = 7
Wald chi2(0) = .
Log likelihood = -4148.3084 Prob > chi2 = .
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
_cons | 19.38489 .2579357 75.15 0.000 18.87934 19.89043
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
personid: Identity |
var(_cons) | 10.84314 1.33441 8.519258 13.80092
-----------------------------+------------------------------------------------
var(Residual) | 17.24119 .7038687 15.91538 18.67744
------------------------------------------------------------------------------
LR test vs. linear regression: chibar2(01) = 345.71 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 . -4148.308 3 8302.617 8312.512
-----------------------------------------------------------------------------
Note: N=200 used in calculating BIC
. estat icc,
Intraclass correlation
------------------------------------------------------------------------------
Level | ICC Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
personid | .3860921 .0314171 .3266101 .4491809
------------------------------------------------------------------------------
. estat wcorrelation, covariance,
Covariances for personid = 1:
obs | 1 2 3 4 5 6 7
-------------+--------------------------------------------------------
1 | 28.084
2 | 10.843 28.084
3 | 10.843 10.843 28.084
4 | 10.843 10.843 10.843 28.084
5 | 10.843 10.843 10.843 10.843 28.084
6 | 10.843 10.843 10.843 10.843 10.843 28.084
7 | 10.843 10.843 10.843 10.843 10.843 10.843 28.084
. estat wcorrelation,
Standard deviations and correlations for personid = 1:
Standard deviations:
obs | 1 2 3 4 5 6 7
-------------+--------------------------------------------------------
sd | 5.299 5.299 5.299 5.299 5.299 5.299 5.299
Correlations:
obs | 1 2 3 4 5 6 7
-------------+--------------------------------------------------------
1 | 1.000
2 | 0.386 1.000
3 | 0.386 0.386 1.000
4 | 0.386 0.386 0.386 1.000
5 | 0.386 0.386 0.386 0.386 1.000
6 | 0.386 0.386 0.386 0.386 0.386 1.000
7 | 0.386 0.386 0.386 0.386 0.386 0.386 1.000
.
. display as result "Ch 7b: Saturated Means by Rounded Occasion, Unstructured Variance Model"
Ch 7b: Saturated Means by Rounded Occasion, Unstructured Variance Model
. mixed risky i.occasion, ///
> || personid: , noconstant variance mle covariance(unstructured) ///
> residuals(unstructured,t(occasion)),
Obtaining starting values by EM:
Performing gradient-based optimization:
Iteration 0: log likelihood = -4176.0318 (not concave)
Iteration 1: log likelihood = -3918.1257
Iteration 2: log likelihood = -3906.2356
Iteration 3: log likelihood = -3874.8458
Iteration 4: log likelihood = -3814.3034
Iteration 5: log likelihood = -3803.8029
Iteration 6: log likelihood = -3803.4167
Iteration 7: log likelihood = -3803.4161
Iteration 8: log likelihood = -3803.4161
Computing standard errors:
Mixed-effects ML regression Number of obs = 1400
Group variable: personid Number of groups = 200
Obs per group: min = 7
avg = 7.0
max = 7
Wald chi2(6) = 332.83
Log likelihood = -3803.4161 Prob > chi2 = 0.0000
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
occasion |
13 | .460436 .2936244 1.57 0.117 -.1150572 1.035929
14 | 1.14023 .3141481 3.63 0.000 .5245108 1.755949
15 | 2.259514 .3466776 6.52 0.000 1.580038 2.93899
16 | 3.050547 .349417 8.73 0.000 2.365702 3.735391
17 | 4.928356 .412543 11.95 0.000 4.119786 5.736925
18 | 6.79877 .4383803 15.51 0.000 5.939561 7.65798
|
_cons | 16.72233 .3232007 51.74 0.000 16.08887 17.3558
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
personid: (empty) |
-----------------------------+------------------------------------------------
Residual: Unstructured |
var(e12) | 20.89174 2.089143 17.17338 25.4152
var(e13) | 19.55816 1.955743 16.07722 23.79277
var(e14) | 20.24642 2.024559 16.643 24.63002
var(e15) | 20.81014 2.080916 17.10641 25.31577
var(e16) | 21.91284 2.191161 18.01289 26.65717
var(e17) | 27.11191 2.711088 22.28657 32.98201
var(e18) | 29.24785 2.924715 24.04229 35.5805
cov(e12,e13) | 11.60342 1.648012 8.373376 14.83347
cov(e12,e14) | 10.70018 1.639223 7.487357 13.91299
cov(e12,e15) | 8.832404 1.601073 5.694359 11.97045
cov(e12,e16) | 9.19307 1.646541 5.96591 12.42023
cov(e12,e17) | 6.982658 1.753647 3.545573 10.41974
cov(e12,e18) | 5.852066 1.796071 2.331832 9.372299
cov(e13,e14) | 11.1286 1.612069 7.969008 14.2882
cov(e13,e15) | 9.391388 1.573388 6.307604 12.47517
cov(e13,e16) | 11.58832 1.677447 8.300581 14.87605
cov(e13,e17) | 10.53509 1.790433 7.025909 14.04428
cov(e13,e18) | 9.971358 1.832146 6.380418 13.5623
cov(e14,e15) | 12.58294 1.702309 9.246473 15.9194
cov(e14,e16) | 12.95652 1.748467 9.529586 16.38345
cov(e14,e17) | 11.778 1.854078 8.144069 15.41192
cov(e14,e18) | 9.222996 1.839987 5.616688 12.8293
cov(e15,e16) | 14.01168 1.805866 10.47225 17.55111
cov(e15,e17) | 15.0484 1.988146 11.1517 18.94509
cov(e15,e18) | 14.38487 2.01925 10.42722 18.34253
cov(e16,e17) | 16.00679 2.061775 11.96578 20.04779
cov(e16,e18) | 15.25379 2.089811 11.15783 19.34974
cov(e17,e18) | 19.08655 2.405362 14.37212 23.80097
------------------------------------------------------------------------------
LR test vs. linear regression: chi2(27) = 745.23 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 . -3803.416 35 7676.832 7792.273
-----------------------------------------------------------------------------
Note: N=200 used in calculating BIC
. estat wcorrelation, covariance,
Covariances for personid = 1:
occasion | 12 13 14 15 16 17 18
-------------+--------------------------------------------------------
12 | 20.892
13 | 11.603 19.558
14 | 10.700 11.129 20.246
15 | 8.832 9.391 12.583 20.810
16 | 9.193 11.588 12.957 14.012 21.913
17 | 6.983 10.535 11.778 15.048 16.007 27.112
18 | 5.852 9.971 9.223 14.385 15.254 19.087 29.248
. estat wcorrelation,
Standard deviations and correlations for personid = 1:
Standard deviations:
occasion | 12 13 14 15 16 17 18
-------------+--------------------------------------------------------
sd | 4.571 4.422 4.500 4.562 4.681 5.207 5.408
Correlations:
occasion | 12 13 14 15 16 17 18
-------------+--------------------------------------------------------
12 | 1.000
13 | 0.574 1.000
14 | 0.520 0.559 1.000
15 | 0.424 0.466 0.613 1.000
16 | 0.430 0.560 0.615 0.656 1.000
17 | 0.293 0.458 0.503 0.634 0.657 1.000
18 | 0.237 0.417 0.379 0.583 0.603 0.678 1.000
. contrast i.occasion,
Contrasts of marginal linear predictions
Margins : asbalanced
------------------------------------------------
| df chi2 P>chi2
-------------+----------------------------------
risky |
occasion | 6 332.83 0.0000
------------------------------------------------
. margins i.occasion,
Adjusted predictions Number of obs = 1400
Expression : Linear prediction, fixed portion, predict()
------------------------------------------------------------------------------
| Delta-method
| Margin Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
occasion |
12 | 16.72233 .3232007 51.74 0.000 16.08887 17.3558
13 | 17.18277 .3127152 54.95 0.000 16.56986 17.79568
14 | 17.86256 .3181699 56.14 0.000 17.23896 18.48617
15 | 18.98185 .3225689 58.85 0.000 18.34963 19.61407
16 | 19.77288 .3310049 59.74 0.000 19.12412 20.42164
17 | 21.65069 .3681841 58.80 0.000 20.92906 22.37232
18 | 23.52111 .3824124 61.51 0.000 22.77159 24.27062
------------------------------------------------------------------------------
. margins i.occasion, pwcompare(pveffects)
Pairwise comparisons of adjusted predictions
Expression : Linear prediction, fixed portion, predict()
-----------------------------------------------------
| Delta-method Unadjusted
| Contrast Std. Err. z P>|z|
-------------+---------------------------------------
occasion |
13 vs 12 | .460436 .2936244 1.57 0.117
14 vs 12 | 1.14023 .3141481 3.63 0.000
15 vs 12 | 2.259514 .3466776 6.52 0.000
16 vs 12 | 3.050547 .349417 8.73 0.000
17 vs 12 | 4.928356 .412543 11.95 0.000
18 vs 12 | 6.79877 .4383803 15.51 0.000
14 vs 13 | .6797938 .296204 2.30 0.022
15 vs 13 | 1.799078 .3285234 5.48 0.000
16 vs 13 | 2.590111 .3024431 8.56 0.000
17 vs 13 | 4.46792 .35777 12.49 0.000
18 vs 13 | 6.338334 .3798901 16.68 0.000
15 vs 14 | 1.119284 .2818748 3.97 0.000
16 vs 14 | 1.910317 .2850107 6.70 0.000
17 vs 14 | 3.788126 .3449807 10.98 0.000
18 vs 14 | 5.658541 .3940068 14.36 0.000
16 vs 15 | .7910326 .2711054 2.92 0.004
17 vs 15 | 2.668842 .2985402 8.94 0.000
18 vs 15 | 4.539256 .3262533 13.91 0.000
17 vs 16 | 1.877809 .2916434 6.44 0.000
18 vs 16 | 3.748224 .3213497 11.66 0.000
18 vs 17 | 1.870415 .3015516 6.20 0.000
-----------------------------------------------------
.
. display as result "Ch 7b: Fixed Linear Age, Random Intercept Model"
Ch 7b: Fixed Linear Age, Random Intercept Model
. mixed risky c.agec18, ///
> || personid: , variance mle covariance(unstructured),
Note: single-variable random-effects specification in personid equation; covariance structure set to identity
Performing EM optimization:
Performing gradient-based optimization:
Iteration 0: log likelihood = -3898.9869
Iteration 1: log likelihood = -3898.9869
Computing standard errors:
Mixed-effects ML regression Number of obs = 1400
Group variable: personid Number of groups = 200
Obs per group: min = 7
avg = 7.0
max = 7
Wald chi2(1) = 618.06
Log likelihood = -3898.9869 Prob > chi2 = 0.0000
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
agec18 | 1.119448 .0450287 24.86 0.000 1.031193 1.207702
_cons | 22.74207 .2909689 78.16 0.000 22.17178 23.31236
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
personid: Identity |
var(_cons) | 11.65946 1.330203 9.323239 14.5811
-----------------------------+------------------------------------------------
var(Residual) | 11.38191 .4646644 10.50667 12.33006
------------------------------------------------------------------------------
LR test vs. linear regression: chibar2(01) = 567.26 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 . -3898.987 4 7805.974 7819.167
-----------------------------------------------------------------------------
Note: N=200 used in calculating BIC
. * Intercept at Age=12
. lincom _cons*1 + c.agec18*-6
( 1) - 6*[risky]agec18 + [risky]_cons = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 16.02539 .2910121 55.07 0.000 15.45501 16.59576
------------------------------------------------------------------------------
. * Intercept at Age=13
. lincom _cons*1 + c.agec18*-5
( 1) - 5*[risky]agec18 + [risky]_cons = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 17.14483 .273031 62.79 0.000 16.6097 17.67997
------------------------------------------------------------------------------
. * Intercept at Age=14
. lincom _cons*1 + c.agec18*-4
( 1) - 4*[risky]agec18 + [risky]_cons = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 18.26428 .2616467 69.81 0.000 17.75146 18.7771
------------------------------------------------------------------------------
. * Intercept at Age=15
. lincom _cons*1 + c.agec18*-3
( 1) - 3*[risky]agec18 + [risky]_cons = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 19.38373 .2577349 75.21 0.000 18.87858 19.88888
------------------------------------------------------------------------------
. * Intercept at Age=16
. lincom _cons*1 + c.agec18*-2
( 1) - 2*[risky]agec18 + [risky]_cons = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 20.50318 .2616308 78.37 0.000 19.99039 21.01596
------------------------------------------------------------------------------
. * Intercept at Age=17
. lincom _cons*1 + c.agec18*-1
( 1) - [risky]agec18 + [risky]_cons = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 21.62263 .2730004 79.20 0.000 21.08755 22.1577
------------------------------------------------------------------------------
. * Intercept at Age=18
. lincom _cons*1 + c.agec18*0
( 1) [risky]_cons = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 22.74207 .2909689 78.16 0.000 22.17178 23.31236
------------------------------------------------------------------------------
. estimates store FitFixLin,
.
. display as result "Ch 7b: Random Linear Age Model"
Ch 7b: Random Linear Age Model
. mixed risky c.agec18, ///
> || personid: agec18, variance mle covariance(unstructured),
Performing EM optimization:
Performing gradient-based optimization:
Iteration 0: log likelihood = -3838.5944
Iteration 1: log likelihood = -3838.5944
Computing standard errors:
Mixed-effects ML regression Number of obs = 1400
Group variable: personid Number of groups = 200
Obs per group: min = 7
avg = 7.0
max = 7
Wald chi2(1) = 284.54
Log likelihood = -3838.5944 Prob > chi2 = 0.0000
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
agec18 | 1.119888 .0663902 16.87 0.000 .989766 1.250011
_cons | 22.74345 .3575144 63.62 0.000 22.04273 23.44416
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
personid: Unstructured |
var(agec18) | .5701053 .0892254 .4195041 .7747721
var(_cons) | 21.51569 2.56372 17.03451 27.17571
cov(agec18,_cons) | 2.433403 .4140209 1.621937 3.244869
-----------------------------+------------------------------------------------
var(Residual) | 8.717562 .3898242 7.986046 9.516085
------------------------------------------------------------------------------
LR test vs. linear regression: chi2(3) = 688.05 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 . -3838.594 6 7689.189 7708.979
-----------------------------------------------------------------------------
Note: N=200 used in calculating BIC
. * Intercept at Age=12
. lincom _cons*1 + c.agec18*-6
( 1) - 6*[risky]agec18 + [risky]_cons = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 16.02412 .2905967 55.14 0.000 15.45456 16.59368
------------------------------------------------------------------------------
. * Intercept at Age=13
. lincom _cons*1 + c.agec18*-5
( 1) - 5*[risky]agec18 + [risky]_cons = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 17.144 .2638873 64.97 0.000 16.6268 17.66121
------------------------------------------------------------------------------
. * Intercept at Age=14
. lincom _cons*1 + c.agec18*-4
( 1) - 4*[risky]agec18 + [risky]_cons = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 18.26389 .2522735 72.40 0.000 17.76945 18.75834
------------------------------------------------------------------------------
. * Intercept at Age=15
. lincom _cons*1 + c.agec18*-3
( 1) - 3*[risky]agec18 + [risky]_cons = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 19.38378 .2578034 75.19 0.000 18.8785 19.88907
------------------------------------------------------------------------------
. * Intercept at Age=16
. lincom _cons*1 + c.agec18*-2
( 1) - 2*[risky]agec18 + [risky]_cons = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 20.50367 .2794613 73.37 0.000 19.95594 21.0514
------------------------------------------------------------------------------
. * Intercept at Age=17
. lincom _cons*1 + c.agec18*-1
( 1) - [risky]agec18 + [risky]_cons = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 21.62356 .3139266 68.88 0.000 21.00827 22.23884
------------------------------------------------------------------------------
. * Intercept at Age=18
. lincom _cons*1 + c.agec18*0
( 1) [risky]_cons = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 22.74345 .3575144 63.62 0.000 22.04273 23.44416
------------------------------------------------------------------------------
. estimates store FitRandLin,
. lrtest FitRandLin FitFixLin,
Likelihood-ratio test LR chi2(2) = 120.79
(Assumption: FitFixLin nested in FitRandLin) 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.
.
. display as result "Eq 7b.8: Fixed Quadratic, Random Linear Age Model"
Eq 7b.8: Fixed Quadratic, Random Linear Age Model
. mixed risky c.agec18 c.agec18#c.agec18, ///
> || personid: agec18, variance mle covariance(unstructured),
Performing EM optimization:
Performing gradient-based optimization:
Iteration 0: log likelihood = -3817.3851
Iteration 1: log likelihood = -3817.3851
Computing standard errors:
Mixed-effects ML regression Number of obs = 1400
Group variable: personid Number of groups = 200
Obs per group: min = 7
avg = 7.0
max = 7
Wald chi2(2) = 327.35
Log likelihood = -3817.3851 Prob > chi2 = 0.0000
-----------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
------------------+----------------------------------------------------------------
agec18 | 1.987716 .1476083 13.47 0.000 1.698409 2.277023
|
c.agec18#c.agec18 | .1446288 .0219659 6.58 0.000 .1015763 .1876812
|
_cons | 23.4655 .3740123 62.74 0.000 22.73245 24.19855
-----------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
personid: Unstructured |
var(agec18) | .5848264 .0893151 .4335418 .788902
var(_cons) | 21.69401 2.564019 17.20822 27.34912
cov(agec18,_cons) | 2.4761 .4142988 1.664089 3.28811
-----------------------------+------------------------------------------------
var(Residual) | 8.351625 .3734745 7.65079 9.116659
------------------------------------------------------------------------------
LR test vs. linear regression: chi2(3) = 714.98 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 . -3817.385 7 7648.77 7671.858
-----------------------------------------------------------------------------
Note: N=200 used in calculating BIC
. * Intercept at Age=12
. lincom _cons*1 + c.agec18*-6 + c.agec18#c.agec18*36
( 1) - 6*[risky]agec18 + 36*[risky]c.agec18#c.agec18 + [risky]_cons = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 16.74584 .3107924 53.88 0.000 16.13669 17.35498
------------------------------------------------------------------------------
. * Intercept at Age=13
. lincom _cons*1 + c.agec18*-5 + c.agec18#c.agec18*25
( 1) - 5*[risky]agec18 + 25*[risky]c.agec18#c.agec18 + [risky]_cons = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 17.14264 .264028 64.93 0.000 16.62515 17.66012
------------------------------------------------------------------------------
. * Intercept at Age=14
. lincom _cons*1 + c.agec18*-4 + c.agec18#c.agec18*16
( 1) - 4*[risky]agec18 + 16*[risky]c.agec18#c.agec18 + [risky]_cons = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 17.82869 .2608555 68.35 0.000 17.31743 18.33996
------------------------------------------------------------------------------
. * Intercept at Age=15
. lincom _cons*1 + c.agec18*-3 + c.agec18#c.agec18*9
( 1) - 3*[risky]agec18 + 9*[risky]c.agec18#c.agec18 + [risky]_cons = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 18.80401 .2724487 69.02 0.000 18.27002 19.338
------------------------------------------------------------------------------
. * Intercept at Age=16
. lincom _cons*1 + c.agec18*-2 + c.agec18#c.agec18*4
( 1) - 2*[risky]agec18 + 4*[risky]c.agec18#c.agec18 + [risky]_cons = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 20.06858 .2871777 69.88 0.000 19.50572 20.63144
------------------------------------------------------------------------------
. * Intercept at Age=17
. lincom _cons*1 + c.agec18*-1 + c.agec18#c.agec18*1
( 1) - [risky]agec18 + [risky]c.agec18#c.agec18 + [risky]_cons = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 21.62241 .3139521 68.87 0.000 21.00707 22.23774
------------------------------------------------------------------------------
. * Intercept at Age=18
. lincom _cons*1 + c.agec18*0 + c.agec18#c.agec18*0
( 1) [risky]_cons = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 23.4655 .3740123 62.74 0.000 22.73245 24.19855
------------------------------------------------------------------------------
. * Linear Slope at Age=12
. lincom c.agec18*1 + c.agec18#c.agec18*-12
( 1) [risky]agec18 - 12*[risky]c.agec18#c.agec18 = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | .2521708 .1475939 1.71 0.088 -.037108 .5414496
------------------------------------------------------------------------------
. * Linear Slope at Age=13
. lincom c.agec18*1 + c.agec18#c.agec18*-10
( 1) [risky]agec18 - 10*[risky]c.agec18#c.agec18 = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | .5414283 .1101573 4.92 0.000 .325524 .7573327
------------------------------------------------------------------------------
. * Linear Slope at Age=14
. lincom c.agec18*1 + c.agec18#c.agec18*-8
( 1) [risky]agec18 - 8*[risky]c.agec18#c.agec18 = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | .8306859 .0796574 10.43 0.000 .6745602 .9868116
------------------------------------------------------------------------------
. * Linear Slope at Age=15
. lincom c.agec18*1 + c.agec18#c.agec18*-6
( 1) [risky]agec18 - 6*[risky]c.agec18#c.agec18 = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 1.119943 .066453 16.85 0.000 .9896979 1.250189
------------------------------------------------------------------------------
. * Linear Slope at Age=16
. lincom c.agec18*1 + c.agec18#c.agec18*-4
( 1) [risky]agec18 - 4*[risky]c.agec18#c.agec18 = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 1.409201 .0796663 17.69 0.000 1.253058 1.565344
------------------------------------------------------------------------------
. * Linear Slope at Age=17
. lincom c.agec18*1 + c.agec18#c.agec18*-2
( 1) [risky]agec18 - 2*[risky]c.agec18#c.agec18 = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 1.698459 .1101701 15.42 0.000 1.482529 1.914388
------------------------------------------------------------------------------
. * Linear Slope at Age=18
. lincom c.agec18*1 + c.agec18#c.agec18*0
( 1) [risky]agec18 = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 1.987716 .1476083 13.47 0.000 1.698409 2.277023
------------------------------------------------------------------------------
. estimates store FitFixQuad,
. predict PredAge, xb,
. corr risky PredAge
(obs=1400)
| risky PredAge
-------------+------------------
risky | 1.0000
PredAge | 0.4343 1.0000
.
. display as result "Ch 7b: Random Quadratic Age Model"
Ch 7b: Random Quadratic Age Model
. mixed risky c.agec18 c.agec18#c.agec18, ///
> || personid: agec18 agec18sq, variance mle covariance(unstructured),
Performing EM optimization:
Performing gradient-based optimization:
Iteration 0: log likelihood = -3815.4016
Iteration 1: log likelihood = -3814.762
Iteration 2: log likelihood = -3814.7529
Iteration 3: log likelihood = -3814.7529
Computing standard errors:
Mixed-effects ML regression Number of obs = 1400
Group variable: personid Number of groups = 200
Obs per group: min = 7
avg = 7.0
max = 7
Wald chi2(2) = 321.86
Log likelihood = -3814.7529 Prob > chi2 = 0.0000
-----------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
------------------+----------------------------------------------------------------
agec18 | 1.991154 .157749 12.62 0.000 1.681972 2.300337
|
c.agec18#c.agec18 | .1450952 .0238912 6.07 0.000 .0982693 .1919211
|
_cons | 23.46879 .3695079 63.51 0.000 22.74457 24.19301
-----------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
personid: Unstructured |
var(agec18) | 1.356627 .5326022 .6284703 2.928439
var(agec18sq) | .0215313 .012406 .0069602 .0666068
var(_cons) | 21.28303 2.74501 16.52908 27.40429
cov(agec18,agec18sq) | .127776 .0776233 -.0243628 .2799149
cov(agec18,_cons) | 2.476526 .9474399 .6195776 4.333474
cov(agec18sq,_cons) | -.0053573 .1309285 -.2619724 .2512578
-----------------------------+------------------------------------------------
var(Residual) | 7.977674 .3995647 7.231752 8.800533
------------------------------------------------------------------------------
LR test vs. linear regression: chi2(6) = 720.24 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 . -3814.753 10 7649.506 7682.489
-----------------------------------------------------------------------------
Note: N=200 used in calculating BIC
. * Intercept at Age=12
. lincom _cons*1 + c.agec18*-6 + c.agec18#c.agec18*36
( 1) - 6*[risky]agec18 + 36*[risky]c.agec18#c.agec18 + [risky]_cons = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 16.74529 .3061797 54.69 0.000 16.14519 17.34539
------------------------------------------------------------------------------
. * Intercept at Age=13
. lincom _cons*1 + c.agec18*-5 + c.agec18#c.agec18*25
( 1) - 5*[risky]agec18 + 25*[risky]c.agec18#c.agec18 + [risky]_cons = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 17.1404 .2642336 64.87 0.000 16.62251 17.65829
------------------------------------------------------------------------------
. * Intercept at Age=14
. lincom _cons*1 + c.agec18*-4 + c.agec18#c.agec18*16
( 1) - 4*[risky]agec18 + 16*[risky]c.agec18#c.agec18 + [risky]_cons = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 17.82569 .2685652 66.37 0.000 17.29932 18.35207
------------------------------------------------------------------------------
. * Intercept at Age=15
. lincom _cons*1 + c.agec18*-3 + c.agec18#c.agec18*9
( 1) - 3*[risky]agec18 + 9*[risky]c.agec18#c.agec18 + [risky]_cons = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 18.80118 .2829081 66.46 0.000 18.24669 19.35567
------------------------------------------------------------------------------
. * Intercept at Age=16
. lincom _cons*1 + c.agec18*-2 + c.agec18#c.agec18*4
( 1) - 2*[risky]agec18 + 4*[risky]c.agec18#c.agec18 + [risky]_cons = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 20.06686 .2943043 68.18 0.000 19.49003 20.64369
------------------------------------------------------------------------------
. * Intercept at Age=17
. lincom _cons*1 + c.agec18*-1 + c.agec18#c.agec18*1
( 1) - [risky]agec18 + [risky]c.agec18#c.agec18 + [risky]_cons = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 21.62273 .3140487 68.85 0.000 21.00721 22.23825
------------------------------------------------------------------------------
. * Intercept at Age=18
. lincom _cons*1 + c.agec18*0 + c.agec18#c.agec18*0
( 1) [risky]_cons = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 23.46879 .3695079 63.51 0.000 22.74457 24.19301
------------------------------------------------------------------------------
. * Linear Slope at Age=12
. lincom c.agec18*1 + c.agec18#c.agec18*-12
( 1) [risky]agec18 - 12*[risky]c.agec18#c.agec18 = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | .2500119 .1582816 1.58 0.114 -.0602143 .5602381
------------------------------------------------------------------------------
. * Linear Slope at Age=13
. lincom c.agec18*1 + c.agec18#c.agec18*-10
( 1) [risky]agec18 - 10*[risky]c.agec18#c.agec18 = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | .5402023 .1166586 4.63 0.000 .3115556 .7688489
------------------------------------------------------------------------------
. * Linear Slope at Age=14
. lincom c.agec18*1 + c.agec18#c.agec18*-8
( 1) [risky]agec18 - 8*[risky]c.agec18#c.agec18 = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | .8303927 .082047 10.12 0.000 .6695835 .9912019
------------------------------------------------------------------------------
. * Linear Slope at Age=15
. lincom c.agec18*1 + c.agec18#c.agec18*-6
( 1) [risky]agec18 - 6*[risky]c.agec18#c.agec18 = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 1.120583 .0664869 16.85 0.000 .9902713 1.250895
------------------------------------------------------------------------------
. * Linear Slope at Age=16
. lincom c.agec18*1 + c.agec18#c.agec18*-4
( 1) [risky]agec18 - 4*[risky]c.agec18#c.agec18 = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 1.410774 .0817044 17.27 0.000 1.250636 1.570911
------------------------------------------------------------------------------
. * Linear Slope at Age=17
. lincom c.agec18*1 + c.agec18#c.agec18*-2
( 1) [risky]agec18 - 2*[risky]c.agec18#c.agec18 = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 1.700964 .1161767 14.64 0.000 1.473262 1.928666
------------------------------------------------------------------------------
. * Linear Slope at Age=18
. lincom c.agec18*1 + c.agec18#c.agec18*0
( 1) [risky]agec18 = 0
------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 1.991154 .157749 12.62 0.000 1.681972 2.300337
------------------------------------------------------------------------------
. estimates store FitRandQuad,
. lrtest FitRandQuad FitFixQuad,
Likelihood-ratio test LR chi2(3) = 5.26
(Assumption: FitFixQuad nested in FitRandQuad) Prob > chi2 = 0.1534
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.
.
. display as result "Ch 7b: Fixed Cubic, Random Linear Age Model"
Ch 7b: Fixed Cubic, Random Linear Age Model
. mixed risky c.agec18 c.agec18#c.agec18 c.agec18#c.agec18#c.agec18, ///
> || personid: agec18, variance mle covariance(unstructured),
Performing EM optimization:
Performing gradient-based optimization:
Iteration 0: log likelihood = -3817.0925
Iteration 1: log likelihood = -3817.0925
Computing standard errors:
Mixed-effects ML regression Number of obs = 1400
Group variable: personid Number of groups = 200
Obs per group: min = 7
avg = 7.0
max = 7
Wald chi2(3) = 327.57
Log likelihood = -3817.0925 Prob > chi2 = 0.0000
--------------------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
---------------------------+----------------------------------------------------------------
agec18 | 2.1937 .3069386 7.15 0.000 1.592112 2.795289
|
c.agec18#c.agec18 | .237376 .1231583 1.93 0.054 -.0040099 .4787619
|
c.agec18#c.agec18#c.agec18 | .0102749 .0134258 0.77 0.444 -.0160391 .0365889
|
_cons | 23.5251 .3821139 61.57 0.000 22.77617 24.27403
--------------------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
personid: Unstructured |
var(agec18) | .5863669 .0894576 .4348185 .7907349
var(_cons) | 21.71191 2.565532 17.22336 27.3702
cov(agec18,_cons) | 2.481349 .4147955 1.668365 3.294333
-----------------------------+------------------------------------------------
var(Residual) | 8.344438 .3731649 7.644185 9.108839
------------------------------------------------------------------------------
LR test vs. linear regression: chi2(3) = 715.49 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 . -3817.093 8 7650.185 7676.572
-----------------------------------------------------------------------------
Note: N=200 used in calculating BIC
.
. display as result "Ch 7b: Fixed Quadratic, Random Linear Age Model"
Ch 7b: Fixed Quadratic, Random Linear Age Model
. display as result "Attitudes Predicting Intercept"
Attitudes Predicting Intercept
. mixed risky c.agec18 c.agec18#c.agec18 ///
> c.att4, ///
> || personid: agec18, variance mle covariance(unstructured),
Performing EM optimization:
Performing gradient-based optimization:
Iteration 0: log likelihood = -3812.781
Iteration 1: log likelihood = -3812.781
Computing standard errors:
Mixed-effects ML regression Number of obs = 1400
Group variable: personid Number of groups = 200
Obs per group: min = 7
avg = 7.0
max = 7
Wald chi2(3) = 338.01
Log likelihood = -3812.781 Prob > chi2 = 0.0000
-----------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
------------------+----------------------------------------------------------------
agec18 | 1.987973 .1476098 13.47 0.000 1.698663 2.277283
|
c.agec18#c.agec18 | .1446717 .0219673 6.59 0.000 .1016165 .1877268
|
att4 | -1.332541 .4098418 -3.25 0.001 -2.135816 -.529266
_cons | 23.39979 .3582134 65.32 0.000 22.69771 24.10188
-----------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
personid: Unstructured |
var(agec18) | .5846331 .0892984 .4333798 .7886752
var(_cons) | 19.29791 2.394779 15.13144 24.61163
cov(agec18,_cons) | 2.227609 .399497 1.444609 3.010608
-----------------------------+------------------------------------------------
var(Residual) | 8.35194 .3735025 7.651054 9.117032
------------------------------------------------------------------------------
LR test vs. linear regression: chi2(3) = 665.47 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 . -3812.781 8 7641.562 7667.948
-----------------------------------------------------------------------------
Note: N=200 used in calculating BIC
. predict PredAttInt, xb,
. corr risky PredAttInt
(obs=1400)
| risky PredAt~t
-------------+------------------
risky | 1.0000
PredAttInt | 0.4701 1.0000
.
. display as result "Ch 7b: Fixed Quadratic, Random Linear Age Model"
Ch 7b: Fixed Quadratic, Random Linear Age Model
. display as result "Attitudes Predicting Linear Age Slope"
Attitudes Predicting Linear Age Slope
. mixed risky c.agec18 c.agec18#c.agec18 ///
> c.att4 c.agec18#c.att4, ///
> || personid: agec18, variance mle covariance(unstructured),
Performing EM optimization:
Performing gradient-based optimization:
Iteration 0: log likelihood = -3801.2664
Iteration 1: log likelihood = -3801.2664
Computing standard errors:
Mixed-effects ML regression Number of obs = 1400
Group variable: personid Number of groups = 200
Obs per group: min = 7
avg = 7.0
max = 7
Wald chi2(4) = 397.26
Log likelihood = -3801.2664 Prob > chi2 = 0.0000
-----------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
------------------+----------------------------------------------------------------
agec18 | 1.964886 .1460116 13.46 0.000 1.678709 2.251064
|
c.agec18#c.agec18 | .1450475 .021963 6.60 0.000 .1020007 .1880943
|
att4 | -3.155502 .5512883 -5.72 0.000 -4.236007 -2.074997
|
c.agec18#c.att4 | -.5154258 .1042977 -4.94 0.000 -.7198455 -.3110061
|
_cons | 23.31201 .350051 66.60 0.000 22.62592 23.9981
-----------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
personid: Unstructured |
var(agec18) | .4880961 .0798137 .3542553 .672503
var(_cons) | 18.08098 2.204655 14.23748 22.96206
cov(agec18,_cons) | 1.884828 .3564732 1.186154 2.583503
-----------------------------+------------------------------------------------
var(Residual) | 8.352883 .373583 7.651849 9.118143
------------------------------------------------------------------------------
LR test vs. linear regression: chi2(3) = 663.34 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 . -3801.266 9 7620.533 7650.218
-----------------------------------------------------------------------------
Note: N=200 used in calculating BIC
. predict PredAttLin, xb,
. margins, at (c.agec18=(-6(1)0) c.att4=(-2(3)1)) vsquish,
Adjusted predictions Number of obs = 1400
Expression : Linear prediction, fixed portion, predict()
1._at : agec18 = -6
att4 = -2
2._at : agec18 = -6
att4 = 1
3._at : agec18 = -5
att4 = -2
4._at : agec18 = -5
att4 = 1
5._at : agec18 = -4
att4 = -2
6._at : agec18 = -4
att4 = 1
7._at : agec18 = -3
att4 = -2
8._at : agec18 = -3
att4 = 1
9._at : agec18 = -2
att4 = -2
10._at : agec18 = -2
att4 = 1
11._at : agec18 = -1
att4 = -2
12._at : agec18 = -1
att4 = 1
13._at : agec18 = 0
att4 = -2
14._at : agec18 = 0
att4 = 1
------------------------------------------------------------------------------
| Delta-method
| Margin Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
_at |
1 | 16.8703 .9933088 16.98 0.000 14.92345 18.81715
2 | 16.68146 .5954995 28.01 0.000 15.5143 17.84861
3 | 18.27051 .8927467 20.47 0.000 16.52076 20.02026
4 | 16.53539 .5289892 31.26 0.000 15.49859 17.57219
5 | 19.96082 .8449478 23.62 0.000 18.30476 21.61689
6 | 16.67943 .5034561 33.13 0.000 15.69267 17.66618
7 | 21.94123 .8487408 25.85 0.000 20.27773 23.60473
8 | 17.11356 .507977 33.69 0.000 16.11794 18.10917
9 | 24.21173 .9004023 26.89 0.000 22.44697 25.97649
10 | 17.83778 .5363112 33.26 0.000 16.78663 18.88893
11 | 26.77232 .9955196 26.89 0.000 24.82114 28.72351
12 | 18.8521 .5898261 31.96 0.000 17.69606 20.00813
13 | 29.62302 1.130918 26.19 0.000 27.40646 31.83957
14 | 20.15651 .6753314 29.85 0.000 18.83288 21.48013
------------------------------------------------------------------------------
. corr risky PredAttLin
(obs=1400)
| risky PredAt~n
-------------+------------------
risky | 1.0000
PredAttLin | 0.4856 1.0000
.
. display as result "Eq 7b.9: Fixed Quadratic, Random Linear Age Model"
Eq 7b.9: Fixed Quadratic, Random Linear Age Model
. display as result "Attitudes Predicting Quadratic Age Slope"
Attitudes Predicting Quadratic Age Slope
. mixed risky c.agec18 c.agec18#c.agec18 ///
> c.att4 c.agec18#c.att4 c.agec18#c.agec18#c.att4, ///
> || personid: agec18, variance mle covariance(unstructured),
Performing EM optimization:
Performing gradient-based optimization:
Iteration 0: log likelihood = -3799.716
Iteration 1: log likelihood = -3799.716
Computing standard errors:
Mixed-effects ML regression Number of obs = 1400
Group variable: personid Number of groups = 200
Obs per group: min = 7
avg = 7.0
max = 7
Wald chi2(5) = 400.20
Log likelihood = -3799.716 Prob > chi2 = 0.0000
------------------------------------------------------------------------------------------
risky | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------------------+----------------------------------------------------------------
agec18 | 1.94802 .146145 13.33 0.000 1.661581 2.234459
|
c.agec18#c.agec18 | .1421578 .0219885 6.47 0.000 .099061 .1852545
|
att4 | -3.476359 .5805023 -5.99 0.000 -4.614123 -2.338595
|
c.agec18#c.att4 | -.9004503 .2420969 -3.72 0.000 -1.374951 -.4259492
|
c.agec18#c.agec18#c.att4 | -.0640871 .0363613 -1.76 0.078 -.135354 .0071797
|
_cons | 23.2993 .3500286 66.56 0.000 22.61326 23.98535
------------------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
personid: Unstructured |
var(agec18) | .4898417 .0798815 .3558321 .6743206
var(_cons) | 18.08801 2.204038 14.24529 22.96732
cov(agec18,_cons) | 1.888338 .3565622 1.189489 2.587187
-----------------------------+------------------------------------------------
var(Residual) | 8.325429 .3723555 7.626698 9.088174
------------------------------------------------------------------------------
LR test vs. linear regression: chi2(3) = 665.21 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 . -3799.716 10 7619.432 7652.415
-----------------------------------------------------------------------------
Note: N=200 used in calculating BIC
. predict PredAttQuad, xb,
. corr risky PredAttQuad
(obs=1400)
| risky PredAt~d
-------------+------------------
risky | 1.0000
PredAttQuad | 0.4863 1.0000
.
. ****** END CHAPTER 7b MODELS ******
.
. * Close log
. log close STATA_Chapter7b
name: STATA_Chapter7b
log: C:\Dropbox\PilesOfVariance\Chapter7b\STATA\STATA_Chapter7b_Output.smcl
log type: smcl
closed on: 12 Jan 2015, 13:03:34
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------