0
I’m trying to adjust a mixed effects model considering the package gamlss
.
The data is here: https://drive.google.com/file/d/1q4XuSPnZXx7TsrT3JVoucFyxeOSegWFz/view?usp=sharing
The model I’m adjusting is defined below:
library(gamlss)
ModelGamlss <- gamlss(log(Var1)~re(fixed=~log(Var2)+log(Var3)+
(Var4)+(Var5),random = list(Var6=pdDiag(~Var7))),
data=Data2)
However, the following error is shown:
Error in gamlss(log(Var1) ~ re(fixed = ~log(Var1)~re(fixed=~log(Var2)+log(Var3)+(Var4)+ :
The data contains NA's, use data = na.omit(mydata)
After encountering this error, I made the following change in the syntax of the considered model:
ModelGamlss <- gamlss(log(Var1)~re(fixed=~log(Var2)+log(Var3)+
(Var4)+(Var5),random = list(Var6=pdDiag(~Var7))),
data=na.omit(Data2))
However, a new error is presented:
Error in lm.wfit(x, z, w, method = "qr", ...) : 0 (non-NA) cases
How could it solve the problems previously faced? Since the first error informs that there are Na’s in the database, however, when looking at the database no NA is observed, and more, what would be the reason this second error message is appearing when trying to adjust the above model?
Hello Rui! Thank you so much for your feedback. So, strange that even I using the following command
Data2 <- read.csv2("DataNew.csv", header=T, sep=";", dec=",")
the error still continues.– user55546
Rui, that part of your code
"https://docs.google.com/uc?id=%s&export=download"
you picked up where?– user55546
@Brenog. I don’t know where I found it, but I’ve used it ever since and it’s (almost?) always right. O
id=%s
will take the valueid=1q4XuSPnZXx7TsrT3JVoucFyxeOSegWFz
, see?sprintf
.– Rui Barradas
@Brenog. You can also download and then
Data2 <- read.csv2("DataNew.csv")
enough, the other arguments are not necessary, because those are already the values that have. Theread.csv2
is a deliberately inflexible form ofread.table
with the appropriate arguments.– Rui Barradas