Displaying 1 result from an estimated 1 matches for "nsubjids".
2007 Dec 09
0
Lmer output for negative binomial data
...mixed-effects generalized linear
models to data, generated from a negative binomial distribution : count ~
Neg.Bin (mu, theta). Here is the code:
==============================================================================
#Generate the data frame
set.seed(2153)
mydf<-data.frame(subjs=seq(1:nsubjids),
counts=rnbinom(nsubjids*ntimes, size=0.5, mu=1.8))
#Model
require(MASS); require(lme4)
summary(glm.nb(counts~1, data=mydf))
summary(lmer(counts~1+(1|subjs),
family=negative.binomial(theta=fixed.nb0$theta), data=mydf))
=============================================================================...