[R] lme random effects in additive models with interaction

Ben Bolker bbolker at gmail.com
Thu Jun 21 16:35:56 CEST 2012


elifnurdogruoz <elifnurdogruoz <at> mynet.com> writes:

> 
> Hello,
> I work with a mixed model with 4 predictor variables Time, Size, Charge,
> Density and Size, Charge, Density are factors, all with two levels. Hence I
> want to put their interactions with Time into the model. But, I have two
> data sets (Replication 1 and 2) and I want that Replication is random
> effect. Here is my code:

  Sorry not to give you a full answer to this, but I have a few 
quick responses:
 
  * although you have given us your code, this isn't fully
reproducible (see http://tinyurl.com/reproducible-000 ) --- that
isn't always completely necessary, but it can help a lot ...

  * What is default.knots() ? I can't find it anywhere ...

  *  The rest of your code is rather complicated for understanding
at a glance -- some comments (##) about what's going on might be
helpful

  * You might want to re-post this on r-sig-mixed-models <at>
r-project.org , specifying that it was previously posted here.

  * Most specifically (but alas most negatively), you may have some
serious problems with treating a two-level factor (replication) as a
random effect: in principle and philosophically, there is nothing
wrong with supposing that your replications are randomly chosen
from a hypothetical population of possibilities, but it may be
difficult both practically and statistically to get meaningful
results with n=2 (see e.g.
https://stat.ethz.ch/pipermail/r-sig-mixed-models/2010q2/003709.html
for a discussion on this topic) ...



More information about the R-help mailing list