From German health survey data for the year 1998 only.
Usage
data(badhealth)
Format
A data frame with 1,127 observations on the following 3 variables.
numvisit
number of visits to doctor during 1998
badh
1=patient claims to be in bad health; 0=not in bad health
age
age of patient: 20-60
Details
badhealth is saved as a data frame.
Count models use numvisit as the response variable, 0 counts are included.
Source
German Health Survey, amended in Hilbe and Greene (2008).
References
Hilbe, Joseph M (2011), Negative Binomial Regression, Cambridge University Press
Hilbe, J. and W. Greene (2008). Count Response Regression Models, in ed.
C.R. Rao, J.P Miller, and D.C. Rao, Epidemiology and Medical Statistics,
Elsevier Handbook of Statistics Series. London, UK: Elsevier.
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(COUNT)
Loading required package: msme
Loading required package: MASS
Loading required package: lattice
Loading required package: sandwich
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/COUNT/badhealth.Rd_%03d_medium.png", width=480, height=480)
> ### Name: badhealth
> ### Title: badhealth
> ### Aliases: badhealth
> ### Keywords: datasets
>
> ### ** Examples
>
> data(badhealth)
> glmbadp <- glm(numvisit ~ badh + age, family=poisson, data=badhealth)
> summary(glmbadp)
Call:
glm(formula = numvisit ~ badh + age, family = poisson, data = badhealth)
Deviance Residuals:
Min 1Q Median 3Q Max
-3.6653 -1.9186 -0.6789 0.6292 10.0684
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 0.447022 0.071428 6.258 3.89e-10 ***
badh 1.108331 0.046169 24.006 < 2e-16 ***
age 0.005822 0.001822 3.195 0.0014 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for poisson family taken to be 1)
Null deviance: 4020.3 on 1126 degrees of freedom
Residual deviance: 3465.3 on 1124 degrees of freedom
AIC: 5638.6
Number of Fisher Scoring iterations: 5
> exp(coef(glmbadp))
(Intercept) badh age
1.563648 3.029299 1.005839
> library(MASS)
> glmbadnb <- glm.nb(numvisit ~ badh + age, data=badhealth)
> summary(glmbadnb)
Call:
glm.nb(formula = numvisit ~ badh + age, data = badhealth, init.theta = 0.9974812528,
link = log)
Deviance Residuals:
Min 1Q Median 3Q Max
-2.0304 -1.4361 -0.4152 0.3180 3.9516
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 0.404116 0.130847 3.088 0.00201 **
badh 1.107342 0.111603 9.922 < 2e-16 ***
age 0.006952 0.003397 2.047 0.04070 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for Negative Binomial(0.9975) family taken to be 1)
Null deviance: 1355.7 on 1126 degrees of freedom
Residual deviance: 1217.7 on 1124 degrees of freedom
AIC: 4475.3
Number of Fisher Scoring iterations: 1
Theta: 0.9975
Std. Err.: 0.0693
2 x log-likelihood: -4467.2850
> exp(coef(glmbadnb))
(Intercept) badh age
1.497977 3.026304 1.006977
>
>
>
>
>
> dev.off()
null device
1
>