Last data update: 2014.03.03
|
R: mylgg
mylgg
Description
The data has 11 grouped observations and 6 variables. Grouped
subset of medpar data.
Usage
data(mylgg)
Format
A data frame with 11 observations with the following 6 variables.
white 0=identified as non-white; identified as white
hmo 0=patient not an HMO member; 1=patient member of HMO
type Type of admission: 1=elective;2=urgent; 3=emergency
alive # patients alive per patient profile
dead # patients died within 48 hrs admit per patient profile
m # patients in each patient profile (same predictor values)
Details
mylgg is saved as a data frame.
Used to assess odds ratios and predict survival folllowing surgery
Source
Subset of medpar data, grouped format.
References
Hilbe, Joseph M (2015), Practical Guide to Logistic Regression, Chapman & Hall/CRC.
Hilbe, Joseph M (2009), Logistic Regression Models, Chapman & Hall/CRC.
Examples
library(MASS) # if not automatically loaded
# LOGISTIC REGRESSION
library(LOGIT)
data(mylgg)
mylgg
summary(lg <- glm(cbind(alive, dead) ~ white + hmo + factor(type),
family=binomial, data=mylgg))
toOR(lg)
P__disp(lg)
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/mylgg.rd_%03d_medium.png", width=480, height=480)
> ### Name: mylgg
> ### Title: mylgg
> ### Aliases: mylgg
> ### Keywords: datasets
>
> ### ** Examples
>
> library(MASS) # if not automatically loaded
> # LOGISTIC REGRESSION
> library(LOGIT)
> data(mylgg)
> mylgg
white hmo type alive dead m
1 0 0 1 55 17 72
2 0 0 2 22 11 33
3 0 0 3 6 4 10
4 0 1 1 7 1 8
5 0 1 2 1 3 4
6 1 0 1 580 277 857
7 1 0 2 119 82 201
8 1 0 3 43 40 83
9 1 1 1 128 69 197
10 1 1 2 19 8 27
11 1 1 3 2 1 3
> summary(lg <- glm(cbind(alive, dead) ~ white + hmo + factor(type),
+ family=binomial, data=mylgg))
Call:
glm(formula = cbind(alive, dead) ~ white + hmo + factor(type),
family = binomial, data = mylgg)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.71409 -0.15592 -0.06327 0.42482 1.26685
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 1.09058 0.20535 5.311 1.09e-07 ***
white -0.35617 0.20712 -1.720 0.08551 .
hmo -0.04758 0.15032 -0.317 0.75161
factor(type)2 -0.33963 0.14217 -2.389 0.01690 *
factor(type)3 -0.64421 0.21582 -2.985 0.00284 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 21.0503 on 10 degrees of freedom
Residual deviance: 6.0958 on 6 degrees of freedom
AIC: 59.243
Number of Fisher Scoring iterations: 3
> toOR(lg)
or delta zscore pvalue exp.loci. exp.upci.
(Intercept) 2.9760 0.6111 5.3108 0.0000 1.9899 4.4507
white 0.7004 0.1451 -1.7196 0.0855 0.4667 1.0510
hmo 0.9535 0.1433 -0.3165 0.7516 0.7102 1.2802
factor(type)2 0.7120 0.1012 -2.3888 0.0169 0.5389 0.9409
factor(type)3 0.5251 0.1133 -2.9849 0.0028 0.3440 0.8015
> P__disp(lg)
Pearson Chi2 = 6.135795
Dispersion = 1.022633
>
>
>
>
>
>
> dev.off()
null device
1
>
|