data(hodges)
plot(prind~state, data=hodges)
m1<- gamlss(prind~random(state), sigma.fo=~random(state), nu.fo=~random(state),
tau.fo=~random(state), family=BCT, data=hodges)
edfAll(m1)
# radnom effect for tau is not needed
m2<- gamlss(prind~random(state), sigma.fo=~random(state), nu.fo=~random(state),
family=BCT, data=hodges, start.from=m1)
edfAll(m2)
plot(m2)
#op<-par(mfrow=c(3,1))
#term.plot(m2, se=TRUE)
#term.plot(m2, se=TRUE, what="sigma")
#term.plot(m2, se=TRUE, what="nu")
#par(op)
# the example from Venable and Ripley (2002)
library(MASS)
data(bacteria)
library(nlme)
summary(glmmPQL(y ~ trt + I(week > 2), random = ~ 1 | ID,
family = binomial, data = bacteria))
s1 <- gamlss(y ~ trt + I(week > 2)+random(ID), family = BI, data = bacteria)
# the esimate of sigma
sqrt(s1$mu.coefSmo[[1]]$sig2)
# the esimate of random effect sigma
sqrt(s1$mu.coefSmo[[1]]$tau2)
Run the code above in your browser using DataLab