------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  STATA_Chapter2
       log:  C:\Dropbox\PilesOfVariance\Chapter2\STATA\STATA_Chapter2_Output.smcl
  log type:  smcl
 opened on:   3 Jan 2015, 14:33:12


. . display as result "Chapter 2: Descriptive Statistics for Example Variables" Chapter 2: Descriptive Statistics for Example Variables

. summarize age grip cognition

Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- age | 550 84.92679 3.430029 80.01649 96.96728 grip | 550 9.112727 2.982954 0 19 cognition | 550 24.82182 10.98903 0 44

. tabulate sexmw demgroup

sexMW: Sex | demgroup: Dementia Diagnosis (0=Men, | (1=None, 2=Future, 3=Current) 1=Women) | 1 2 3 | Total -----------+---------------------------------+---------- 0 | 168 40 19 | 227 1 | 231 69 23 | 323 -----------+---------------------------------+---------- Total | 399 109 42 | 550



. corr age grip sexmw cognition (obs=550)

| age grip sexmw cognit~n -------------+------------------------------------ age | 1.0000 grip | -0.1841 1.0000 sexmw | 0.0456 -0.4032 1.0000 cognition | -0.1705 0.2418 -0.2363 1.0000



. . display as result "Eq 2.3: Empty Means Model" Eq 2.3: Empty Means Model

. mixed cognition , /// > || personid: , noconstant variance reml covariance(unstructured), Note: all random-effects equations are empty; model is linear regression

Mixed-effects REML regression Number of obs = 550

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

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _cons | 24.82182 .4685737 52.97 0.000 23.90343 25.74021 ------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ var(Residual) | 120.7587 7.282025 107.2974 135.9089 ------------------------------------------------------------------------------

. estat ic, n(550),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 550 . -2098.049 2 4200.098 4208.717 ----------------------------------------------------------------------------- Note: N=550 used in calculating BIC

. . display as result "Eq 2.4: Adding Age (0=85)" Eq 2.4: Adding Age (0=85)

. mixed cognition c.age85, /// > || personid: , noconstant variance reml covariance(unstructured), Note: all random-effects equations are empty; model is linear regression

Mixed-effects REML regression Number of obs = 550

Wald chi2(1) = 16.40 Log restricted-likelihood = -2091.0404 Prob > chi2 = 0.0001

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age85 | -.5460905 .1348555 -4.05 0.000 -.8104025 -.2817786 _cons | 24.78184 .4622431 53.61 0.000 23.87586 25.68782 ------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ var(Residual) | 117.4642 7.083355 104.3701 132.201 ------------------------------------------------------------------------------

. estat ic, n(550),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 550 . -2091.04 3 4188.081 4201.011 ----------------------------------------------------------------------------- Note: N=550 used in calculating BIC

. . display as result "Eq 2.4: Adding Original Age Instead" Eq 2.4: Adding Original Age Instead

. mixed cognition c.age, /// > || personid: , noconstant variance reml covariance(unstructured), Note: all random-effects equations are empty; model is linear regression

Mixed-effects REML regression Number of obs = 550

Wald chi2(1) = 16.40 Log restricted-likelihood = -2091.0404 Prob > chi2 = 0.0001

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | -.5460905 .1348555 -4.05 0.000 -.8104025 -.2817786 _cons | 71.19953 11.46217 6.21 0.000 48.7341 93.66497 ------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ var(Residual) | 117.4642 7.083355 104.3701 132.201 ------------------------------------------------------------------------------

. estat ic, n(550),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 550 . -2091.04 3 4188.081 4201.011 ----------------------------------------------------------------------------- Note: N=550 used in calculating BIC

. . display as result "Eq 2.6: Adding Grip (0=9)" Eq 2.6: Adding Grip (0=9)

. mixed cognition c.age85 c.grip9, /// > || personid: , noconstant variance reml covariance(unstructured), Note: all random-effects equations are empty; model is linear regression

Mixed-effects REML regression Number of obs = 550

Wald chi2(2) = 44.28 Log restricted-likelihood = -2078.7399 Prob > chi2 = 0.0000

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age85 | -.4175853 .1340458 -3.12 0.002 -.6803104 -.1548603 grip9 | .8024817 .1541361 5.21 0.000 .5003804 1.104583 _cons | 24.70078 .4518795 54.66 0.000 23.81512 25.58645 ------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ var(Residual) | 112.1228 6.761261 99.62415 126.1896 ------------------------------------------------------------------------------

. estat ic, n(550),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 550 . -2078.74 4 4165.48 4182.719 ----------------------------------------------------------------------------- Note: N=550 used in calculating BIC

. * Model R2 Test . test (c.age85=0) (c.grip9=0)

( 1) [cognition]age85 = 0 ( 2) [cognition]grip9 = 0

chi2( 2) = 44.28 Prob > chi2 = 0.0000

. . display as result "Eq 2.7: Adding Sex (0=M, 1=W)" Eq 2.7: Adding Sex (0=M, 1=W)

. mixed cognition c.age85 c.grip9 c.sexmw, /// > || personid: , noconstant variance reml covariance(unstructured), Note: all random-effects equations are empty; model is linear regression

Mixed-effects REML regression Number of obs = 550

Wald chi2(3) = 60.11 Log restricted-likelihood = -2070.5586 Prob > chi2 = 0.0000

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age85 | -.4337719 .1324638 -3.27 0.001 -.6933962 -.1741477 grip9 | .5460019 .1662766 3.28 0.001 .2201058 .8718981 sexmw | -3.79878 .9903591 -3.84 0.000 -5.739848 -1.857712 _cons | 26.95943 .7388729 36.49 0.000 25.51127 28.40759 ------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ var(Residual) | 109.3807 6.595904 97.1877 123.1034 ------------------------------------------------------------------------------

. estat ic, n(550),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 550 . -2070.559 5 4151.117 4172.667 ----------------------------------------------------------------------------- Note: N=550 used in calculating BIC

. * Model R2 Test . test (c.age85=0) (c.grip9=0) (c.sexmw=0)

( 1) [cognition]age85 = 0 ( 2) [cognition]grip9 = 0 ( 3) [cognition]sexmw = 0

chi2( 3) = 60.11 Prob > chi2 = 0.0000

. . display as result "Eq 2.7: Adding Sex (1=M 0=W)" Eq 2.7: Adding Sex (1=M 0=W)

. mixed cognition c.age85 c.grip9 c.sexwm, /// > || personid: , noconstant variance reml covariance(unstructured), Note: all random-effects equations are empty; model is linear regression

Mixed-effects REML regression Number of obs = 550

Wald chi2(3) = 60.11 Log restricted-likelihood = -2070.5586 Prob > chi2 = 0.0000

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age85 | -.4337719 .1324638 -3.27 0.001 -.6933962 -.1741477 grip9 | .5460019 .1662766 3.28 0.001 .2201058 .8718981 sexwm | 3.79878 .9903591 3.84 0.000 1.857712 5.739848 _cons | 23.16065 .6003492 38.58 0.000 21.98399 24.33731 ------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ var(Residual) | 109.3807 6.595904 97.1877 123.1034 ------------------------------------------------------------------------------

. estat ic, n(550),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 550 . -2070.559 5 4151.117 4172.667 ----------------------------------------------------------------------------- Note: N=550 used in calculating BIC

. . display as result "Eq 2.8: Adding Dementia Group" Eq 2.8: Adding Dementia Group

. display as result "Using Manual Group Contrasts so Reference=None" Using Manual Group Contrasts so Reference=None

. mixed cognition c.age85 c.grip9 c.sexmw c.demnf c.demnc, /// > || personid: , noconstant variance reml covariance(unstructured), Note: all random-effects equations are empty; model is linear regression

Mixed-effects REML regression Number of obs = 550

Wald chi2(5) = 208.76 Log restricted-likelihood = -2008.1345 Prob > chi2 = 0.0000

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age85 | -.405734 .1188972 -3.41 0.001 -.6387681 -.1726998 grip9 | .6042256 .1497757 4.03 0.000 .3106706 .8977805 sexmw | -3.657374 .8914326 -4.10 0.000 -5.40455 -1.910198 demnf | -5.721971 1.019078 -5.61 0.000 -7.719328 -3.724614 demnc | -16.47981 1.522754 -10.82 0.000 -19.46436 -13.49527 _cons | 29.26433 .6985079 41.90 0.000 27.89528 30.63338 ------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ var(Residual) | 88.07088 5.310874 78.25335 99.1201 ------------------------------------------------------------------------------

. estat ic, n(550),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 550 . -2008.134 7 4030.269 4060.438 ----------------------------------------------------------------------------- Note: N=550 used in calculating BIC

. * Model R2 Test . test (c.age85=0) (c.grip9=0) (c.sexmw=0) (c.demnf=0) (c.demnc=0)

( 1) [cognition]age85 = 0 ( 2) [cognition]grip9 = 0 ( 3) [cognition]sexmw = 0 ( 4) [cognition]demnf = 0 ( 5) [cognition]demnc = 0

chi2( 5) = 208.76 Prob > chi2 = 0.0000

. * Omnibus Dementia Group Test . test (c.demnf=0) (c.demnc=0)

( 1) [cognition]demnf = 0 ( 2) [cognition]demnc = 0

chi2( 2) = 134.11 Prob > chi2 = 0.0000

. lincom c.demnf*-1 + c.demnc*1 // Future vs Current

( 1) - [cognition]demnf + [cognition]demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -10.75784 1.707957 -6.30 0.000 -14.10538 -7.410308 ------------------------------------------------------------------------------

. . display as result "Eq 2.8: Adding Dementia Group" Eq 2.8: Adding Dementia Group

. display as result "Categorical Predictor for Dementia Group" Categorical Predictor for Dementia Group

. mixed cognition c.age85 c.grip9 c.sexmw i.demgroup, /// > || personid: , noconstant variance reml covariance(unstructured), Note: all random-effects equations are empty; model is linear regression

Mixed-effects REML regression Number of obs = 550

Wald chi2(5) = 208.76 Log restricted-likelihood = -2008.1345 Prob > chi2 = 0.0000

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age85 | -.405734 .1188972 -3.41 0.001 -.6387681 -.1726998 grip9 | .6042256 .1497757 4.03 0.000 .3106706 .8977805 sexmw | -3.657374 .8914326 -4.10 0.000 -5.40455 -1.910198 | demgroup | 2 | -5.721971 1.019078 -5.61 0.000 -7.719328 -3.724614 3 | -16.47981 1.522754 -10.82 0.000 -19.46436 -13.49527 | _cons | 29.26433 .6985079 41.90 0.000 27.89528 30.63338 ------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ var(Residual) | 88.07088 5.310874 78.25335 99.1201 ------------------------------------------------------------------------------

