Skip to content

problem with lme4

1 message · Ben Bolker

#
[cc'ing back to r-sig-mixed-models; I strongly prefer to keep
conversations on-list]

  It's a little hard to say without the original data, but I'm pretty
sure your problem is with ggplot rather than lme4.  In particular, you
should probably use geom_line(aes(y=F1, col=factor(ind) )), or
geom_line(aes(y=F1,col=ind, group=ind)); ggplot interprets continuous
and categorical variables differently.


-------- Original Message --------
Subject: 	Re: problem with lme4
Date: 	Thu, 23 Jan 2014 14:25:47 +0100
From: 	Linda Heeb <linda.heeb at uzh.ch>
To: 	Ben Bolker <bbolker at gmail.com>



Thanks for your help, but I still have a problem.
Do you know how I can make a smooth line out of my ?alone" data, like
the blue line that i got from the method=glm? So that the zigzag
disappear (you can see it on the attached picture)

thanks

model.s2<-glmer(number~session+treatment+amount.pup+drink+alone+lick+(1|ind),data=bold.t,
family=poisson)
bold.t$F0 <- inv.logit(getME(model.s2,"X") %*% fixef(model.s2))
bold.t$F1 <- fitted(model.s2)
p <- qplot(alone,geom="smooth", number,data=bold.t, method="glm")
p + theme_bw() + geom_line(aes(y=F0)) + geom_line(aes(y=F1, col=ind )) +
theme(legend.position = "none")




Am 22.01.2014 um 19:30 schrieb Ben Bolker <bbolker at gmail.com
<mailto:bbolker at gmail.com>>: