Last data update: 2014.03.03

R: rwm
rwmR Documentation

rwm

Description

German health registry for the years 1984-1988. Health information for years prior to health reform.

Usage

data(rwm)

Format

A data frame with 27,326 observations on the following 4 variables.

docvis

number of visits to doctor during year (0-121)

age

age: 25-64

educ

years of formal education (7-18)

hhninc

household yearly income in DM/1000)

Details

rwm is saved as a data frame. Count models typically use docvis as response variable. 0 counts are included

Source

German Health Reform Registry, years pre-reform 1984-1988, From Hilbe and Greene (2008)

References

Hilbe, Joseph M (2011), Negative Binomial Regression, Cambridge University Press Hilbe, J.M. and W.H. Greene (2008), "Count Response Regression Models", in Rao, CR, JP Miller and DC Rao (eds), Handbook of Statistics 27: Epidemiology and Medical Statistics, Amsterdam: Elsevier. pp. 210-252.

Examples

data(rwm)
glmrwp <- glm(docvis ~ age + educ + hhninc, family=poisson, data=rwm)
summary(glmrwp)
exp(coef(glmrwp))
library(MASS)
glmrwnb <- glm.nb(docvis ~ age + educ + hhninc, data=rwm)
summary(glmrwnb)
exp(coef(glmrwnb))

Results


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/rwm.Rd_%03d_medium.png", width=480, height=480)
> ### Name: rwm
> ### Title: rwm
> ### Aliases: rwm
> ### Keywords: datasets
> 
> ### ** Examples
> 
> data(rwm)
> glmrwp <- glm(docvis ~ age + educ + hhninc, family=poisson, data=rwm)
> summary(glmrwp)

Call:
glm(formula = docvis ~ age + educ + hhninc, family = poisson, 
    data = rwm)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-3.4573  -2.2402  -1.0531   0.4035  25.0457  

Coefficients:
              Estimate Std. Error z value Pr(>|z|)    
(Intercept)  0.8523131  0.0254907   33.44   <2e-16 ***
age          0.0212508  0.0003047   69.75   <2e-16 ***
educ        -0.0420873  0.0017279  -24.36   <2e-16 ***
hhninc      -0.0532375  0.0022036  -24.16   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for poisson family taken to be 1)

    Null deviance: 164286  on 27325  degrees of freedom
Residual deviance: 156590  on 27322  degrees of freedom
AIC: 209636

Number of Fisher Scoring iterations: 6

> exp(coef(glmrwp))
(Intercept)         age        educ      hhninc 
  2.3450649   1.0214782   0.9587860   0.9481548 
> library(MASS)
> glmrwnb <- glm.nb(docvis ~ age + educ + hhninc, data=rwm)
> summary(glmrwnb)

Call:
glm.nb(formula = docvis ~ age + educ + hhninc, data = rwm, init.theta = 0.5164359976, 
    link = log)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-1.6102  -1.3508  -0.4509   0.1483   5.4209  

Coefficients:
             Estimate Std. Error z value Pr(>|z|)    
(Intercept)  0.913261   0.063637  14.351   <2e-16 ***
age          0.020429   0.000817  25.005   <2e-16 ***
educ        -0.045957   0.004212 -10.911   <2e-16 ***
hhninc      -0.047681   0.005463  -8.728   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for Negative Binomial(0.5164) family taken to be 1)

    Null deviance: 29565  on 27325  degrees of freedom
Residual deviance: 28511  on 27322  degrees of freedom
AIC: 120654

Number of Fisher Scoring iterations: 1


              Theta:  0.51644 
          Std. Err.:  0.00596 

 2 x log-likelihood:  -120644.04200 
> exp(coef(glmrwnb))
(Intercept)         age        educ      hhninc 
  2.4924366   1.0206393   0.9550825   0.9534375 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>