. estat ic, n(550),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 550 . -2008.134 7 4030.269 4060.438 ----------------------------------------------------------------------------- Note: N=550 used in calculating BIC

. contrast i.demgroup,

Contrasts of marginal linear predictions

Margins : asbalanced

------------------------------------------------ | df chi2 P>chi2 -------------+---------------------------------- cognition | demgroup | 2 134.11 0.0000 ------------------------------------------------

. margins i.demgroup, at(c.age85=0 c.grip9=0 c.sexmw=0)

Adjusted predictions Number of obs = 550

Expression : Linear prediction, fixed portion, predict() at : age85 = 0 grip9 = 0 sexmw = 0

------------------------------------------------------------------------------ | Delta-method | Margin Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- demgroup | 1 | 29.26433 .6985079 41.90 0.000 27.89528 30.63338 2 | 23.54235 1.07853 21.83 0.000 21.42847 25.65623 3 | 12.78451 1.530193 8.35 0.000 9.785388 15.78364 ------------------------------------------------------------------------------

. margins i.demgroup, pwcompare(pveffects)

Pairwise comparisons of predictive margins

Expression : Linear prediction, fixed portion, predict()

----------------------------------------------------- | Delta-method Unadjusted | Contrast Std. Err. z P>|z| -------------+--------------------------------------- demgroup | 2 vs 1 | -5.721971 1.019078 -5.61 0.000 3 vs 1 | -16.47981 1.522754 -10.82 0.000 3 vs 2 | -10.75784 1.707957 -6.30 0.000 -----------------------------------------------------

. . display as result "Eq 2.9: Adding Age by Grip Interaction" Eq 2.9: Adding Age by Grip Interaction

. display as result "Age (0=85), Grip (0=9)" Age (0=85), Grip (0=9)

. mixed cognition c.age85 c.grip9 c.sexmw c.demnf c.demnc /// > c.age85#c.grip9, /// > || personid: , noconstant variance reml covariance(unstructured), Note: all random-effects equations are empty; model is linear regression

Mixed-effects REML regression Number of obs = 550

Wald chi2(6) = 221.12 Log restricted-likelihood = -2005.8468 Prob > chi2 = 0.0000

--------------------------------------------------------------------------------- cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] ----------------+---------------------------------------------------------------- age85 | -.3339606 .1203566 -2.77 0.006 -.5698551 -.0980661 grip9 | .6194186 .1487424 4.16 0.000 .3278889 .9109484 sexmw | -3.455637 .8872749 -3.89 0.000 -5.194664 -1.71661 demnf | -5.922543 1.013632 -5.84 0.000 -7.909225 -3.935862 demnc | -16.3004 1.512547 -10.78 0.000 -19.26494 -13.33587 | c.age85#c.grip9 | .1230185 .0405363 3.03 0.002 .0435689 .2024681 | _cons | 29.4078 .6949062 42.32 0.000 28.04581 30.76979 ---------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ var(Residual) | 86.7615 5.231916 77.08994 97.64645 ------------------------------------------------------------------------------

. estat ic, n(550),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 550 . -2005.847 8 4027.694 4062.173 ----------------------------------------------------------------------------- Note: N=550 used in calculating BIC

. estat vce,

Covariance matrix of coefficients of mixed model

| cognition | lnsig_e | c.age85# | e(V) | age85 grip9 sexmw demnf demnc c.grip9 _cons | _cons -------------+------------------------------------------------------------------------------------+------------ cognition | | age85 | .0144857 | grip9 | .00331698 .0221243 | sexmw | .005024 .05374269 .78725672 | demnf | -.00413095 -.01338766 -.07101552 1.027449 | demnc | -.00115115 -.00030106 .02370811 .21291169 2.2877993 | c.age85#| | c.grip9 | .0009587 .00020294 .00269465 -.00267909 .0023964 .00164319 | _cons | .00045357 -.03075328 -.45067156 -.18202858 -.22634698 .00191647 .48289456 | -------------+------------------------------------------------------------------------------------+------------ lnsig_e | | _cons | 0 0 0 0 0 0 0 | .00090909

. * Model R2 Test . test (c.age85=0) (c.grip9=0) (c.sexmw=0) (c.demnf=0) (c.demnc=0) (c.age85#c.grip9=0)

( 1) [cognition]age85 = 0 ( 2) [cognition]grip9 = 0 ( 3) [cognition]sexmw = 0 ( 4) [cognition]demnf = 0 ( 5) [cognition]demnc = 0 ( 6) [cognition]c.age85#c.grip9 = 0

chi2( 6) = 221.12 Prob > chi2 = 0.0000

. * Future vs Current . lincom c.demnf*-1 + c.demnc*1

( 1) - [cognition]demnf + [cognition]demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -10.37786 1.699831 -6.11 0.000 -13.70947 -7.046254 ------------------------------------------------------------------------------

. * Age Slope at Grip Strength = 6 . lincom c.age85*1 + c.age85#c.grip9*-3

( 1) [cognition]age85 - 3*[cognition]c.age85#c.grip9 = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -.703016 .1533696 -4.58 0.000 -1.003615 -.4024172 ------------------------------------------------------------------------------

. * Age Slope at Grip Strength = 9 . lincom c.age85*1 + c.age85#c.grip9*0

( 1) [cognition]age85 = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -.3339606 .1203566 -2.77 0.006 -.5698551 -.0980661 ------------------------------------------------------------------------------

. * Age Slope at Grip Strength = 12 . lincom c.age85*1 + c.age85#c.grip9*3

( 1) [cognition]age85 + 3*[cognition]c.age85#c.grip9 = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | .0350949 .1871539 0.19 0.851 -.33172 .4019097 ------------------------------------------------------------------------------

. * Grip Strength Slope at Age = 80 . lincom c.grip9*1 + c.age85#c.grip9*-5

( 1) [cognition]grip9 - 5*[cognition]c.age85#c.grip9 = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | .0043262 .2473351 0.02 0.986 -.4804416 .4890941 ------------------------------------------------------------------------------

. * Grip Strength Slope at Age = 85 . lincom c.grip9*1 + c.age85#c.grip9*0

( 1) [cognition]grip9 = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | .6194186 .1487424 4.16 0.000 .3278889 .9109484 ------------------------------------------------------------------------------

. * Grip Strength Slope at Age = 90 . lincom c.grip9*1 + c.age85#c.grip9*5

( 1) [cognition]grip9 + 5*[cognition]c.age85#c.grip9 = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 1.234511 .2554083 4.83 0.000 .73392 1.735102 ------------------------------------------------------------------------------

. * Cognition at Grip = 12 Age = 80 . lincom _cons*1 + c.age85*-5 + c.grip9*3 + c.age85#c.grip9*-15

( 1) - 5*[cognition]age85 + 3*[cognition]grip9 - 15*[cognition]c.age85#c.grip9 + [cognition]_cons = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 31.09058 1.092408 28.46 0.000 28.94951 33.23166 ------------------------------------------------------------------------------

. * Cognition at Grip = 12 Age = 85 . lincom _cons*1 + c.age85*0 + c.grip9*3 + c.age85#c.grip9*0

( 1) 3*[cognition]grip9 + [cognition]_cons = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 31.26606 .7053323 44.33 0.000 29.88363 32.64848 ------------------------------------------------------------------------------

. * Cognition at Grip = 12 Age = 90 . lincom _cons*1 + c.age85*5 + c.grip9*3 + c.age85#c.grip9*15

( 1) 5*[cognition]age85 + 3*[cognition]grip9 + 15*[cognition]c.age85#c.grip9 + [cognition]_cons = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 31.44153 1.246179 25.23 0.000 28.99907 33.884 ------------------------------------------------------------------------------

. * Cognition at Grip = 9 Age = 80 . lincom _cons*1 + c.age85*-5 + c.grip9*0 + c.age85#c.grip9*0

( 1) - 5*[cognition]age85 + [cognition]_cons = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 31.07761 .9167886 33.90 0.000 29.28073 32.87448 ------------------------------------------------------------------------------

. * Cognition at Grip = 9 Age = 85 . lincom _cons*1 + c.age85*0 + c.grip9*0 + c.age85#c.grip9*0

( 1) [cognition]_cons = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 29.4078 .6949062 42.32 0.000 28.04581 30.76979 ------------------------------------------------------------------------------

. * Cognition at Grip = 9 Age = 90 . lincom _cons*1 + c.age85*5 + c.grip9*0 + c.age85#c.grip9*0

( 1) 5*[cognition]age85 + [cognition]_cons = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 27.738 .9217228 30.09 0.000 25.93146 29.54454 ------------------------------------------------------------------------------

. * Cognition at Grip = 6 Age = 80 . lincom _cons*1 + c.age85*-5 + c.grip9*-3 + c.age85#c.grip9*15

( 1) - 5*[cognition]age85 - 3*[cognition]grip9 + 15*[cognition]c.age85#c.grip9 + [cognition]_cons = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 31.06463 1.260473 24.65 0.000 28.59415 33.53511 ------------------------------------------------------------------------------

. * Cognition at Grip = 6 Age = 85 . lincom _cons*1 + c.age85*0 + c.grip9*-3 + c.age85#c.grip9*0

( 1) - 3*[cognition]grip9 + [cognition]_cons = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 27.54955 .9308775 29.60 0.000 25.72506 29.37403 ------------------------------------------------------------------------------

. * Cognition at Grip = 6 Age = 90 . lincom _cons*1 + c.age85*5 + c.grip9*-3 + c.age85#c.grip9*-15

( 1) 5*[cognition]age85 - 3*[cognition]grip9 - 15*[cognition]c.age85#c.grip9 + [cognition]_cons = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 24.03447 1.14908 20.92 0.000 21.78231 26.28662 ------------------------------------------------------------------------------

. margins, at (c.age85=(-5(5)5) c.grip9=(-3(3)3) c.sexmw=0 c.demnf=0 c.demnc=0) vsquish,

Adjusted predictions Number of obs = 550

Expression : Linear prediction, fixed portion, predict() 1._at : age85 = -5 grip9 = -3 sexmw = 0 demnf = 0 demnc = 0 2._at : age85 = -5 grip9 = 0 sexmw = 0 demnf = 0 demnc = 0 3._at : age85 = -5 grip9 = 3 sexmw = 0 demnf = 0 demnc = 0 4._at : age85 = 0 grip9 = -3 sexmw = 0 demnf = 0 demnc = 0 5._at : age85 = 0 grip9 = 0 sexmw = 0 demnf = 0 demnc = 0 6._at : age85 = 0 grip9 = 3 sexmw = 0 demnf = 0 demnc = 0 7._at : age85 = 5 grip9 = -3 sexmw = 0 demnf = 0 demnc = 0 8._at : age85 = 5 grip9 = 0 sexmw = 0 demnf = 0 demnc = 0 9._at : age85 = 5 grip9 = 3 sexmw = 0 demnf = 0 demnc = 0

------------------------------------------------------------------------------ | Delta-method | Margin Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _at | 1 | 31.06463 1.260473 24.65 0.000 28.59415 33.53511 2 | 31.07761 .9167886 33.90 0.000 29.28073 32.87448 3 | 31.09058 1.092408 28.46 0.000 28.94951 33.23166 4 | 27.54955 .9308775 29.60 0.000 25.72506 29.37403 5 | 29.4078 .6949062 42.32 0.000 28.04581 30.76979 6 | 31.26606 .7053323 44.33 0.000 29.88363 32.64848 7 | 24.03447 1.14908 20.92 0.000 21.78231 26.28662 8 | 27.738 .9217228 30.09 0.000 25.93146 29.54454 9 | 31.44153 1.246179 25.23 0.000 28.99907 33.884 ------------------------------------------------------------------------------

. . display as result "Eq 2.9: Adding Age by Grip Interaction" Eq 2.9: Adding Age by Grip Interaction

. display as result "Age (0=80), Grip (0=12)" Age (0=80), Grip (0=12)

. mixed cognition c.age80 c.grip12 c.sexmw c.demnf c.demnc /// > c.age80#c.grip12, /// > || personid: , noconstant variance reml covariance(unstructured), Note: all random-effects equations are empty; model is linear regression

Mixed-effects REML regression Number of obs = 550

Wald chi2(6) = 221.12 Log restricted-likelihood = -2005.8468 Prob > chi2 = 0.0000

---------------------------------------------------------------------------------- cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -----------------+---------------------------------------------------------------- age80 | .0350949 .1871539 0.19 0.851 -.33172 .4019097 grip12 | .0043263 .2473351 0.02 0.986 -.4804416 .4890941 sexmw | -3.455637 .8872749 -3.89 0.000 -5.194664 -1.71661 demnf | -5.922543 1.013632 -5.84 0.000 -7.909225 -3.935862 demnc | -16.3004 1.512547 -10.78 0.000 -19.26494 -13.33587 | c.age80#c.grip12 | .1230185 .0405363 3.03 0.002 .0435689 .2024681 | _cons | 31.09058 1.092408 28.46 0.000 28.94951 33.23166 ----------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ var(Residual) | 86.7615 5.231916 77.08994 97.64645 ------------------------------------------------------------------------------

. estat ic, n(550),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 550 . -2005.847 8 4027.694 4062.173 ----------------------------------------------------------------------------- Note: N=550 used in calculating BIC

. lincom c.demnf*-1 + c.demnc*1 // Future vs Current

( 1) - [cognition]demnf + [cognition]demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -10.37786 1.699831 -6.11 0.000 -13.70947 -7.046254 ------------------------------------------------------------------------------

. . display as result "Eq 2.9: Adding Age by Grip Interaction" Eq 2.9: Adding Age by Grip Interaction

. display as result "Age (0=90), Grip (0=6)" Age (0=90), Grip (0=6)

. mixed cognition c.age90 c.grip6 c.sexmw c.demnf c.demnc /// > c.age90#c.grip6, /// > || personid: , noconstant variance reml covariance(unstructured), Note: all random-effects equations are empty; model is linear regression

Mixed-effects REML regression Number of obs = 550

Wald chi2(6) = 221.12 Log restricted-likelihood = -2005.8468 Prob > chi2 = 0.0000

--------------------------------------------------------------------------------- cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] ----------------+---------------------------------------------------------------- age90 | -.703016 .1533696 -4.58 0.000 -1.003615 -.4024171 grip6 | 1.234511 .2554083 4.83 0.000 .73392 1.735102 sexmw | -3.455637 .8872749 -3.89 0.000 -5.194664 -1.71661 demnf | -5.922543 1.013632 -5.84 0.000 -7.909225 -3.935862 demnc | -16.3004 1.512547 -10.78 0.000 -19.26494 -13.33587 | c.age90#c.grip6 | .1230185 .0405363 3.03 0.002 .0435689 .2024681 | _cons | 24.03447 1.14908 20.92 0.000 21.78231 26.28662 ---------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ var(Residual) | 86.7615 5.231916 77.08994 97.64645 ------------------------------------------------------------------------------

