[R-sig-ME] bivariate growth models using lme()
Simon Harmel
@|m@h@rme| @end|ng |rom gm@||@com
Tue Jan 19 03:29:22 CET 2021
Hello all,
In chapter 8 of this book (
https://www.guilford.com/books/Growth-Modeling/Grimm-Ram-Estabrook/9781462526062),
p. 172, script 8.2, there is a demonstration of a bivariate growth model
fit with `nlme()` function (see `m1` below).
I was wondering if the same model could be fit using the `lme()` function?
I have tried `lme()` (see `m2` below), but the output doesn't match. --
Thanks, Simon
multivariate <- read.csv('
https://raw.githubusercontent.com/hkil/m/master/bv.csv')
lmeCtlList <- lmeControl(maxIter = 200, msMaxIter = 200, niterEM = 50,
msMaxEval = 400)
m1 <- nlme(var~d_math*(b_1i+b_2i*(grade-2))+
d_hyp *(h_1i+h_2i*(grade-2)),
data = multivariate,
fixed = b_1i+b_2i+h_1i+h_2i~1,
random = b_1i+b_2i+h_1i+h_2i~1,
group = ~id,
start = c(35, 4, 1, -1),
weights = varIdent(c(hyp=.3), form = ~1|grp),
na.action = na.omit,
control=lmeCtlList)
m2 <- lme(var ~ 0 + d_math + d_hyp + d_math:grade + d_hyp:grade,
random = ~ 0 + d_math + d_hyp + d_math:grade + d_hyp:grade | id, data =
multivariate,
na.action = na.omit, weights = varIdent(c(hyp=.3), form = ~1|grp),
control = lmeCtlList)
# `m1` output:
coef(summary(m1))
Value Std.Error DF t-value p-value
b_1i 35.25857425 0.35511071 3456 99.288962 0.000000e+00
b_2i 4.34307216 0.08737929 3456 49.703680 0.000000e+00
h_1i 1.90351659 0.05815329 3456 32.732739 6.143241e-205
h_2i -0.05663496 0.01422441 3456 -3.981533 6.988077e-05
# `m2` output:
coef(summary(m2))
Value Std.Error DF t-value p-value
d_math 26.57270335 0.47201444 3456 56.296378 0.000000e+00
d_hyp 2.01699310 0.07867055 3456 25.638478 7.225043e-133
d_math:grade 4.34308917 0.08740932 3456 49.686797 0.000000e+00
d_hyp:grade -0.05670937 0.01414676 3456 -4.008647 6.235700e-05
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models
mailing list