Last data update: 2014.03.03

R: azheart
azheartR Documentation

azheart

Description

Random subset of 34 patients from the 1991 Arizona Medicare data for patients hospitalized subsequent to undergoing a CABG (DRGs 106, 107) or PTCA (DRG 112) cardiovascular procedure.

Usage

data(azheart)

Format

A data frame with 34 observations on the following 6 variables.

died

1=died as a result of surgery; 0=not died

procedure

1=CABG; 0=PTCA

age

age of subject

gender

1=Male; 0=Female

los

hospital length of stay

type

1=emerg/urgent admission; 0=elective admission

Details

azheart is saved as a data frame.

Source

Hilbe, Practical Guide to Logistic Regression, Chapman & Hall/CRC

References

Hilbe, Joseph M (2015), Practical Guide to Logistic Regression, Chapman & Hall/CRC

Examples

library(LOGIT)
#library(COUNT)
data(azheart); attach(azheart)
table(los); table(procedure, type); table(los, died)
summary(los)
summary(mymod <- glm(died ~ procedure + type + los, family=binomial, data=azheart))
#modelfit(mymod)
summary(mymodq <- glm(died ~ procedure+ type  + los, family=quasibinomial, data=azheart))
#modelfit(mymodq)
#library(sandwich)
#sqrt(diag(vcovHC(mymod, type="HC0")))
toOR(mymod)

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(LOGIT)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/LOGIT/azheart.rd_%03d_medium.png", width=480, height=480)
> ### Name: azheart
> ### Title: azheart
> ### Aliases: azheart
> ### Keywords: datasets
> 
> ### ** Examples
> 
> library(LOGIT)
> #library(COUNT)
> data(azheart); attach(azheart)
> table(los); table(procedure, type); table(los, died)
los
 1  2  3  4  5  6  7  8  9 10 12 13 14 
 2  8  5  3  1  2  3  1  2  3  1  1  2 
         type
procedure Elective Emer/Urg
     PTCA       10       10
     CABG       11        3
    died
los  Survive Died
  1        2    0
  2        8    0
  3        3    2
  4        3    0
  5        1    0
  6        2    0
  7        3    0
  8        1    0
  9        2    0
  10       1    2
  12       1    0
  13       0    1
  14       1    1
> summary(los)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
  1.000   2.000   4.000   5.647   8.750  14.000 
> summary(mymod <- glm(died ~ procedure + type + los, family=binomial, data=azheart))

Call:
glm(formula = died ~ procedure + type + los, family = binomial, 
    data = azheart)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-1.2077  -0.6384  -0.3110  -0.1933   1.9817  

Coefficients:
              Estimate Std. Error z value Pr(>|z|)  
(Intercept)    -4.3135     1.8061  -2.388   0.0169 *
procedureCABG   1.9875     1.3985   1.421   0.1553  
typeEmer/Urg    0.9660     1.2556   0.769   0.4417  
los             0.1712     0.1549   1.106   0.2689  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 31.688  on 33  degrees of freedom
Residual deviance: 24.749  on 30  degrees of freedom
AIC: 32.749

Number of Fisher Scoring iterations: 6

> #modelfit(mymod)
> summary(mymodq <- glm(died ~ procedure+ type  + los, family=quasibinomial, data=azheart))

Call:
glm(formula = died ~ procedure + type + los, family = quasibinomial, 
    data = azheart)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-1.2077  -0.6384  -0.3110  -0.1933   1.9817  

Coefficients:
              Estimate Std. Error t value Pr(>|t|)   
(Intercept)    -4.3135     1.5675  -2.752  0.00996 **
procedureCABG   1.9875     1.2138   1.637  0.11198   
typeEmer/Urg    0.9660     1.0897   0.886  0.38242   
los             0.1712     0.1344   1.274  0.21248   
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for quasibinomial family taken to be 0.7532542)

    Null deviance: 31.688  on 33  degrees of freedom
Residual deviance: 24.749  on 30  degrees of freedom
AIC: NA

Number of Fisher Scoring iterations: 6

> #modelfit(mymodq)
> #library(sandwich)
> #sqrt(diag(vcovHC(mymod, type="HC0")))
> toOR(mymod)
                  or   delta  zscore pvalue exp.loci. exp.upci.
(Intercept)   0.0134  0.0242 -2.3883 0.0169    0.0004    0.4614
procedureCABG 7.2976 10.2059  1.4212 0.1553    0.4707  113.1366
typeEmer/Urg  2.6274  3.2989  0.7694 0.4417    0.2243   30.7801
los           1.1867  0.1838  1.1056 0.2689    0.8761    1.6075
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>