. estat ic, n(550),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 550 . -2005.847 8 4027.694 4062.173 ----------------------------------------------------------------------------- Note: N=550 used in calculating BIC

. lincom c.demnf*-1 + c.demnc*1 // Future vs Current

( 1) - [cognition]demnf + [cognition]demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -10.37786 1.699831 -6.11 0.000 -13.70947 -7.046254 ------------------------------------------------------------------------------

. . display as result "Eq 2.13: Adding Sex by Dementia Interaction" Eq 2.13: Adding Sex by Dementia Interaction

. display as result "Sex (0=Men), Dementia (0=None)" Sex (0=Men), Dementia (0=None)

. mixed cognition c.age85 c.grip9 c.sexmw c.demnf c.demnc /// > c.age85#c.grip9 c.sexmw#c.demnf c.sexmw#c.demnc, /// > || personid: , noconstant variance reml covariance(unstructured), Note: all random-effects equations are empty; model is linear regression

Mixed-effects REML regression Number of obs = 550

Wald chi2(8) = 230.14 Log restricted-likelihood = -1998.7039 Prob > chi2 = 0.0000

--------------------------------------------------------------------------------- cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] ----------------+---------------------------------------------------------------- age85 | -.3347988 .1198875 -2.79 0.005 -.5697741 -.0998235 grip9 | .6178929 .1480794 4.17 0.000 .3276625 .9081232 sexmw | -2.875594 1.011237 -2.84 0.004 -4.857583 -.8936056 demnf | -6.055901 1.635126 -3.70 0.000 -9.26069 -2.851113 demnc | -11.97073 2.244954 -5.33 0.000 -16.37076 -7.570702 | c.age85#c.grip9 | .1221516 .0403529 3.03 0.002 .0430614 .2012418 | c.sexmw#c.demnf | .16427 2.070475 0.08 0.937 -3.893787 4.222327 | c.sexmw#c.demnc | -7.8751 3.024536 -2.60 0.009 -13.80308 -1.947117 | _cons | 29.07015 .7484992 38.84 0.000 27.60311 30.53718 ---------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ var(Residual) | 85.97242 5.184332 76.38881 96.75836 ------------------------------------------------------------------------------

. estat ic, n(550),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 550 . -1998.704 10 4017.408 4060.507 ----------------------------------------------------------------------------- Note: N=550 used in calculating BIC

. estat vce,

Covariance matrix of coefficients of mixed model

| cognition | lnsig_e | c.age85# c.sexmw# c.sexmw# | e(V) | age85 grip9 sexmw demnf demnc c.grip9 c.demnf c.demnc _cons | _cons -------------+------------------------------------------------------------------------------------------------------------+------------ cognition | | age85 | .01437302 | grip9 | .00327817 .02192752 | sexmw | .00298878 .05401984 1.0226007 | demnf | -.00967686 -.01063331 .48531945 2.6736373 | demnc | -.00295691 -.00064138 .51432961 .51105727 5.0398171 | c.age85#| | c.grip9 | .00095028 .00020119 .00257807 -.00269673 .00182362 .00162835 | c.sexmw#| | c.demnf | .00899367 -.00422662 -.8986672 -2.6639161 -.51427819 .00007386 4.2868677 | c.sexmw#| | c.demnc | .00319883 .00067264 -.88217344 -.51491208 -5.0362444 .00100108 .88566905 9.1478209 | _cons | .00160396 -.03091776 -.58737144 -.50277776 -.50976733 .0019526 .52140496 .51310134 .56025105 | -------------+------------------------------------------------------------------------------------------------------------+------------ lnsig_e | | _cons | 0 0 0 0 0 0 0 0 0 | .00090909

