[R-sig-ME] Error with nlme and varFixed
biii m@iii@g oii de@@ey@ws
biii m@iii@g oii de@@ey@ws
Wed Jan 29 21:20:40 CET 2020
Hello,
When trying to fit an NLME model using a vector of varFixed, I get an error
that appears to be related to a multiplication issue at this line of code:
https://github.com/cran/nlme/blob/c006dfa23ad390948a74e67978a9828a6d60d89b/R
/varFunc.R#L169
Is the below a bug or am I inaccurately applying varFixed (or something
else)?
Here is a reproducible example:
library(nlme)
d <-
data.frame(
obs=rnorm(n=97), # 97 chosen because it's prime and therefore can't be
the size of a rectangular matrix
groups=rep(c("A", "B"), each=50)[1:97],
wt=abs(rnorm(n=97))
)
nlme(
obs~b,
fixed=b~1,
random=b~1|groups,
weights=varFixed(~wt),
start=c(b=0),
data=d
)
Which gets the error:
Error in recalc.varFunc(object[[i]], conLin) :
dims [product 12] do not match the length of object [97]
In addition: Warning message:
In conLin$Xy * varWeights(object) :
longer object length is not a multiple of shorter object length
Thanks,
Bill
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models
mailing list