[R] Error in ordinal mixed effects
||@t@ @end|ng |rom dewey@myzen@co@uk
Tue Jun 9 17:00:36 CEST 2020
Without your dat it is hard to say (and it would have helped to know
where mixor() comes from) but this almost always means that ne of your
parameters to the call is not what you thought it was so trying str(res)
might be enlightening. Also I do not see anywhere in your example where
you define na unless it is really NA and you did not copy it correctly.
On 09/06/2020 12:33, SUSANA ALBERICH MESA wrote:
> I'm trying to run an ordinal mixed effects model with Mixor command. I have 65 cases and repeated visits in 0, 6, 9, 12 and 18 months. My code is the following:
> cannabis<-c(datos$cannabis0, datos$cannabis6, datos$cannabis9, datos$cannabis12, datos$cannabis18)
> time<-c(rep(0, 65), rep(6, 65), rep(9, 65), rep(12, 65), rep(18, 65))
> id<-c(rep(datos$id, 5))
> group<-c(rep(datos$group, 5))
> res<-data.frame(cbind(id, group, time, cannabis))
> names(res)<-c("id", "group", "time", "cannabis")
> cannabismod<-mixor(cannabis~ time + as.factor(group), data=res, id=id, na.exclude, which.random.slope=na, link="logit")
> However, I have obtained this error:
> Error in xj[i] : invalid subscript type 'closure'
> Please, could anyone help me to solve it?
> Many thanks,
> [[alternative HTML version deleted]]
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help