. * Model R2 Test . test (c.age85=0) (c.grip9=0) (c.sexmw=0) (c.demnf=0) (c.demnc=0) (c.age85#c.grip9=0) (c.sexmw#c.demnf=0) (c.sexmw#c.demnc=0)

( 1) [cognition]age85 = 0 ( 2) [cognition]grip9 = 0 ( 3) [cognition]sexmw = 0 ( 4) [cognition]demnf = 0 ( 5) [cognition]demnc = 0 ( 6) [cognition]c.age85#c.grip9 = 0 ( 7) [cognition]c.sexmw#c.demnf = 0 ( 8) [cognition]c.sexmw#c.demnc = 0

chi2( 8) = 230.14 Prob > chi2 = 0.0000

. * Omnibus Dementia*Sex Interaction Test . test (c.sexmw#c.demnf=0) (c.sexmw#c.demnc=0)

( 1) [cognition]c.sexmw#c.demnf = 0 ( 2) [cognition]c.sexmw#c.demnc = 0

chi2( 2) = 6.98 Prob > chi2 = 0.0304

. * Cognition for Men None . lincom _cons*1 + c.sexmw*0 + c.demnf*0 + c.demnc*0 + c.sexmw#c.demnf*0 + c.sexmw#c.demnc*0

( 1) [cognition]_cons = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 29.07015 .7484992 38.84 0.000 27.60311 30.53718 ------------------------------------------------------------------------------

. * Cognition for Women None . lincom _cons*1 + c.sexmw*1 + c.demnf*0 + c.demnc*0 + c.sexmw#c.demnf*0 + c.sexmw#c.demnc*0

( 1) [cognition]sexmw + [cognition]_cons = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 26.19455 .638834 41.00 0.000 24.94246 27.44664 ------------------------------------------------------------------------------

. * Cognition for Men Future . lincom _cons*1 + c.sexmw*0 + c.demnf*1 + c.demnc*0 + c.sexmw#c.demnf*0 + c.sexmw#c.demnc*0

( 1) [cognition]demnf + [cognition]_cons = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 23.01424 1.49276 15.42 0.000 20.08849 25.94 ------------------------------------------------------------------------------

. * Cognition for Women Future . lincom _cons*1 + c.sexmw*1 + c.demnf*1 + c.demnc*0 + c.sexmw#c.demnf*1 + c.sexmw#c.demnc*0

( 1) [cognition]sexmw + [cognition]demnf + [cognition]c.sexmw#c.demnf + [cognition]_cons = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 20.30292 1.118633 18.15 0.000 18.11044 22.4954 ------------------------------------------------------------------------------

. * Cognition for Men Current . lincom _cons*1 + c.sexmw*0 + c.demnf*0 + c.demnc*1 + c.sexmw#c.demnf*0 + c.sexmw#c.demnc*0

( 1) [cognition]demnc + [cognition]_cons = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 17.09942 2.140218 7.99 0.000 12.90467 21.29417 ------------------------------------------------------------------------------

. * Cognition for Women Current . lincom _cons*1 + c.sexmw*1 + c.demnf*0 + c.demnc*1 + c.sexmw#c.demnf*0 + c.sexmw#c.demnc*1

( 1) [cognition]sexmw + [cognition]demnc + [cognition]c.sexmw#c.demnc + [cognition]_cons = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 6.348722 1.94788 3.26 0.001 2.530947 10.1665 ------------------------------------------------------------------------------

. * Sex Difference for No Dementia . lincom c.sexmw*1 + c.sexmw#c.demnf*0 + c.sexmw#demnc*0

( 1) [cognition]sexmw = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -2.875594 1.011237 -2.84 0.004 -4.857583 -.8936056 ------------------------------------------------------------------------------

. * Sex Difference for Future Dementia . lincom c.sexmw*1 + c.sexmw#c.demnf*1 + c.sexmw#demnc*0

( 1) [cognition]sexmw + [cognition]c.sexmw#c.demnf = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -2.711324 1.874069 -1.45 0.148 -6.384431 .9617833 ------------------------------------------------------------------------------

. * Sex Difference for Current Dementia . lincom c.sexmw*1 + c.sexmw#c.demnf*0 + c.sexmw#demnc*1

( 1) [cognition]sexmw + [cognition]c.sexmw#c.demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -10.75069 2.899323 -3.71 0.000 -16.43326 -5.068125 ------------------------------------------------------------------------------

. * None-Future Difference for Men . lincom c.demnf*1 + c.sexmw#c.demnf*0

( 1) [cognition]demnf = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -6.055901 1.635126 -3.70 0.000 -9.26069 -2.851113 ------------------------------------------------------------------------------

. * None-Future Difference for Women . lincom c.demnf*1 + c.sexmw#c.demnf*1

( 1) [cognition]demnf + [cognition]c.sexmw#c.demnf = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -5.891631 1.277761 -4.61 0.000 -8.395997 -3.387266 ------------------------------------------------------------------------------

. * None-Current Difference for Men . lincom c.demnc*1 + c.sexmw#c.demnc*0

( 1) [cognition]demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -11.97073 2.244954 -5.33 0.000 -16.37076 -7.570702 ------------------------------------------------------------------------------

. * None-Current Difference for Women . lincom c.demnc*1 + c.sexmw#c.demnc*1

( 1) [cognition]demnc + [cognition]c.sexmw#c.demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -19.84583 2.028583 -9.78 0.000 -23.82178 -15.86988 ------------------------------------------------------------------------------

. * Future-Current Difference for Men . lincom c.demnf*-1 + c.demnc*1 + c.sexmw#c.demnf*0 + c.sexmw#c.demnc*0

( 1) - [cognition]demnf + [cognition]demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -5.914829 2.586762 -2.29 0.022 -10.98479 -.8448679 ------------------------------------------------------------------------------

. * Future-Current Difference for Women . lincom c.demnf*-1 + c.demnc*1 + c.sexmw#c.demnf*-1 + c.sexmw#c.demnc*1

( 1) - [cognition]demnf + [cognition]demnc - [cognition]c.sexmw#c.demnf + [cognition]c.sexmw#c.demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -13.9542 2.238917 -6.23 0.000 -18.3424 -9.566002 ------------------------------------------------------------------------------

. * None-Future Sex Difference . lincom c.sexmw#c.demnf*1

( 1) [cognition]c.sexmw#c.demnf = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | .16427 2.070475 0.08 0.937 -3.893787 4.222327 ------------------------------------------------------------------------------

. * None-Current Sex Difference . lincom c.sexmw#c.demnc*1

( 1) [cognition]c.sexmw#c.demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -7.8751 3.024536 -2.60 0.009 -13.80308 -1.947117 ------------------------------------------------------------------------------

. * Future-Current Sex Difference . lincom c.sexmw#c.demnf*-1 + c.sexmw#c.demnc*1

( 1) - [cognition]c.sexmw#c.demnf + [cognition]c.sexmw#c.demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -8.03937 3.415165 -2.35 0.019 -14.73297 -1.34577 ------------------------------------------------------------------------------

. . display as result "Eq 2.13: Adding Sex by Dementia Interaction" Eq 2.13: Adding Sex by Dementia Interaction

. display as result "Sex (0=Women), Dementia (0=None)" Sex (0=Women), Dementia (0=None)

. mixed cognition c.age85 c.grip9 c.sexwm c.demnf c.demnc /// > c.age85#c.grip9 sexwm#c.demnf c.sexwm#c.demnc, /// > || personid: , noconstant variance reml covariance(unstructured), Note: all random-effects equations are empty; model is linear regression

Mixed-effects REML regression Number of obs = 550

Wald chi2(8) = 230.14 Log restricted-likelihood = -1998.7039 Prob > chi2 = 0.0000

--------------------------------------------------------------------------------- cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] ----------------+---------------------------------------------------------------- age85 | -.3347988 .1198875 -2.79 0.005 -.5697741 -.0998235 grip9 | .6178929 .1480794 4.17 0.000 .3276625 .9081232 sexwm | 2.875594 1.011237 2.84 0.004 .8936056 4.857583 demnf | -5.891631 1.277761 -4.61 0.000 -8.395997 -3.387266 demnc | -19.84583 2.028583 -9.78 0.000 -23.82178 -15.86988 | c.age85#c.grip9 | .1221516 .0403529 3.03 0.002 .0430614 .2012418 | sexwm#c.demnf | 1 | -.16427 2.070475 -0.08 0.937 -4.222327 3.893787 | c.sexwm#c.demnc | 7.8751 3.024536 2.60 0.009 1.947117 13.80308 | _cons | 26.19455 .638834 41.00 0.000 24.94246 27.44664 ---------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ var(Residual) | 85.97242 5.184332 76.38881 96.75836 ------------------------------------------------------------------------------

. estat ic, n(550),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 550 . -1998.704 10 4017.408 4060.507 ----------------------------------------------------------------------------- Note: N=550 used in calculating BIC

. . display as result "Eq 2.15: Adding Sex by Dementia Interaction" Eq 2.15: Adding Sex by Dementia Interaction

. display as result "Sex (0=Men), Dementia (0=Future)" Sex (0=Men), Dementia (0=Future)

. mixed cognition c.age85 c.grip9 c.sexmw c.demfn c.demfc /// > c.age85#c.grip9 c.sexmw#c.demfn c.sexmw#c.demfc, /// > || personid: , noconstant variance reml covariance(unstructured), Note: all random-effects equations are empty; model is linear regression

Mixed-effects REML regression Number of obs = 550

Wald chi2(8) = 230.14 Log restricted-likelihood = -1998.7039 Prob > chi2 = 0.0000

--------------------------------------------------------------------------------- cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] ----------------+---------------------------------------------------------------- age85 | -.3347988 .1198875 -2.79 0.005 -.5697741 -.0998235 grip9 | .6178929 .1480794 4.17 0.000 .3276625 .9081232 sexmw | -2.711324 1.874069 -1.45 0.148 -6.384431 .9617833 demfn | 6.055901 1.635126 3.70 0.000 2.851113 9.26069 demfc | -5.914829 2.586762 -2.29 0.022 -10.98479 -.8448679 | c.age85#c.grip9 | .1221516 .0403529 3.03 0.002 .0430614 .2012418 | c.sexmw#c.demfn | -.16427 2.070475 -0.08 0.937 -4.222327 3.893787 | c.sexmw#c.demfc | -8.03937 3.415165 -2.35 0.019 -14.73297 -1.34577 | _cons | 23.01424 1.49276 15.42 0.000 20.08849 25.94 ---------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ var(Residual) | 85.97242 5.184332 76.38881 96.75836 ------------------------------------------------------------------------------

. estat ic, n(550),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 550 . -1998.704 10 4017.408 4060.507 ----------------------------------------------------------------------------- Note: N=550 used in calculating BIC

. . display as result "Eq 2.15: Adding Sex by Dementia Interaction" Eq 2.15: Adding Sex by Dementia Interaction

. display as result "Sex (0=Women), Dementia (0=Future)" Sex (0=Women), Dementia (0=Future)

. mixed cognition c.age85 c.grip9 c.sexwm c.demfn c.demfc /// > c.age85#c.grip9 c.sexwm#c.demfn c.sexwm#c.demfc, /// > || personid: , noconstant variance reml covariance(unstructured), Note: all random-effects equations are empty; model is linear regression

Mixed-effects REML regression Number of obs = 550

Wald chi2(8) = 230.14 Log restricted-likelihood = -1998.7039 Prob > chi2 = 0.0000

--------------------------------------------------------------------------------- cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] ----------------+---------------------------------------------------------------- age85 | -.3347988 .1198875 -2.79 0.005 -.5697741 -.0998235 grip9 | .6178929 .1480794 4.17 0.000 .3276625 .9081232 sexwm | 2.711324 1.874069 1.45 0.148 -.9617833 6.384431 demfn | 5.891631 1.277761 4.61 0.000 3.387266 8.395997 demfc | -13.9542 2.238917 -6.23 0.000 -18.3424 -9.566002 | c.age85#c.grip9 | .1221516 .0403529 3.03 0.002 .0430614 .2012418 | c.sexwm#c.demfn | .16427 2.070475 0.08 0.937 -3.893787 4.222327 | c.sexwm#c.demfc | 8.03937 3.415165 2.35 0.019 1.34577 14.73297 | _cons | 20.30292 1.118633 18.15 0.000 18.11044 22.4954 ---------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ var(Residual) | 85.97242 5.184332 76.38881 96.75836 ------------------------------------------------------------------------------

. estat ic, n(550),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 550 . -1998.704 10 4017.408 4060.507 ----------------------------------------------------------------------------- Note: N=550 used in calculating BIC

. . display as result "Eq 2.16: Adding Sex by Dementia Interaction" Eq 2.16: Adding Sex by Dementia Interaction

. display as result "Sex (0=Men), Dementia (0=Current)" Sex (0=Men), Dementia (0=Current)

. mixed cognition c.age85 c.grip9 c.sexmw c.demcn c.demcf /// > c.age85#c.grip9 c.sexmw#c.demcn c.sexmw#c.demcf, /// > || personid: , noconstant variance reml covariance(unstructured), Note: all random-effects equations are empty; model is linear regression

Mixed-effects REML regression Number of obs = 550

Wald chi2(8) = 230.14 Log restricted-likelihood = -1998.7039 Prob > chi2 = 0.0000

--------------------------------------------------------------------------------- cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] ----------------+---------------------------------------------------------------- age85 | -.3347988 .1198875 -2.79 0.005 -.5697741 -.0998235 grip9 | .6178929 .1480794 4.17 0.000 .3276625 .9081232 sexmw | -10.75069 2.899323 -3.71 0.000 -16.43326 -5.068125 demcn | 11.97073 2.244954 5.33 0.000 7.570702 16.37076 demcf | 5.914829 2.586762 2.29 0.022 .8448679 10.98479 | c.age85#c.grip9 | .1221516 .0403529 3.03 0.002 .0430614 .2012418 | c.sexmw#c.demcn | 7.8751 3.024536 2.60 0.009 1.947117 13.80308 | c.sexmw#c.demcf | 8.03937 3.415165 2.35 0.019 1.34577 14.73297 | _cons | 17.09942 2.140218 7.99 0.000 12.90467 21.29417 ---------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ var(Residual) | 85.97242 5.184332 76.38881 96.75836 ------------------------------------------------------------------------------

. estat ic, n(550),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 550 . -1998.704 10 4017.408 4060.507 ----------------------------------------------------------------------------- Note: N=550 used in calculating BIC

. . display as result "Eq 2.16: Adding Sex by Dementia Interaction" Eq 2.16: Adding Sex by Dementia Interaction

. display as result "Sex (0=Women), Dementia (0=Current)" Sex (0=Women), Dementia (0=Current)

. mixed cognition c.age85 c.grip9 c.sexwm c.demcn c.demcf /// > c.age85#c.grip9 c.sexwm#c.demcn c.sexwm#c.demcf, /// > || personid: , noconstant variance reml covariance(unstructured), Note: all random-effects equations are empty; model is linear regression

Mixed-effects REML regression Number of obs = 550

Wald chi2(8) = 230.14 Log restricted-likelihood = -1998.7039 Prob > chi2 = 0.0000

--------------------------------------------------------------------------------- cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] ----------------+---------------------------------------------------------------- age85 | -.3347988 .1198875 -2.79 0.005 -.5697741 -.0998235 grip9 | .6178929 .1480794 4.17 0.000 .3276625 .9081232 sexwm | 10.75069 2.899323 3.71 0.000 5.068125 16.43326 demcn | 19.84583 2.028583 9.78 0.000 15.86988 23.82178 demcf | 13.9542 2.238917 6.23 0.000 9.566002 18.3424 | c.age85#c.grip9 | .1221516 .0403529 3.03 0.002 .0430614 .2012418 | c.sexwm#c.demcn | -7.8751 3.024536 -2.60 0.009 -13.80308 -1.947117 | c.sexwm#c.demcf | -8.03937 3.415165 -2.35 0.019 -14.73297 -1.34577 | _cons | 6.348722 1.94788 3.26 0.001 2.530947 10.1665 ---------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ var(Residual) | 85.97242 5.184332 76.38881 96.75836 ------------------------------------------------------------------------------

. estat ic, n(550),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 550 . -1998.704 10 4017.408 4060.507 ----------------------------------------------------------------------------- Note: N=550 used in calculating BIC

. . display as result "Eq 2.16: Adding Sex by Dementia Interaction" Eq 2.16: Adding Sex by Dementia Interaction

. display as result "Categorical Sex and Dementia" Categorical Sex and Dementia

. mixed cognition c.age85 c.grip9 i.sexmw i.demgroup /// > c.age85#c.grip9 i.sexmw#i.demgroup, /// > || personid: , noconstant variance reml covariance(unstructured), Note: all random-effects equations are empty; model is linear regression

Mixed-effects REML regression Number of obs = 550

Wald chi2(8) = 230.14 Log restricted-likelihood = -1998.7039 Prob > chi2 = 0.0000

--------------------------------------------------------------------------------- cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] ----------------+---------------------------------------------------------------- age85 | -.3347988 .1198875 -2.79 0.005 -.5697741 -.0998235 grip9 | .6178929 .1480794 4.17 0.000 .3276625 .9081232 1.sexmw | -2.875594 1.011237 -2.84 0.004 -4.857583 -.8936056 | demgroup | 2 | -6.055901 1.635126 -3.70 0.000 -9.26069 -2.851113 3 | -11.97073 2.244954 -5.33 0.000 -16.37076 -7.570702 | c.age85#c.grip9 | .1221516 .0403529 3.03 0.002 .0430614 .2012418 | sexmw#demgroup | 1 2 | .16427 2.070475 0.08 0.937 -3.893787 4.222327 1 3 | -7.8751 3.024536 -2.60 0.009 -13.80308 -1.947117 | _cons | 29.07015 .7484992 38.84 0.000 27.60311 30.53718 ---------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ var(Residual) | 85.97242 5.184332 76.38881 96.75836 ------------------------------------------------------------------------------

. estat ic, n(550),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 550 . -1998.704 10 4017.408 4060.507 ----------------------------------------------------------------------------- Note: N=550 used in calculating BIC

. contrast i.sexmw#i.demgroup,

Contrasts of marginal linear predictions

Margins : asbalanced

-------------------------------------------------- | df chi2 P>chi2 ---------------+---------------------------------- cognition | sexmw#demgroup | 2 6.98 0.0304 --------------------------------------------------

. margins i.sexmw#i.demgroup, at(c.age85=0 c.grip9=0)

Adjusted predictions Number of obs = 550

Expression : Linear prediction, fixed portion, predict() at : age85 = 0 grip9 = 0

-------------------------------------------------------------------------------- | Delta-method | Margin Std. Err. z P>|z| [95% Conf. Interval] ---------------+---------------------------------------------------------------- sexmw#demgroup | 0 1 | 29.07015 .7484992 38.84 0.000 27.60311 30.53718 0 2 | 23.01424 1.49276 15.42 0.000 20.08849 25.94 0 3 | 17.09942 2.140218 7.99 0.000 12.90467 21.29417 1 1 | 26.19455 .638834 41.00 0.000 24.94246 27.44664 1 2 | 20.30292 1.118633 18.15 0.000 18.11044 22.4954 1 3 | 6.348722 1.94788 3.26 0.001 2.530947 10.1665 --------------------------------------------------------------------------------

. margins i.sexmw#i.demgroup, pwcompare(pveffects)

Pairwise comparisons of predictive margins

Expression : Linear prediction, fixed portion, predict()

-------------------------------------------------------- | Delta-method Unadjusted | Contrast Std. Err. z P>|z| ----------------+--------------------------------------- sexmw#demgroup | (0 2) vs (0 1) | -6.055901 1.635126 -3.70 0.000 (0 3) vs (0 1) | -11.97073 2.244954 -5.33 0.000 (1 1) vs (0 1) | -2.875594 1.011237 -2.84 0.004 (1 2) vs (0 1) | -8.767226 1.352249 -6.48 0.000 (1 3) vs (0 1) | -22.72142 2.098109 -10.83 0.000 (0 3) vs (0 2) | -5.914829 2.586762 -2.29 0.022 (1 1) vs (0 2) | 3.180307 1.650939 1.93 0.054 (1 2) vs (0 2) | -2.711324 1.874069 -1.45 0.148 (1 3) vs (0 2) | -16.66552 2.472402 -6.74 0.000 (1 1) vs (0 3) | 9.095136 2.243604 4.05 0.000 (1 2) vs (0 3) | 3.203505 2.417887 1.32 0.185 (1 3) vs (0 3) | -10.75069 2.899323 -3.71 0.000 (1 2) vs (1 1) | -5.891631 1.277761 -4.61 0.000 (1 3) vs (1 1) | -19.84583 2.028583 -9.78 0.000 (1 3) vs (1 2) | -13.9542 2.238917 -6.23 0.000 --------------------------------------------------------

. margins i.sexmw@i.demgroup, at(c.age85=0 c.grip9=0)

Contrasts of adjusted predictions

Expression : Linear prediction, fixed portion, predict() at : age85 = 0 grip9 = 0

-------------------------------------------------- | df chi2 P>chi2 ---------------+---------------------------------- sexmw@demgroup | 1 | 1 8.09 0.0045 2 | 1 2.09 0.1480 3 | 1 13.75 0.0002 Joint | 3 22.29 0.0001 --------------------------------------------------

. margins i.demgroup@i.sexmw, at(c.age85=0 c.grip9=0)

Contrasts of adjusted predictions

Expression : Linear prediction, fixed portion, predict() at : age85 = 0 grip9 = 0

-------------------------------------------------- | df chi2 P>chi2 ---------------+---------------------------------- demgroup@sexmw | 0 | 2 37.38 0.0000 1 | 2 106.31 0.0000 Joint | 4 143.63 0.0000 --------------------------------------------------

