Data come from the 1991 Arizona cardiovascular patient files. A subset of the
fields was selected to model the differential length of stay for patients entering
the hospital to receive one of two standard cardiovascular procedures: CABG and PTCA.
CABG is the standard acronym for Coronary Artery Bypass Graft, where the flow of
blood in a diseased or blocked coronary artery or vein has been grafted to bypass
the diseased sections. PTCA, or Percutaneous Transluminal Coronary Angioplasty, is
a method of placing a balloon in a blocked coronary artery to open it to blood flow.
It is a much less severe method of treatment for those having coronary blockage, with
a corresponding reduction in risk.
Usage
data(azprocedure)
Format
A data frame with 3589 observations on the following 6 variables.
los
length of hospital stay
procedure
1=CABG;0=PTCA
sex
1=Male; 0=female
admit
1=Urgent/Emerg; 0=elective (type of admission)
age75
1= Age>75; 0=Age<=75
hospital
encrypted facility code (string)
Details
azprocedure is saved as a data frame.
Count models use los as response variable. 0 counts are structurally excluded
Source
1991 Arizona Medpar data, cardiovascular patient files,
National Health Economics & Research Co.
References
Hilbe, Joseph M (2014), Modeling Count Data, Cambridge University Press
Hilbe, Joseph M (2007, 2011), Negative Binomial Regression, Cambridge University Press
Hilbe, Joseph M (2009), Logistic Regression Models, Chapman & Hall/CRC
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/azprocedure.Rd_%03d_medium.png", width=480, height=480)
> ### Name: azprocedure
> ### Title: azprocedure
> ### Aliases: azprocedure
> ### Keywords: datasets
>
> ### ** Examples
>
> library(MASS)
> library(msme)
>
> data(azprocedure)
>
> glmazp <- glm(los ~ procedure + sex + admit, family=poisson, data=azprocedure)
> summary(glmazp)
Call:
glm(formula = los ~ procedure + sex + admit, family = poisson,
data = azprocedure)
Deviance Residuals:
Min 1Q Median 3Q Max
-3.1987 -1.1451 -0.4756 0.5331 12.4784
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 1.49140 0.01539 96.91 <2e-16 ***
procedure 0.95738 0.01218 78.61 <2e-16 ***
sex -0.13022 0.01179 -11.04 <2e-16 ***
admit 0.33307 0.01210 27.52 <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: 16265.0 on 3588 degrees of freedom
Residual deviance: 8968.9 on 3585 degrees of freedom
AIC: 22483
Number of Fisher Scoring iterations: 5
> exp(coef(glmazp))
(Intercept) procedure sex admit
4.4433339 2.6048728 0.8779003 1.3952480
>
> nb2 <- nbinomial(los ~ procedure + sex + admit, data=azprocedure)
There were 50 or more warnings (use warnings() to see the first 50)
> summary(nb2)
Call:
nbinomial(formula1 = los ~ procedure + sex + admit, data = azprocedure)
Deviance Residuals:
Min. 1st Qu. Median Mean 3rd Qu. Max.
-2.0470 -0.8062 -0.3166 -0.1451 0.3387 6.4690
Pearson Residuals:
Min. 1st Qu. Median Mean 3rd Qu. Max.
-1.50500 -0.70920 -0.30160 -0.00256 0.35460 13.20000
Coefficients (all in linear predictor):
Estimate SE Z p LCL UCL
(Intercept) 1.451 0.02318 62.61 0 1.406 1.4968
procedure 0.978 0.01847 52.97 0 0.942 1.0143
sex -0.132 0.01915 -6.91 4.75e-12 -0.170 -0.0948
admit 0.379 0.01913 19.79 3.83e-87 0.341 0.4160
(Intercept)_s 0.163 0.00657 24.78 1.63e-135 0.150 0.1757
Null deviance: 6645.526 on 3587 d.f.
Residual deviance: 3527.729 on 3584 d.f.
Null Pearson: 7994.053 on 3587 d.f.
Residual Pearson: 4928.391 on 3584 d.f.
Dispersion: 1.375109
AIC: 19992.18
Number of optimizer iterations: 244
> exp(coef(nb2))
(Intercept) procedure sex admit (Intercept)_s
4.2691394 2.6593522 0.8760073 1.4601067 1.1768778
>
> glmaznb <- glm.nb(los ~ procedure + sex + admit, data=azprocedure)
> summary(glmaznb)
Call:
glm.nb(formula = los ~ procedure + sex + admit, data = azprocedure,
init.theta = 6.140143318, link = log)
Deviance Residuals:
Min 1Q Median 3Q Max
-2.0474 -0.8062 -0.3166 0.3387 6.4690
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 1.45141 0.02293 63.31 < 2e-16 ***
procedure 0.97808 0.01837 53.25 < 2e-16 ***
sex -0.13238 0.01913 -6.92 4.52e-12 ***
admit 0.37851 0.01906 19.86 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for Negative Binomial(6.1401) family taken to be 1)
Null deviance: 6645.6 on 3588 degrees of freedom
Residual deviance: 3527.8 on 3585 degrees of freedom
AIC: 19992
Number of Fisher Scoring iterations: 1
Theta: 6.140
Std. Err.: 0.248
2 x log-likelihood: -19982.184
> exp(coef(glmaznb))
(Intercept) procedure sex admit
4.269141 2.659351 0.876007 1.460107
>
>
>
>
>
> dev.off()
null device
1
>