[R] Confidence interval for the mean in the random intercept and random slople model
li li
hannah.hlx at gmail.com
Fri Jun 5 20:26:24 CEST 2015
Hi all,
I am fitting a random slope and random intercept model usign lme
fucntion as shown below. Type is factor with two levels. I would like
to to find a confidence interval for mean of this model. Note that the
variance we use in finding the confidence interval should include the
variariance component from random effect. Any suggestions?
## using lme function
> mod_lme <- lme(ti ~ type*months, random=~ 1+months|lot, na.action=na.omit,
+ data=one, control = lmeControl(opt = "optim"))
> summary(mod_lme)
Linear mixed-effects model fit by REML
Data: one
AIC BIC logLik
-82.60042 -70.15763 49.30021
Random effects:
Formula: ~1 + months | lot
Structure: General positive-definite, Log-Cholesky parametrization
StdDev Corr
(Intercept) 8.907584e-03 (Intr)
months 6.039781e-05 -0.096
Residual 4.471243e-02
Fixed effects: ti ~ type * months
Value Std.Error DF t-value p-value
(Intercept) 0.25831245 0.016891587 31 15.292373 0.0000
type 0.13502089 0.026676101 4 5.061493 0.0072
months 0.00804790 0.001218941 31 6.602368 0.0000
type:months -0.00693679 0.002981859 31 -2.326329 0.0267
Correlation:
(Intr) typPPQ months
type -0.633
months -0.785 0.497
type:months 0.321 -0.762 -0.409
Standardized Within-Group Residuals:
Min Q1 Med Q3 Max
-2.162856e+00 -1.962972e-01 -2.771184e-05 3.749035e-01 2.088392e+00
Number of Observations: 39
Number of Groups: 6
More information about the R-help
mailing list