On this Picostat.com statistics page, you will find information about the affairs data set which pertains to affairs. The affairs data set is found in the COUNT R package. You can load the affairs data set in R by issuing the following command at the console data("affairs"). This will load the data into a variable called affairs. If R says the affairs data set is not found, you can try installing the package by issuing this command install.packages("COUNT") and then attempt to reload the data. If you need to download R, you can go to the R project website. You can download a CSV (comma separated values) version of the affairs R data set. The size of this file is about 26,473 bytes.
Data from Fair (1978). Although Fair used a tobit model with the
data, the outcome measure can be modeled as a count. In fact,
Greene (2003) modeled it as Poisson, but given the amount of
overdispersion in the data, employing a negative binomial model
is an appropriate strategy. The data is stored in the affairs
Naffairs is the response variable, indicating the number
of affairs reported by the participant in the past year.
A data frame with 601 observations on the following 18 variables.
number of affairs within last year
1=have children;0= no children
(1/0) very unhappily married
(1/0) unhappily married
(1/0) average married
(1/0) happily married
(1/0) very happily married
(1/0) anti religious
(1/0) not religious
(1/0) slightly religious
(1/0) somewhat religious
(1/0) very religious
(1/0) >0.75 yrs
(1/0) >1.5 yrs
(1/0) >4.0 yrs
(1/0) >7.0 yrs
(1/0) >10.0 yrs
(1/0) >15.0 yrs
rwm5yr is saved as a data frame.
Count models use naffairs as response variable. 0 counts are included.
Fair, R. (1978). A Theory of Extramarital Affairs, Journal of Political Economy, 86: 45-61.
Greene, W.H. (2003). Econometric Analysis, Fifth Edition, New York: Macmillan.
Hilbe, Joseph M (2011), Negative Binomial Regression, Cambridge University Press
Hilbe, Joseph M (2009), Logistic regression Models, Chapman & Hall/CRC
glmaffp <- glm(naffairs ~ kids + yrsmarr2 + yrsmarr3 + yrsmarr4 + yrsmarr5,
family = poisson, data = affairs)
glmaffnb <- glm.nb(naffairs ~ kids + yrsmarr2 + yrsmarr3 + yrsmarr4 + yrsmarr5,
Dataset imported from https://www.r-project.org.