My data relates if activities from people are completed or not and affected by sunshine - completion is the outcome variable and sunshine would be the explanatory variable; this is a simplified version.
df <- people = c(1,1,1,2,2,3,3,4,4,5,5),
activity = c(1,1,1,2,2,3,4,5,5,6,6),
completion = c(0,0,1,0,1,1,1,0,1,0,1),
sunshine = c(1,2,3,4,5,4,6,2,4,8,4)
so far I've use this code for the cloglog:
model<- as.formula("completion ~ sunshine")
clog_full = glm(model,data=df,family = binomial(link = cloglog))
summary(clog_full)
> using package glmmML
model_re<- as.formula("completion ~ sunshine")
> clog_re = glmmML(model_re,cluster = people, data= df,family =
> binomial(link = cloglog)) summary(clog_re)
>
> using package lme4
>
> model_re1<- as.formula("completion ~ (1|people) + sunshine") clog_re1
> = glmer(model_re1, data=df,family = binomial(link = cloglog)) summary(clog_re1) summ(clog_re1, exp = TRUE)
Aucun commentaire:
Enregistrer un commentaire