Hi all,
I am interested in whether (and how) my outcome variable Zadhdsev changes over time - I have 5 measurement points although not all individuals have data at all points. I am testing a series of models using mixed and have so far determined that a random linear model fits better than a fixed linear model for time, and that a quadratic term for time (time*time) is a significant predictor, as the rate of change decelerates over time. I am attempting to test whether a model with a random quadratic for time effect fits the data better, as I expect individuals to vary in their rate of deceleration in change.
When I attempt an lrtest to compare model fit of fixed quadratic vs random quadratic, Stata says the models are not nested. I also notice that standard errors and CIs are missing for all of my my random-effects parameters in the random quadratic model. I would be grateful for any assistance in understanding what has gone wrong.
In output below, TimeWeight is just the time variable and Time2 is this same variable, squared.
I am interested in whether (and how) my outcome variable Zadhdsev changes over time - I have 5 measurement points although not all individuals have data at all points. I am testing a series of models using mixed and have so far determined that a random linear model fits better than a fixed linear model for time, and that a quadratic term for time (time*time) is a significant predictor, as the rate of change decelerates over time. I am attempting to test whether a model with a random quadratic for time effect fits the data better, as I expect individuals to vary in their rate of deceleration in change.
When I attempt an lrtest to compare model fit of fixed quadratic vs random quadratic, Stata says the models are not nested. I also notice that standard errors and CIs are missing for all of my my random-effects parameters in the random quadratic model. I would be grateful for any assistance in understanding what has gone wrong.
In output below, TimeWeight is just the time variable and Time2 is this same variable, squared.
Code:
. ** now with fixed quadratic effect of time . . mixed Zadhdsev c.TimeWeight c.TimeWeight#c.TimeWeight, /// > || id: TimeWeight, variance reml covariance(unstructured) , Performing EM optimization: Performing gradient-based optimization: Iteration 0: log restricted-likelihood = -323.47526 Iteration 1: log restricted-likelihood = -321.68228 Iteration 2: log restricted-likelihood = -321.66631 Iteration 3: log restricted-likelihood = -321.66631 Computing standard errors: Mixed-effects REML regression Number of obs = 245 Group variable: id Number of groups = 94 Obs per group: min = 1 avg = 2.6 max = 4 Wald chi2(2) = 40.71 Log restricted-likelihood = -321.66631 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------------------- Zadhdsev | Coef. Std. Err. z P>|z| [95% Conf. Interval] --------------------------+---------------------------------------------------------------- TimeWeight | -.8046866 .1325707 -6.07 0.000 -1.06452 -.5448528 | c.TimeWeight#c.TimeWeight | .1769486 .038914 4.55 0.000 .1006786 .2532186 | _cons | .435337 .0740135 5.88 0.000 .2902732 .5804009 ------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ id: Unstructured | var(TimeWe~t) | .1192109 .0439804 .0578473 .2456682 var(_cons) | .0228074 .0224636 .0033091 .1571981 cov(TimeWe~t,_cons) | .052143 .0227641 .007526 .0967599 -----------------------------+------------------------------------------------ var(Residual) | .5197756 .0605104 .4137348 .6529948 ------------------------------------------------------------------------------ LR test vs. linear model: chi2(3) = 34.04 Prob > chi2 = 0.0000 Note: LR test is conservative and provided only for reference. . . estimates store fixedquadratic . . ** now with random quadratic effect of time . . mixed Zadhdsev c.TimeWeight c.Time#c.Time, /// > || id: TimeWeight Time2, variance reml covariance(unstructured), Performing EM optimization: Performing gradient-based optimization: Iteration 0: log restricted-likelihood = -303.8915 Iteration 1: log restricted-likelihood = -300.96267 Iteration 2: log restricted-likelihood = -300.85505 Iteration 3: log restricted-likelihood = -300.85228 Iteration 4: log restricted-likelihood = -300.85225 Iteration 5: log restricted-likelihood = -300.85225 Computing standard errors: Mixed-effects REML regression Number of obs = 245 Group variable: id Number of groups = 94 Obs per group: min = 1 avg = 2.6 max = 4 Wald chi2(2) = 53.64 Log restricted-likelihood = -300.85225 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------- Zadhdsev | Coef. Std. Err. z P>|z| [95% Conf. Interval] --------------+---------------------------------------------------------------- TimeWeight | -1.12187 .2856026 -3.93 0.000 -1.681641 -.5620993 | c.Time#c.Time | .1638921 .0611346 2.68 0.007 .0440704 .2837137 | _cons | .2819303 .0747625 3.77 0.000 .1353985 .4284622 ------------------------------------------------------------------------------- ------------------------------------------------------------------------------ Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ id: Unstructured | var(TimeWe~t) | 1.521076 . . . var(Time2) | .1975466 . . . var(_cons) | .0115113 . . . cov(TimeWe~t,Time2) | -.5266475 . . . cov(TimeWe~t,_cons) | .1314882 . . . cov(Time2,_cons) | -.0440412 . . . -----------------------------+------------------------------------------------ var(Residual) | .2449735 . . . ------------------------------------------------------------------------------ LR test vs. linear model: chi2(6) = 72.19 Prob > chi2 = 0.0000 Note: LR test is conservative and provided only for reference. . . estimates store randomquadratic, . lrtest randomquadratic fixedquadratic, Mixed models are not nested
Comment