[R] a question about linear mixed model in R
Peter Muhlberger
peterm at andrew.cmu.edu
Wed Jan 19 00:55:17 CET 2005
Hi Chung Cheng: This seems related to a problem I'm having in some data of
mine as well. I'm new to R (played w/ it some a year ago) & to lme
modeling, so take this w/ a grain of salt, but here are some thoughts:
In my problem, D would be an indicator of whether a subject was in the
control condition or not. In the control condition, all people participated
individually, in the experimental condition there was small-group based
discussion. r(ij) would be some variable that affects the outcome, but
whose effect may be moderated by the group the discussion was in.
The model assumes that the non-control condition values will have a
distribution of coefficients for r(ij). The coefficient for r(ij) in the
controls need not have the same central value as for the non-controls
(though it would be nice to be able constrain it so it would be). So, it
might make some sense to split the variable into two variables, one with
zeros for the controls & one w/ zeros for the experimental groups and
estimate the former w/ random effects & the other not.
I'm not 100% sure that's what you're asking, but it seems related.
Peter
>Dear all,
>
>I have a somewhat unusual linear mixed model that I can't seem
>to code in lme. It's only unusual in that one random effect is
>applied only to some of the observations (I have an indicator
>variable
>that specifies which observations have this random effect).
>
>The model is:
>
>X_hijk = alpha_h + h * b_i + r_(ij) + e_hijk , where
>
> h = 0 or 1 (indicator)
> i = 1, ..., N
> j = 1, ..., n_i
> k = 1, ..., K
>alpha is fixed, and the rest are random.
>I'm willing to assume b, r, and e are mutually independent
>and normal with var(b) = sigma^2_b, var(r) = sigma^2_r, and
>var(e) = sigma^2.
>
>Any help in writing this model in lme() would be greatly
>appreciated.
>
>Thanks,
>
>Chung Cheng
More information about the R-help
mailing list