. * Sex by None-Future Interaction . contrast {i.sexmw#i.demgroup -1 1 0 1 -1 0}

Contrasts of marginal linear predictions

Margins : asbalanced

-------------------------------------------------- | df chi2 P>chi2 ---------------+---------------------------------- cognition | sexmw#demgroup | 1 0.01 0.9368 --------------------------------------------------

---------------------------------------------------------------- | Contrast Std. Err. [95% Conf. Interval] ---------------+------------------------------------------------ cognition | sexmw#demgroup | (1) (1) | -.16427 2.070475 -4.222327 3.893787 ----------------------------------------------------------------

. * Sex by None-Current Interaction . contrast {i.sexmw#i.demgroup -1 0 1 1 0 -1}

Contrasts of marginal linear predictions

Margins : asbalanced

-------------------------------------------------- | df chi2 P>chi2 ---------------+---------------------------------- cognition | sexmw#demgroup | 1 6.78 0.0092 --------------------------------------------------

---------------------------------------------------------------- | Contrast Std. Err. [95% Conf. Interval] ---------------+------------------------------------------------ cognition | sexmw#demgroup | (1) (1) | 7.8751 3.024536 1.947117 13.80308 ----------------------------------------------------------------

. * Sex by Future-Current Interaction . contrast {i.sexmw#i.demgroup 0 -1 1 0 1 -1}

Contrasts of marginal linear predictions

Margins : asbalanced

-------------------------------------------------- | df chi2 P>chi2 ---------------+---------------------------------- cognition | sexmw#demgroup | 1 5.54 0.0186 --------------------------------------------------

---------------------------------------------------------------- | Contrast Std. Err. [95% Conf. Interval] ---------------+------------------------------------------------ cognition | sexmw#demgroup | (1) (1) | 8.03937 3.415165 1.34577 14.73297 ----------------------------------------------------------------

. . display as result "Eq 2.17: Adding Sex by Age and Sex by Grip Interactions" Eq 2.17: Adding Sex by Age and Sex by Grip Interactions

. display as result "Age (0=85), Grip (0=9), Sex (0=Men), Dementia (0=None)" Age (0=85), Grip (0=9), Sex (0=Men), Dementia (0=None)

. mixed cognition c.age85 c.grip9 c.sexmw c.demnf c.demnc /// > c.age85#c.grip9 c.sexmw#c.demnf c.sexmw#c.demnc /// > c.age85#c.sexmw c.grip9#c.sexmw, /// > || personid: , noconstant variance reml covariance(unstructured), Note: all random-effects equations are empty; model is linear regression

Mixed-effects REML regression Number of obs = 550

Wald chi2(10) = 229.89 Log restricted-likelihood = -1999.1473 Prob > chi2 = 0.0000

--------------------------------------------------------------------------------- cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] ----------------+---------------------------------------------------------------- age85 | -.3839178 .1947241 -1.97 0.049 -.7655699 -.0022656 grip9 | .7231028 .2366022 3.06 0.002 .259371 1.186835 sexmw | -2.755087 1.029657 -2.68 0.007 -4.773178 -.7369964 demnf | -6.083209 1.639851 -3.71 0.000 -9.297257 -2.86916 demnc | -11.94668 2.249412 -5.31 0.000 -16.35545 -7.537913 | c.age85#c.grip9 | .12949 .0459727 2.82 0.005 .0393852 .2195948 | c.sexmw#c.demnf | .226977 2.08044 0.11 0.913 -3.85061 4.304564 | c.sexmw#c.demnc | -7.889021 3.029297 -2.60 0.009 -13.82633 -1.951709 | c.age85#c.sexmw | .078838 .2744298 0.29 0.774 -.4590344 .6167104 | c.grip9#c.sexmw | -.1641393 .3042919 -0.54 0.590 -.7605405 .432262 | _cons | 28.90515 .7979554 36.22 0.000 27.34118 30.46911 ---------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ var(Residual) | 86.22341 5.199467 76.61182 97.04084 ------------------------------------------------------------------------------

. estat ic, n(550),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 550 . -1999.147 12 4022.295 4074.014 ----------------------------------------------------------------------------- Note: N=550 used in calculating BIC

. * Age for Men . lincom c.age85*1 + c.age85#c.sexmw*0

( 1) [cognition]age85 = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -.3839178 .1947241 -1.97 0.049 -.7655699 -.0022656 ------------------------------------------------------------------------------

. * Age for Women . lincom c.age85*1 + c.age85#c.sexmw*1

( 1) [cognition]age85 + [cognition]c.age85#c.sexmw = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -.3050798 .1709527 -1.78 0.074 -.640141 .0299814 ------------------------------------------------------------------------------

. * Grip for Men . lincom c.grip9*1 + c.grip9#c.sexmw*0

( 1) [cognition]grip9 = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | .7231028 .2366022 3.06 0.002 .259371 1.186835 ------------------------------------------------------------------------------

. * Grip for Women . lincom c.grip9*1 + c.grip9#c.sexmw*1

( 1) [cognition]grip9 + [cognition]c.grip9#c.sexmw = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | .5589636 .1919521 2.91 0.004 .1827444 .9351827 ------------------------------------------------------------------------------

. * Sex for None . lincom c.sexmw*1 + c.sexmw#c.demnf*0 + c.sexmw#c.demnc*0

( 1) [cognition]sexmw = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -2.755087 1.029657 -2.68 0.007 -4.773178 -.7369964 ------------------------------------------------------------------------------

. * Sex for Future . lincom c.sexmw*1 + c.sexmw#c.demnf*1 + c.sexmw#c.demnc*0

( 1) [cognition]sexmw + [cognition]c.sexmw#c.demnf = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -2.52811 1.901429 -1.33 0.184 -6.254842 1.198622 ------------------------------------------------------------------------------

. * Sex for Current . lincom c.sexmw*1 + c.sexmw#c.demnf*0 + c.sexmw#c.demnc*1

( 1) [cognition]sexmw + [cognition]c.sexmw#c.demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -10.64411 2.908215 -3.66 0.000 -16.3441 -4.944113 ------------------------------------------------------------------------------

. * Men: None vs Future . lincom c.demnf*1 + c.demnc*0 + c.sexmw#c.demnf*0 + c.sexmw#c.demnc*0

( 1) [cognition]demnf = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -6.083209 1.639851 -3.71 0.000 -9.297257 -2.86916 ------------------------------------------------------------------------------

. * Men: None vs Current . lincom c.demnf*0 + c.demnc*1 + c.sexmw#c.demnf*0 + c.sexmw#c.demnc*0

( 1) [cognition]demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -11.94668 2.249412 -5.31 0.000 -16.35545 -7.537913 ------------------------------------------------------------------------------

. * Men: Future vs Current . lincom c.demnf*-1 + c.demnc*1 + c.sexmw#c.demnf*0 + c.sexmw#c.demnc*0

( 1) - [cognition]demnf + [cognition]demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -5.863472 2.59177 -2.26 0.024 -10.94325 -.7836957 ------------------------------------------------------------------------------

. * Women: None vs Future . lincom c.demnf*1 + c.demnc*0 + c.sexmw#c.demnf*1 + c.sexmw#c.demnc*0

( 1) [cognition]demnf + [cognition]c.sexmw#c.demnf = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -5.856232 1.282329 -4.57 0.000 -8.36955 -3.342913 ------------------------------------------------------------------------------

. * Women: None vs Current . lincom c.demnf*0 + c.demnc*1 + c.sexmw#c.demnf*0 + c.sexmw#c.demnc*1

( 1) [cognition]demnc + [cognition]c.sexmw#c.demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -19.8357 2.031723 -9.76 0.000 -23.81781 -15.8536 ------------------------------------------------------------------------------

. * Women: Future vs Current . lincom c.demnf*-1 + c.demnc*1 + c.sexmw#c.demnf*-1 + c.sexmw#c.demnc*1

( 1) - [cognition]demnf + [cognition]demnc - [cognition]c.sexmw#c.demnf + [cognition]c.sexmw#c.demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -13.97947 2.244142 -6.23 0.000 -18.37791 -9.581033 ------------------------------------------------------------------------------

. * Sex by None vs Future . lincom c.demnf#c.sexmw*1 + c.demnc#c.sexmw*0

( 1) [cognition]c.sexmw#c.demnf = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | .226977 2.08044 0.11 0.913 -3.85061 4.304564 ------------------------------------------------------------------------------

. * Sex by None vs Current . lincom c.demnf#c.sexmw*0 + c.demnc#c.sexmw*1

( 1) [cognition]c.sexmw#c.demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -7.889021 3.029297 -2.60 0.009 -13.82633 -1.951709 ------------------------------------------------------------------------------

. * Sex by Future vs Current . lincom c.demnf#c.sexmw*-1 + c.demnc#c.sexmw*1

( 1) - [cognition]c.sexmw#c.demnf + [cognition]c.sexmw#c.demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -8.115998 3.423605 -2.37 0.018 -14.82614 -1.405856 ------------------------------------------------------------------------------

. . display as result "Eq 2.18: Adding Sex by Age by Grip Three-Way Interaction" Eq 2.18: Adding Sex by Age by Grip Three-Way Interaction

. display as result "Age (0=85), Grip (0=9), Sex (0=Men), Dementia (0=None)" Age (0=85), Grip (0=9), Sex (0=Men), Dementia (0=None)

. mixed cognition c.age85 c.grip9 c.sexmw c.demnf c.demnc /// > c.age85#c.grip9 c.sexmw#c.demnf c.sexmw#c.demnc /// > c.age85#c.sexmw c.grip9#c.sexmw c.age85#c.grip9#c.sexmw, /// > || personid: , noconstant variance reml covariance(unstructured), Note: all random-effects equations are empty; model is linear regression

Mixed-effects REML regression Number of obs = 550

Wald chi2(11) = 233.40 Log restricted-likelihood = -1999.2019 Prob > chi2 = 0.0000

----------------------------------------------------------------------------------------- cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] ------------------------+---------------------------------------------------------------- age85 | -.498287 .2062505 -2.42 0.016 -.9025305 -.0940436 grip9 | .739275 .2364183 3.13 0.002 .2759035 1.202646 sexmw | -2.97349 1.036365 -2.87 0.004 -5.004728 -.9422511 demnf | -6.165427 1.637934 -3.76 0.000 -9.375719 -2.955136 demnc | -11.78371 2.2479 -5.24 0.000 -16.18952 -7.377911 | c.age85#c.grip9 | .2299577 .0759486 3.03 0.002 .0811011 .3788143 | c.sexmw#c.demnf | .3968833 2.079577 0.19 0.849 -3.679013 4.47278 | c.sexmw#c.demnc | -8.145702 3.028321 -2.69 0.007 -14.0811 -2.210302 | c.age85#c.sexmw | .0950725 .2741581 0.35 0.729 -.4422675 .6324124 | c.grip9#c.sexmw | -.2000738 .3045673 -0.66 0.511 -.7970147 .396867 | c.age85#c.grip9#c.sexmw | -.1582701 .0953248 -1.66 0.097 -.3451034 .0285631 | _cons | 28.95584 .7972432 36.32 0.000 27.39328 30.51841 -----------------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ var(Residual) | 85.94331 5.182576 76.36295 96.7256 ------------------------------------------------------------------------------

. estat ic, n(550),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 550 . -1999.202 13 4024.404 4080.433 ----------------------------------------------------------------------------- Note: N=550 used in calculating BIC

. * Age for Men . lincom c.age85*1 + c.age85#c.sexmw*0

( 1) [cognition]age85 = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -.498287 .2062505 -2.42 0.016 -.9025305 -.0940436 ------------------------------------------------------------------------------

. * Age for Women . lincom c.age85*1 + c.age85#c.sexmw*1

( 1) [cognition]age85 + [cognition]c.age85#c.sexmw = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -.4032146 .1806195 -2.23 0.026 -.7572222 -.0492069 ------------------------------------------------------------------------------

. * Grip for Men . lincom c.grip9*1 + c.grip9#c.sexmw*0

( 1) [cognition]grip9 = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | .739275 .2364183 3.13 0.002 .2759035 1.202646 ------------------------------------------------------------------------------

. * Grip for Women . lincom c.grip9*1 + c.grip9#c.sexmw*1

( 1) [cognition]grip9 + [cognition]c.grip9#c.sexmw = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | .5392011 .1920093 2.81 0.005 .1628697 .9155325 ------------------------------------------------------------------------------

. * Sex for None . lincom c.sexmw*1 + c.sexmw#c.demnf*0 + c.sexmw#c.demnc*0

( 1) [cognition]sexmw = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -2.97349 1.036365 -2.87 0.004 -5.004728 -.9422511 ------------------------------------------------------------------------------

. * Sex for Future . lincom c.sexmw*1 + c.sexmw#c.demnf*1 + c.sexmw#c.demnc*0

( 1) [cognition]sexmw + [cognition]c.sexmw#c.demnf = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -2.576606 1.898562 -1.36 0.175 -6.29772 1.144508 ------------------------------------------------------------------------------

. * Sex for Current . lincom c.sexmw*1 + c.sexmw#c.demnf*0 + c.sexmw#c.demnc*1

( 1) [cognition]sexmw + [cognition]c.sexmw#c.demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -11.11919 2.917552 -3.81 0.000 -16.83749 -5.400894 ------------------------------------------------------------------------------

. * Men: None vs Future . lincom c.demnf*1 + c.demnc*0 + c.sexmw#c.demnf*0 + sexmw#c.demnc*0

( 1) [cognition]demnf = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -6.165427 1.637934 -3.76 0.000 -9.375719 -2.955136 ------------------------------------------------------------------------------

. * Men: None vs Current . lincom c.demnf*0 + c.demnc*1 + c.sexmw#c.demnf*0 + sexmw#c.demnc*0

( 1) [cognition]demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -11.78371 2.2479 -5.24 0.000 -16.18952 -7.377911 ------------------------------------------------------------------------------

. * Men: Future vs Current . lincom c.demnf*-1 + c.demnc*1 + c.sexmw#c.demnf*0 + sexmw#c.demnc*0

( 1) - [cognition]demnf + [cognition]demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -5.618286 2.591767 -2.17 0.030 -10.69806 -.5385151 ------------------------------------------------------------------------------

. * Women: None vs Future . lincom c.demnf*1 + c.demnc*0 + c.sexmw#c.demnf*1 + sexmw#c.demnc*0

( 1) [cognition]demnf + [cognition]c.sexmw#c.demnf = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -5.768544 1.281333 -4.50 0.000 -8.279911 -3.257177 ------------------------------------------------------------------------------

. * Women: None vs Current . lincom c.demnf*0 + c.demnc*1 + c.sexmw#c.demnf*0 + sexmw#c.demnc*1

( 1) [cognition]demnc + [cognition]c.sexmw#c.demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -19.92942 2.029206 -9.82 0.000 -23.90659 -15.95225 ------------------------------------------------------------------------------

. * Women: Future vs Current . lincom c.demnf*-1 + c.demnc*1 + c.sexmw#c.demnf*-1 + sexmw#c.demnc*1

( 1) - [cognition]demnf + [cognition]demnc - [cognition]c.sexmw#c.demnf + [cognition]c.sexmw#c.demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -14.16087 2.243156 -6.31 0.000 -18.55738 -9.764366 ------------------------------------------------------------------------------

. * Sex by None vs Future . lincom c.demnf#c.sexmw*1 + c.demnc#c.sexmw*0

( 1) [cognition]c.sexmw#c.demnf = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | .3968833 2.079577 0.19 0.849 -3.679013 4.47278 ------------------------------------------------------------------------------

. * Sex by None vs Current . lincom c.demnf#c.sexmw*0 + c.demnc#c.sexmw*1

( 1) [cognition]c.sexmw#c.demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -8.145702 3.028321 -2.69 0.007 -14.0811 -2.210302 ------------------------------------------------------------------------------

. * Sex by Future vs Current . lincom c.demnf#c.sexmw*-1 + c.demnc#c.sexmw*1

( 1) - [cognition]c.sexmw#c.demnf + [cognition]c.sexmw#c.demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -8.542585 3.427683 -2.49 0.013 -15.26072 -1.824451 ------------------------------------------------------------------------------

. * Age by Grip for Men . lincom c.age85#c.grip9*1 + c.age85#c.grip9#c.sexmw*0

( 1) [cognition]c.age85#c.grip9 = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | .2299577 .0759486 3.03 0.002 .0811011 .3788143 ------------------------------------------------------------------------------

. * Age by Grip for Women . lincom c.age85#c.grip9*1 + c.age85#c.grip9#c.sexmw*1

( 1) [cognition]c.age85#c.grip9 + [cognition]c.age85#c.grip9#c.sexmw = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | .0716876 .0576075 1.24 0.213 -.0412211 .1845963 ------------------------------------------------------------------------------

. margins, at (c.age85=(-5(5)5) c.grip9=(-3(3)3) c.sexmw=(0(1)1) c.demnf=0 c.demnc=0) vsquish,

Adjusted predictions Number of obs = 550

Expression : Linear prediction, fixed portion, predict() 1._at : age85 = -5 grip9 = -3 sexmw = 0 demnf = 0 demnc = 0 2._at : age85 = -5 grip9 = -3 sexmw = 1 demnf = 0 demnc = 0 3._at : age85 = -5 grip9 = 0 sexmw = 0 demnf = 0 demnc = 0 4._at : age85 = -5 grip9 = 0 sexmw = 1 demnf = 0 demnc = 0 5._at : age85 = -5 grip9 = 3 sexmw = 0 demnf = 0 demnc = 0 6._at : age85 = -5 grip9 = 3 sexmw = 1 demnf = 0 demnc = 0 7._at : age85 = 0 grip9 = -3 sexmw = 0 demnf = 0 demnc = 0 8._at : age85 = 0 grip9 = -3 sexmw = 1 demnf = 0 demnc = 0 9._at : age85 = 0 grip9 = 0 sexmw = 0 demnf = 0 demnc = 0 10._at : age85 = 0 grip9 = 0 sexmw = 1 demnf = 0 demnc = 0 11._at : age85 = 0 grip9 = 3 sexmw = 0 demnf = 0 demnc = 0 12._at : age85 = 0 grip9 = 3 sexmw = 1 demnf = 0 demnc = 0 13._at : age85 = 5 grip9 = -3 sexmw = 0 demnf = 0 demnc = 0 14._at : age85 = 5 grip9 = -3 sexmw = 1 demnf = 0 demnc = 0 15._at : age85 = 5 grip9 = 0 sexmw = 0 demnf = 0 demnc = 0 16._at : age85 = 5 grip9 = 0 sexmw = 1 demnf = 0 demnc = 0 17._at : age85 = 5 grip9 = 3 sexmw = 0 demnf = 0 demnc = 0 18._at : age85 = 5 grip9 = 3 sexmw = 1 demnf = 0 demnc = 0

------------------------------------------------------------------------------ | Delta-method | Margin Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _at | 1 | 32.67882 2.235223 14.62 0.000 28.29786 37.05978 2 | 27.45614 1.219373 22.52 0.000 25.06621 29.84606 3 | 31.44728 1.285491 24.46 0.000 28.92776 33.96679 4 | 27.99843 1.019082 27.47 0.000 26.00106 29.99579 5 | 30.21574 1.320378 22.88 0.000 27.62784 32.80363 6 | 28.54072 1.594664 17.90 0.000 25.41523 31.6662 7 | 26.73802 1.273557 20.99 0.000 24.24189 29.23414 8 | 24.36475 .7254959 33.58 0.000 22.9428 25.7867 9 | 28.95584 .7972432 36.32 0.000 27.39328 30.51841 10 | 25.98235 .6621603 39.24 0.000 24.68454 27.28016 11 | 31.17367 .809525 38.51 0.000 29.58703 32.76031 12 | 27.59996 1.007067 27.41 0.000 25.62614 29.57377 13 | 20.79722 2.222661 9.36 0.000 16.44088 25.15355 14 | 21.27336 1.000048 21.27 0.000 19.3133 23.23342 15 | 26.46441 1.321237 20.03 0.000 23.87483 29.05399 16 | 23.96628 1.212252 19.77 0.000 21.59031 26.34225 17 | 32.1316 1.52316 21.10 0.000 29.14626 35.11694 18 | 26.6592 2.073703 12.86 0.000 22.59481 30.72358 ------------------------------------------------------------------------------

. . display as result "Eq 2.13: Final Reported Model" Eq 2.13: Final Reported Model

. display as result "Age (0=85), Grip (0=9), Sex (0=Men), Dementia (0=None)" Age (0=85), Grip (0=9), Sex (0=Men), Dementia (0=None)

. mixed cognition c.age85 c.grip9 c.sexmw c.demnf c.demnc /// > c.age85#c.grip9 c.sexmw#c.demnf c.sexmw#c.demnc, /// > || personid: , noconstant variance reml covariance(unstructured), Note: all random-effects equations are empty; model is linear regression

Mixed-effects REML regression Number of obs = 550

Wald chi2(8) = 230.14 Log restricted-likelihood = -1998.7039 Prob > chi2 = 0.0000

--------------------------------------------------------------------------------- cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] ----------------+---------------------------------------------------------------- age85 | -.3347988 .1198875 -2.79 0.005 -.5697741 -.0998235 grip9 | .6178929 .1480794 4.17 0.000 .3276625 .9081232 sexmw | -2.875594 1.011237 -2.84 0.004 -4.857583 -.8936056 demnf | -6.055901 1.635126 -3.70 0.000 -9.26069 -2.851113 demnc | -11.97073 2.244954 -5.33 0.000 -16.37076 -7.570702 | c.age85#c.grip9 | .1221516 .0403529 3.03 0.002 .0430614 .2012418 | c.sexmw#c.demnf | .16427 2.070475 0.08 0.937 -3.893787 4.222327 | c.sexmw#c.demnc | -7.8751 3.024536 -2.60 0.009 -13.80308 -1.947117 | _cons | 29.07015 .7484992 38.84 0.000 27.60311 30.53718 ---------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ var(Residual) | 85.97242 5.184332 76.38881 96.75836 ------------------------------------------------------------------------------

