Hi all,
For the following data, I consider the following random intercept and
random slope model. Denote as y_ijk the response value from *j*th
individual within *i*th method at time point *k*. Assume the following
model for y_ijk:
y_ijk= (alpha_0+ tau_i +a_j(i))+(beta_i+b_j(i)) T_k + e_ijk
Here alpha_0 is the grand mean;
tau_i is the fixed effect for ith method;
a_j(i) is random intercept corresponding to the *j*th individual
within *i*th method, assumed to be common for all three methods;
beta_i is the fixed slope corresponding to the ith method;
b_j(i) is the random slope corresponding to jth individual for
the ith method, assumed to be different for different methods;
T_k is the time corresponding to y_ijk;
e_ijk is the residual.
For this model, I consider the three specification using the lme function
as follows:
mod1 <- lme(fixed= reponse ~ method*time, random=~ 1 +time | individual,
data=one, weights= varIdent(form=~1|method),
control = lmeControl(opt = "optim"))
mod2 <- lme(fixed= reponse ~ method*time, random=~ 0 +time | individual,
data=one, weights= varIdent(form=~1|method),
control = lmeControl(opt = "optim"))
mod3 <- lme(fixed= reponse ~ method*time, random=~ method +time |
individual, data=one, weights= varIdent(form=~1|method),
control = lmeControl(opt = "optim"))
I think mod1 is the correct one. However, I am kind of confused with the
right usage of lme function. Can someone familiar with this give some help
here?
Another question is regarding the fixed effect tau_1, tau_2 and tau_3
(corresponding to the three methods). One main question I am interested in
is whether each of them are statistically different from zero. In the
summary results below (shaded part), it looks that the result for method 2
and 3 are given with reference to method 1). Is there a way to obtain
specific result separately for alpha_0 (the overall mean) and also tau_1,
tau_2 and tau3?
Thanks very much for the help!
Hanna
summary(mod1)Linear mixed-effects model fit by REML
Data: one
AIC BIC logLik
304.4703 330.1879 -140.2352
Random effects:
Formula: ~1 + time | individual
Structure: General positive-definite, Log-Cholesky parametrization
StdDev Corr
(Intercept) 0.2487869075 (Intr)
time 0.0001841179 -0.056
Residual 0.3718305953
Variance function:
Structure: Different standard deviations per stratum
Formula: ~1 | method
Parameter estimates:
3 1 2
1.00000 26.59750 24.74476
Fixed effects: reponse ~ method * time
Value Std.Error DF t-value p-value(Intercept)
96.65395 3.528586 57 27.391694 0.0000
method2 1.17851 4.856026 57 0.242689 0.8091
method3 5.87505 3.528617 57 1.664973 0.1014time
0.07010 0.250983 57 0.279301 0.7810
method2:time -0.12616 0.360585 57 -0.349877 0.7277
method3:time -0.08010 0.251105 57 -0.318999 0.7509
Correlation:
(Intr) methd2 methd3 time mthd2:
method2 -0.726
method3 -0.999 0.726
time -0.779 0.566 0.779
method2:time 0.542 -0.712 -0.542 -0.696
method3:time 0.778 -0.566 -0.779 -0.999 0.696
Standardized Within-Group Residuals:
Min Q1 Med Q3 Max
-2.67575293 -0.51633192 0.06742723 0.59706762 2.81061874
Number of Observations: 69
Number of Groups: 7 >