[R] Problems using allEffects() (package effect)

Jonas Mandel jonas.mandel at curie.fr
Thu Jun 17 18:03:24 CEST 2010


Dear R users,

I have some trouble using the allEffects() function to compute and
display effect plots for a linear model.
My data is quite simple, it concerns effects of 3 treatments on the
tumoral volume of mice. vTum codes for the qualitative initial volume,
from small to big, temps is the time in month since beginning of
treatment, and Série codes for the batch. Data is unbalanced.

> head(data)
           Id Série Traitement vTum temps Volume
55656.1 55656     7          3    1     1  14.03
55805.1 55805     7          3    3     1  59.92
55829.1 55829     7          3    1     1  15.31
55806.1 55806     7          3    2     1  28.01
50725.1 50725     7          3    2     1  34.48
55737.1 55737     7          3    2     1  43.56


The linear model is also quite simple :
> lm1=lm(Volume ~  temps + Traitement:temps + Série , data)

But when I try to use allEffects() I get this error:
> eff.lm1 <- allEffect(mod=lm1,
Error in apply(mod.matrix[, components], 1, prod) : index out of range

I read the help and the example but I don't understand the reason why it
doesn't work. Can you help me ?
Thanks


-- 
Jonas Mandel



More information about the R-help mailing list