fabric {BayesDA} | R Documentation |
Numbers of Faults Found in Each of 32 Rolls of Fabric
Description
Numbers of faults found in each of 32 rolls of fabric produced in a particular factory. Also given is the length of the roll.
Usage
data(fabric)
Format
A data frame with 32 observations on the following 2 variables.
length
length of roll
faults
number of faults in roll
Details
The book uses this for exercise 5. page 441
Examples
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 ...
[Package BayesDA version 2012.04-1 Index]