Last data update: 2014.03.03

R: rwm5yr
rwm5yrR Documentation

rwm5yr

Description

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

Usage

data(rwm5yr)

Format

A data frame with 19,609 observations on the following 17 variables.

id

patient ID (1=7028)

docvis

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

hospvis

number of days in hospital during year (0-51)

year

year; (categorical: 1984, 1985, 1986, 1987, 1988)

edlevel

educational level (categorical: 1-4)

age

age: 25-64

outwork

out of work=1; 0=working

female

female=1; 0=male

married

married=1; 0=not married

kids

have children=1; no children=0

hhninc

household yearly income in marks (in Marks)

educ

years of formal education (7-18)

self

self-employed=1; not self employed=0

edlevel1

(1/0) not high school graduate

edlevel2

(1/0) high school graduate

edlevel3

(1/0) university/college

edlevel4

(1/0) graduate school

Details

rwm5yr 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, in Hilbe and Greene (2007)

References

Hilbe, Joseph M (2014), Modeling Count Data, Cambridge University Press 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.

Examples

library(MASS)
data(rwm5yr)

glmrp <- glm(docvis ~ outwork + female + age + factor(edlevel), family=poisson, data=rwm5yr)
summary(glmrp)
exp(coef(glmrp))

## Not run: 
library(msme)
nb2 <- nbinomial(docvis ~ outwork + female + age + factor(edlevel), data=rwm5yr)
summary(nb2)
exp(coef(nb2)) 

glmrnb <- glm.nb(docvis ~ outwork + female + age + factor(edlevel), data=rwm5yr)
summary(glmrnb)
exp(coef(glmrnb))

## End(Not run)

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/rwm5yr.Rd_%03d_medium.png", width=480, height=480)
> ### Name: rwm5yr
> ### Title: rwm5yr
> ### Aliases: rwm5yr
> ### Keywords: datasets
> 
> ### ** Examples
> 
> library(MASS)
> data(rwm5yr)
> 
> glmrp <- glm(docvis ~ outwork + female + age + factor(edlevel), family=poisson, data=rwm5yr)
> summary(glmrp)

Call:
glm(formula = docvis ~ outwork + female + age + factor(edlevel), 
    family = poisson, data = rwm5yr)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-3.4490  -2.2007  -1.1294   0.3583  25.7314  

Coefficients:
                   Estimate Std. Error z value Pr(>|z|)    
(Intercept)       0.1339120  0.0183103   7.313 2.60e-13 ***
outwork           0.2191264  0.0093205  23.510  < 2e-16 ***
female            0.1984907  0.0090486  21.936  < 2e-16 ***
age               0.0192424  0.0003767  51.086  < 2e-16 ***
factor(edlevel)2 -0.0799467  0.0178411  -4.481 7.43e-06 ***
factor(edlevel)3 -0.2086855  0.0163618 -12.754  < 2e-16 ***
factor(edlevel)4 -0.3781903  0.0207183 -18.254  < 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: 122270  on 19608  degrees of freedom
Residual deviance: 115248  on 19602  degrees of freedom
AIC: 152529

Number of Fisher Scoring iterations: 6

> exp(coef(glmrp))
     (Intercept)          outwork           female              age 
       1.1432922        1.2449886        1.2195607        1.0194287 
factor(edlevel)2 factor(edlevel)3 factor(edlevel)4 
       0.9231655        0.8116504        0.6851001 
> 
> ## Not run: 
> ##D library(msme)
> ##D nb2 <- nbinomial(docvis ~ outwork + female + age + factor(edlevel), data=rwm5yr)
> ##D summary(nb2)
> ##D exp(coef(nb2)) 
> ##D 
> ##D glmrnb <- glm.nb(docvis ~ outwork + female + age + factor(edlevel), data=rwm5yr)
> ##D summary(glmrnb)
> ##D exp(coef(glmrnb))
> ## End(Not run)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>