Dear R - Users
I have some problems fitting a linear mixed effects model using the lme function (from the library nlme). A sample data is as shown at the bottom of this mail. I fit my linear mixed model using the following R code:
With this code, i want to obtain random effects for each Trial. ALso my residuals are correlated, and the correlated residuals are heteroscedastic over endpoint. That is, each endpoint has a different constant variance.
However, I recieve the following error message using the code above:
Error in lme.formula(outcome ~ -1 + as.factor(endpoint) + as.factor(endpoint):trt, :
Incompatible formulas for groups in "random" and "correlation"
May someone kindly inform me how to correct this code.
Does this imply that the grouping factor in the correlation formula must be the same grouping factor in the random formula ? If so, is there a way of getting pass this restriction ?