[R-sig-ME] specifying random effects in nlme with correlation fixed at 0
Kenneth KNOBLAUCH
ken@knob|@uch @end|ng |rom |n@erm@|r
Wed Sep 3 17:56:21 CEST 2025
I'm fitting a model using nlme. The data frame has 9600 rows and the grouping variable, Obs, has 10 levels. I fit the following model (names of variables simplified from original) that runs fine:
m1 <- nlme(y ~ A * x / (x + B), data = d.df,
fixed = A + B ~ F,
random = A + B ~ 1 | Obs,
start = list(fixed = c(A = c(2, 0), B = c(15, 0)) ))
F is a 2 level factor and A and B parameters to estimate. This runs fine, too, using SSmicmen(x, A, B) for the right hand side of the formula. x and y are numeric variables.
I would like to compare model m1 to a model where the correlation between random effects is fixed to 0. I tried
update(m1, random = list(A ~ 1 | Obs, B ~ 1 | Obs))
but I get the following error message:
Error in parse(text = paste("~", paste(nVal, collapse = "/"))) :
<text>:2:0: unexpected end of input
1: ~
^
I've also tried with various combinations of the pdMat functions but can't find the right way to specify this.
Simpler models, leaving out one or the other random effect work as well as for leaving out fixed effects after the random effects have been tested.
Thank you for any suggestions.
Ken
___
Kenneth Knoblauch
Inserm U1208
Stem-cell and Brain Research Institute
18 avenue du Doyen Lépine
69500 Bron
France
tel: +33 (0)4 72 91 34 77
fax: +33 (0)4 72 91 34 61
portable: +33 (0)6 84 10 64 10
https://sbri.fr/public-profile/63/single-member/
More information about the R-sig-mixed-models
mailing list