. estat ic, n(550),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 550 . -1998.704 10 4017.408 4060.507 ----------------------------------------------------------------------------- Note: N=550 used in calculating BIC

. * Model R2 Test . test (c.age85=0) (c.grip9=0) (c.sexmw=0) (c.demnf=0) (c.demnc=0) (c.age85#c.grip9=0) (c.sexmw#c.demnf=0) (c.sexmw#c.demnc=0)

( 1) [cognition]age85 = 0 ( 2) [cognition]grip9 = 0 ( 3) [cognition]sexmw = 0 ( 4) [cognition]demnf = 0 ( 5) [cognition]demnc = 0 ( 6) [cognition]c.age85#c.grip9 = 0 ( 7) [cognition]c.sexmw#c.demnf = 0 ( 8) [cognition]c.sexmw#c.demnc = 0

chi2( 8) = 230.14 Prob > chi2 = 0.0000

. * Omnibus Dementia*Sex Interaction Test . test (c.sexmw#c.demnf=0) (c.sexmw#c.demnc=0)

( 1) [cognition]c.sexmw#c.demnf = 0 ( 2) [cognition]c.sexmw#c.demnc = 0

chi2( 2) = 6.98 Prob > chi2 = 0.0304

. * Sex Difference for No Dementia . lincom c.sexmw*1 + c.sexmw#c.demnf*0 + c.sexmw#c.demnc*0

( 1) [cognition]sexmw = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -2.875594 1.011237 -2.84 0.004 -4.857583 -.8936056 ------------------------------------------------------------------------------

. * Sex Difference for Future Dementia . lincom c.sexmw*1 + c.sexmw#c.demnf*1 + c.sexmw#c.demnc*0

( 1) [cognition]sexmw + [cognition]c.sexmw#c.demnf = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -2.711324 1.874069 -1.45 0.148 -6.384431 .9617833 ------------------------------------------------------------------------------

. * Sex Difference for Current Dementia . lincom c.sexmw*1 + c.sexmw#c.demnf*0 + c.sexmw#c.demnc*1

( 1) [cognition]sexmw + [cognition]c.sexmw#c.demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -10.75069 2.899323 -3.71 0.000 -16.43326 -5.068125 ------------------------------------------------------------------------------

. * None-Future Difference for Men . lincom c.demnf*1 + c.sexmw#c.demnf*0

( 1) [cognition]demnf = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -6.055901 1.635126 -3.70 0.000 -9.26069 -2.851113 ------------------------------------------------------------------------------

. * None-Future Difference for Women . lincom c.demnf*1 + c.sexmw#c.demnf*1

( 1) [cognition]demnf + [cognition]c.sexmw#c.demnf = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -5.891631 1.277761 -4.61 0.000 -8.395997 -3.387266 ------------------------------------------------------------------------------

. * None-Current Difference for Men . lincom c.demnc*1 + c.sexmw#c.demnc*0

( 1) [cognition]demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -11.97073 2.244954 -5.33 0.000 -16.37076 -7.570702 ------------------------------------------------------------------------------

. * None-Current Difference for Women . lincom c.demnc*1 + c.sexmw#c.demnc*1

( 1) [cognition]demnc + [cognition]c.sexmw#c.demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -19.84583 2.028583 -9.78 0.000 -23.82178 -15.86988 ------------------------------------------------------------------------------

. * Future-Current Difference for Men . lincom c.demnf*-1 + c.demnc*1 + c.sexmw#c.demnf*0 + c.sexmw#c.demnc*0

( 1) - [cognition]demnf + [cognition]demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -5.914829 2.586762 -2.29 0.022 -10.98479 -.8448679 ------------------------------------------------------------------------------

. * Future-Current Difference for Women . lincom c.demnf*-1 + c.demnc*1 + c.sexmw#c.demnf*-1 + c.sexmw#c.demnc*1

( 1) - [cognition]demnf + [cognition]demnc - [cognition]c.sexmw#c.demnf + [cognition]c.sexmw#c.demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -13.9542 2.238917 -6.23 0.000 -18.3424 -9.566002 ------------------------------------------------------------------------------

. * None-Future Sex Difference . lincom c.sexmw#c.demnf*1

( 1) [cognition]c.sexmw#c.demnf = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | .16427 2.070475 0.08 0.937 -3.893787 4.222327 ------------------------------------------------------------------------------

. * None-Current Sex Difference . lincom c.sexmw#c.demnc*1

( 1) [cognition]c.sexmw#c.demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -7.8751 3.024536 -2.60 0.009 -13.80308 -1.947117 ------------------------------------------------------------------------------

. * Future-Current Sex Difference . lincom c.sexmw#c.demnf*-1 + c.sexmw#c.demnc*1

( 1) - [cognition]c.sexmw#c.demnf + [cognition]c.sexmw#c.demnc = 0

------------------------------------------------------------------------------ cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -8.03937 3.415165 -2.35 0.019 -14.73297 -1.34577 ------------------------------------------------------------------------------

. . display as result "Eq 2.13: Final Reported Model" Eq 2.13: Final Reported Model

. display as result "Categorical Variables for Sex and Dementia" Categorical Variables for Sex and Dementia

. mixed cognition c.age85 c.grip9 i.sexmw i.demgroup /// > c.age85#c.grip9 i.sexmw#i.demgroup, /// > || personid: , noconstant variance reml covariance(unstructured), Note: all random-effects equations are empty; model is linear regression

Mixed-effects REML regression Number of obs = 550

Wald chi2(8) = 230.14 Log restricted-likelihood = -1998.7039 Prob > chi2 = 0.0000

--------------------------------------------------------------------------------- cognition | Coef. Std. Err. z P>|z| [95% Conf. Interval] ----------------+---------------------------------------------------------------- age85 | -.3347988 .1198875 -2.79 0.005 -.5697741 -.0998235 grip9 | .6178929 .1480794 4.17 0.000 .3276625 .9081232 1.sexmw | -2.875594 1.011237 -2.84 0.004 -4.857583 -.8936056 | demgroup | 2 | -6.055901 1.635126 -3.70 0.000 -9.26069 -2.851113 3 | -11.97073 2.244954 -5.33 0.000 -16.37076 -7.570702 | c.age85#c.grip9 | .1221516 .0403529 3.03 0.002 .0430614 .2012418 | sexmw#demgroup | 1 2 | .16427 2.070475 0.08 0.937 -3.893787 4.222327 1 3 | -7.8751 3.024536 -2.60 0.009 -13.80308 -1.947117 | _cons | 29.07015 .7484992 38.84 0.000 27.60311 30.53718 ---------------------------------------------------------------------------------

------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ var(Residual) | 85.97242 5.184332 76.38881 96.75836 ------------------------------------------------------------------------------

. estat ic, n(550),

Akaike's information criterion and Bayesian information criterion

----------------------------------------------------------------------------- Model | Obs ll(null) ll(model) df AIC BIC -------------+--------------------------------------------------------------- . | 550 . -1998.704 10 4017.408 4060.507 ----------------------------------------------------------------------------- Note: N=550 used in calculating BIC

. contrast i.sexmw#i.demgroup,

Contrasts of marginal linear predictions

Margins : asbalanced

-------------------------------------------------- | df chi2 P>chi2 ---------------+---------------------------------- cognition | sexmw#demgroup | 2 6.98 0.0304 --------------------------------------------------

. margins i.sexmw#i.demgroup, at(c.age85=0 c.grip9=0)

Adjusted predictions Number of obs = 550

Expression : Linear prediction, fixed portion, predict() at : age85 = 0 grip9 = 0

-------------------------------------------------------------------------------- | Delta-method | Margin Std. Err. z P>|z| [95% Conf. Interval] ---------------+---------------------------------------------------------------- sexmw#demgroup | 0 1 | 29.07015 .7484992 38.84 0.000 27.60311 30.53718 0 2 | 23.01424 1.49276 15.42 0.000 20.08849 25.94 0 3 | 17.09942 2.140218 7.99 0.000 12.90467 21.29417 1 1 | 26.19455 .638834 41.00 0.000 24.94246 27.44664 1 2 | 20.30292 1.118633 18.15 0.000 18.11044 22.4954 1 3 | 6.348722 1.94788 3.26 0.001 2.530947 10.1665 --------------------------------------------------------------------------------

. margins i.sexmw#i.demgroup, pwcompare(pveffects)

Pairwise comparisons of predictive margins

Expression : Linear prediction, fixed portion, predict()

-------------------------------------------------------- | Delta-method Unadjusted | Contrast Std. Err. z P>|z| ----------------+--------------------------------------- sexmw#demgroup | (0 2) vs (0 1) | -6.055901 1.635126 -3.70 0.000 (0 3) vs (0 1) | -11.97073 2.244954 -5.33 0.000 (1 1) vs (0 1) | -2.875594 1.011237 -2.84 0.004 (1 2) vs (0 1) | -8.767226 1.352249 -6.48 0.000 (1 3) vs (0 1) | -22.72142 2.098109 -10.83 0.000 (0 3) vs (0 2) | -5.914829 2.586762 -2.29 0.022 (1 1) vs (0 2) | 3.180307 1.650939 1.93 0.054 (1 2) vs (0 2) | -2.711324 1.874069 -1.45 0.148 (1 3) vs (0 2) | -16.66552 2.472402 -6.74 0.000 (1 1) vs (0 3) | 9.095136 2.243604 4.05 0.000 (1 2) vs (0 3) | 3.203505 2.417887 1.32 0.185 (1 3) vs (0 3) | -10.75069 2.899323 -3.71 0.000 (1 2) vs (1 1) | -5.891631 1.277761 -4.61 0.000 (1 3) vs (1 1) | -19.84583 2.028583 -9.78 0.000 (1 3) vs (1 2) | -13.9542 2.238917 -6.23 0.000 --------------------------------------------------------

. margins i.sexmw@i.demgroup, at(c.age85=0 c.grip9=0)

Contrasts of adjusted predictions

Expression : Linear prediction, fixed portion, predict() at : age85 = 0 grip9 = 0

-------------------------------------------------- | df chi2 P>chi2 ---------------+---------------------------------- sexmw@demgroup | 1 | 1 8.09 0.0045 2 | 1 2.09 0.1480 3 | 1 13.75 0.0002 Joint | 3 22.29 0.0001 --------------------------------------------------

. margins i.demgroup@i.sexmw, at(c.age85=0 c.grip9=0)

Contrasts of adjusted predictions

Expression : Linear prediction, fixed portion, predict() at : age85 = 0 grip9 = 0

-------------------------------------------------- | df chi2 P>chi2 ---------------+---------------------------------- demgroup@sexmw | 0 | 2 37.38 0.0000 1 | 2 106.31 0.0000 Joint | 4 143.63 0.0000 --------------------------------------------------

. . ****** END CHAPTER 2 MODELS ****** . . * Close log . log close STATA_Chapter2 name: STATA_Chapter2 log: C:\Dropbox\PilesOfVariance\Chapter2\STATA\STATA_Chapter2_Output.smcl log type: smcl closed on: 3 Jan 2015, 14:33:21 ------------------------------------------------------------------------------------------------------------------------------------------------------