fabric {BayesDA} | R Documentation |
Numbers of faults found in each of 32 rolls of fabric produced in a particular factory. Also given is the length of the roll.
data(fabric)
A data frame with 32 observations on the following 2 variables.
length
length of roll
faults
number of faults in roll
The book uses this for exercise 5. page 441
data(fabric)
str(fabric)
names(fabric)
# Identity link:
with(fabric, plot(faults ~ length))
# log link:
with(fabric, plot(faults ~ length, log="y"))
# Fitting poisson regression models:
mod1 <- glm(faults ~ length-1, data=fabric, family=poisson)
OK <- require(MCMCpack)
if(OK) mod2 <- MCMCpoisson(faults ~ length-1, data=fabric, b0=0, B0=0.0001)
summary(mod1)
confint(mod1)
if(OK) summary(mod2)
# The exercise is to investigate overdispersion ...