Description Usage Format Details Source References Examples
German health registry for the years 1984-1988. Health information for years immediately prior to health reform.
1 |
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
rwm5yr is saved as a data frame. Count models typically use docvis as response variable. 0 counts are included
German Health Reform Registry, years pre-reform 1984-1988,
Hilbe, Joseph M (2007, 2011), Negative Binomial Regression, Cambridge University Press
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | data(rwm5yr)
glmrp <- glm(docvis ~ outwork + female + age + factor(edlevel),
family = poisson, data = rwm5yr)
summary(glmrp)
exp(coef(glmrp))
ml_p <- ml_glm(docvis ~ outwork + female + age + factor(edlevel),
family = "poisson",
link = "log",
data = rwm5yr)
summary(ml_p)
exp(coef(ml_p))
library(MASS)
glmrnb <- glm.nb(docvis ~ outwork + female + age + factor(edlevel),
data = rwm5yr)
summary(glmrnb)
exp(coef(glmrnb))
## Not run:
library(gee)
mygee <- gee(docvis ~ outwork + age + factor(edlevel), id=id,
corstr = "exchangeable", family=poisson, data=rwm5yr)
summary(mygee)
exp(coef(mygee))
## End(Not run)
|
Loading required package: MASS
Loading required package: lattice
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)HS grad -0.0799467 0.0178411 -4.481 7.43e-06 ***
factor(edlevel)Coll/Univ -0.2086855 0.0163618 -12.754 < 2e-16 ***
factor(edlevel)Grad School -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
(Intercept) outwork
1.1432922 1.2449886
female age
1.2195607 1.0194287
factor(edlevel)HS grad factor(edlevel)Coll/Univ
0.9231655 0.8116504
factor(edlevel)Grad School
0.6851001
Warning message:
In y - y.hat :
Recycling array of length 1 in vector-array arithmetic is deprecated.
Use c() or as.vector() instead.
Call:
ml_glm(formula = docvis ~ outwork + female + age + factor(edlevel),
data = rwm5yr, family = "poisson", link = "log")
Deviance Residuals:
Min. 1st Qu. Median Mean 3rd Qu. Max.
-3.4451 -2.2022 -1.1307 -0.5577 0.3578 25.7217
Coefficients (all in linear predictor):
Estimate SE Z p LCL UCL
(Intercept) 0.1411 0.018290 7.72 1.2e-14 0.1053 0.1770
outwork 0.2197 0.009321 23.58 6.91e-123 0.2015 0.2380
female 0.1979 0.009049 21.87 4.54e-106 0.1802 0.2157
age 0.0191 0.000376 50.75 0 0.0184 0.0198
factor(edlevel)HS grad -0.0815 0.017849 -4.56 5.01e-06 -0.1165 -0.0465
factor(edlevel)Coll/Univ -0.2094 0.016360 -12.80 1.68e-37 -0.2415 -0.1773
factor(edlevel)Grad School -0.3803 0.020732 -18.35 3.57e-75 -0.4210 -0.3397
Null deviance: 122269.6 on 19608 d.f.
Residual deviance: 115248.6 on 19602 d.f.
AIC: 152529.2
Number of optimizer iterations: 82
X(Intercept) Xoutwork
1.1515649 1.2457506
Xfemale Xage
1.2188860 1.0192761
Xfactor(edlevel)HS grad Xfactor(edlevel)Coll/Univ
0.9217600 0.8110823
Xfactor(edlevel)Grad School
0.6836312
Call:
glm.nb(formula = docvis ~ outwork + female + age + factor(edlevel),
data = rwm5yr, init.theta = 0.4900861749, link = log)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.5944 -1.3104 -0.4553 0.1323 5.7974
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 0.116906 0.047679 2.452 0.0142 *
outwork 0.214377 0.026218 8.177 2.92e-16 ***
female 0.251202 0.024584 10.218 < 2e-16 ***
age 0.019063 0.001023 18.634 < 2e-16 ***
factor(edlevel)HS grad -0.091222 0.047534 -1.919 0.0550 .
factor(edlevel)Coll/Univ -0.202769 0.040354 -5.025 5.04e-07 ***
factor(edlevel)Grad School -0.390351 0.046969 -8.311 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for Negative Binomial(0.4901) family taken to be 1)
Null deviance: 21200 on 19608 degrees of freedom
Residual deviance: 20231 on 19602 degrees of freedom
AIC: 85701
Number of Fisher Scoring iterations: 1
Theta: 0.49009
Std. Err.: 0.00670
2 x log-likelihood: -85685.32200
(Intercept) outwork
1.1240135 1.2390897
female age
1.2855693 1.0192461
factor(edlevel)HS grad factor(edlevel)Coll/Univ
0.9128148 0.8164669
factor(edlevel)Grad School
0.6768193
Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27
running glm to get initial regression estimate
(Intercept) outwork
0.22506966 0.30800723
age factor(edlevel)HS grad
0.01881195 -0.06420743
factor(edlevel)Coll/Univ factor(edlevel)Grad School
-0.23859642 -0.40280104
GEE: GENERALIZED LINEAR MODELS FOR DEPENDENT DATA
gee S-function, version 4.13 modified 98/01/27 (1998)
Model:
Link: Logarithm
Variance to Mean Relation: Poisson
Correlation Structure: Exchangeable
Call:
gee(formula = docvis ~ outwork + age + factor(edlevel), id = id,
data = rwm5yr, family = poisson, corstr = "exchangeable")
Summary of Residuals:
Min 1Q Median 3Q Max
-5.5018838 -2.7300598 -1.7300598 0.6528813 117.6334056
Coefficients:
Estimate Naive S.E. Naive z Robust S.E.
(Intercept) 0.24864833 0.072023212 3.4523361 0.07224973
outwork 0.24736193 0.031502752 7.8520738 0.03401158
age 0.01889188 0.001512739 12.4885280 0.00154318
factor(edlevel)HS grad -0.04704080 0.072729806 -0.6467885 0.06426464
factor(edlevel)Coll/Univ -0.23476360 0.066317259 -3.5400077 0.05552501
factor(edlevel)Grad School -0.36057208 0.083291171 -4.3290552 0.07317554
Robust z
(Intercept) 3.4415123
outwork 7.2728734
age 12.2421751
factor(edlevel)HS grad -0.7319858
factor(edlevel)Coll/Univ -4.2280695
factor(edlevel)Grad School -4.9274945
Estimated Scale Parameter: 9.928062
Number of Iterations: 3
Working Correlation
[,1] [,2] [,3] [,4] [,5]
[1,] 1.0000000 0.3158285 0.3158285 0.3158285 0.3158285
[2,] 0.3158285 1.0000000 0.3158285 0.3158285 0.3158285
[3,] 0.3158285 0.3158285 1.0000000 0.3158285 0.3158285
[4,] 0.3158285 0.3158285 0.3158285 1.0000000 0.3158285
[5,] 0.3158285 0.3158285 0.3158285 0.3158285 1.0000000
(Intercept) outwork
1.2822910 1.2806425
age factor(edlevel)HS grad
1.0190715 0.9540485
factor(edlevel)Coll/Univ factor(edlevel)Grad School
0.7907578 0.6972773
Warning message:
system call failed: Cannot allocate memory
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.