Model_1 <-glm(chd ~ cat, family =binomial(link ="logit"), data = chd)Model_2 <-glm(chd ~ cat + agegp, family =binomial(link ="logit"), data = chd)Liketest_1 <-anova(Model_1, Model_2, test ="LRT")summary(Model_1)
Call:
glm(formula = chd ~ cat, family = binomial(link = "logit"), data = chd)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 1.110e-16 7.071e-01 0 1
cathigh -2.220e-16 1.000e+00 0 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 22.181 on 15 degrees of freedom
Residual deviance: 22.181 on 14 degrees of freedom
AIC: 26.181
Number of Fisher Scoring iterations: 2
summary(Model_2)
Call:
glm(formula = chd ~ cat + agegp, family = binomial(link = "logit"),
data = chd)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 1.11e-16 8.66e-01 0 1
cathigh -2.22e-16 1.00e+00 0 1
agegp55+ 0.00e+00 1.00e+00 0 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 22.181 on 15 degrees of freedom
Residual deviance: 22.181 on 13 degrees of freedom
AIC: 28.181
Number of Fisher Scoring iterations: 2
Liketest_1
Analysis of Deviance Table
Model 1: chd ~ cat
Model 2: chd ~ cat + agegp
Resid. Df Resid. Dev Df Deviance Pr(>Chi)
1 14 22.181
2 13 22.181 1 0 1
Based on Model_1, the coefficient for cathigh is close to zero and its p-value is 1. This suggests that there’s no significant association between cat and chd.
Based on the results of Model_2, adding agegp does not change the coefficient values, standard errors, or the deviance, as all values remain the same ;however, AIC has slightly increased compared to the Model_1.
Likelihood test for evaluating the significance of adding the AGEGP variable to the model:
This test suggests that the difference in residual deviance between Model_1 and Model_2 is 0 and there is a chi-square test p-value of 1. This result suggests that adding agegp does not significantly improve the model. p-value of 1 suggests that agegp is not a significant variable in relation between cat and chd.
Calculating the odds ratio for CHD in patients with a high vs. low serum cat with and without AGEGP added to the model:
Based on the calculations, no_agegp and with-agegp they both have values of 1. This suggests that the odds ratios for cathigh vs. low levels in predicting CHD are 1 in both models. This suggests that there’s no difference in the odds of CHD between individuals with high and low cat levels. As a result, cat does not affect CHD values and they are not related. In addition, adding the factor of age group (agegp) also doesn’t change the odds ratio for CHD ( it remains 1). As a result, agegp also doesn’t affect chd and it’s not a significant cofounding variable in the relation between cat and CHD.
Q2:
The probability of coronary heart disease (CHD) for a person with high and low levels of CAT:
Model_1 <-glm(chd ~ cat, family =binomial(link ="logit"), data = chd)prob_low <-predict(Model_1, newdata =data.frame(cat =factor("low", levels =levels(chd$cat))), type ="response")prob_high <-predict(Model_1, newdata =data.frame(cat =factor("high", levels =levels(chd$cat))), type ="response")prob_low
1
0.5
prob_high
1
0.5
Based on the model, the probability of CHD for individuals with both low and high cat levels is 0.5. This result suggests that cat levels do not affect the likelihood of CHD, as the model cannot differentiate between low and high levels in terms of CHD risk.
cat_model <-glm(chd ~ cat, family =binomial(link ="logit"), data = chd)agegp_model <-glm(chd ~ agegp, family =binomial(link ="logit"), data = chd)ecg_model <-glm(chd ~ ECG, family =binomial(link ="logit"), data = chd)summary(cat_model)
Call:
glm(formula = chd ~ cat, family = binomial(link = "logit"), data = chd)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 1.110e-16 7.071e-01 0 1
cathigh -2.220e-16 1.000e+00 0 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 22.181 on 15 degrees of freedom
Residual deviance: 22.181 on 14 degrees of freedom
AIC: 26.181
Number of Fisher Scoring iterations: 2
summary(agegp_model)
Call:
glm(formula = chd ~ agegp, family = binomial(link = "logit"),
data = chd)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 1.110e-16 7.071e-01 0 1
agegp55+ -2.220e-16 1.000e+00 0 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 22.181 on 15 degrees of freedom
Residual deviance: 22.181 on 14 degrees of freedom
AIC: 26.181
Number of Fisher Scoring iterations: 2
summary(ecg_model)
Call:
glm(formula = chd ~ ECG, family = binomial(link = "logit"), data = chd)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 1.110e-16 7.071e-01 0 1
ECGabnormal -2.220e-16 1.000e+00 0 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 22.181 on 15 degrees of freedom
Residual deviance: 22.181 on 14 degrees of freedom
AIC: 26.181
Number of Fisher Scoring iterations: 2
Table <-data.frame(Comparison =c("High vs. Low CAT", "Age 55+ vs. Below 55", "Abnormal vs. Normal ECG"),Odds_Ratio =c(cat, agegp, ECG))Table
Comparison Odds_Ratio
cathigh High vs. Low CAT 1
agegp55+ Age 55+ vs. Below 55 1
ECGabnormal Abnormal vs. Normal ECG 1
Q4:
Complete_model <-glm(chd ~ cat + agegp + ecg, family =binomial(link ="logit"), data = chd)summary(Complete_model)
Call:
glm(formula = chd ~ cat + agegp + ecg, family = binomial(link = "logit"),
data = chd)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 1.11e-16 1.00e+00 0 1
cathigh -2.22e-16 1.00e+00 0 1
agegp55+ 0.00e+00 1.00e+00 0 1
ecgabnormal 0.00e+00 1.00e+00 0 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 22.181 on 15 degrees of freedom
Residual deviance: 22.181 on 12 degrees of freedom
AIC: 30.181
Number of Fisher Scoring iterations: 2
Null_model <-glm(chd ~1, family =binomial(link ="logit"), data = chd)summary(Null_model)
Call:
glm(formula = chd ~ 1, family = binomial(link = "logit"), data = chd)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -5.551e-17 5.000e-01 0 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 22.181 on 15 degrees of freedom
Residual deviance: 22.181 on 15 degrees of freedom
AIC: 24.181
Number of Fisher Scoring iterations: 2
Complete_liklihood <-anova(Null_model, Complete_model, test ="LRT")Complete_liklihood
Analysis of Deviance Table
Model 1: chd ~ 1
Model 2: chd ~ cat + agegp + ecg
Resid. Df Resid. Dev Df Deviance Pr(>Chi)
1 15 22.181
2 12 22.181 3 -3.5527e-15
The likelihood ratio test shows no significant association between CHD and the variables (cat, agegp, and ecg). The variables do not improve the model’s ability to explain the likelihood of CHD compared to a model without any predictors. Therefore, the overall significance of the model is not statistically significant.
The downloaded binary packages are in
/var/folders/ml/9gd13rnj3h58_bnp0zq09v5r0000gn/T//RtmpGDymWo/downloaded_packages
library(epiDisplay)
Loading required package: foreign
Loading required package: survival
Loading required package: MASS
Loading required package: nnet
logistic.display(Complete_model)
Logistic regression predicting chd : yes vs no
crude OR(95%CI) adj. OR(95%CI)
serum catecholamine level: high vs low 1 (0.1409,7.0991) 1 (0.1409,7.0991)
agegp: 55+ vs below 55 1 (0.1409,7.0991) 1 (0.1409,7.0991)
ecg: abnormal vs normal 1 (0.1409,7.0991) 1 (0.1409,7.0991)
P(Wald's test) P(LR-test)
serum catecholamine level: high vs low 1 1
agegp: 55+ vs below 55 1 1
ecg: abnormal vs normal 1 1
Log-likelihood = -11.0904
No. of observations = 16
AIC value = 30.1807
Serum Catecholamine Level (High vs. Low):
Crude OR (Unadjusted): 1, (95% CI: 0.1409, 7.0991),
Adjusted OR: 1, (95% CI: 0.1409, 7.0991)
Age Group (55+ vs. Below 55):
Crude OR (Unadjusted): 1, (95% CI: 0.1409, 7.0991)
Adjusted OR: 1, (95% CI: 0.1409, 7.0991)
ECG (Abnormal vs. Normal):
Crude OR (Unadjusted): 1, (95% CI: 0.1409, 7.0991)
Adjusted OR: 1, (95% CI: 0.1409, 7.0991)
The odds of chd are the same for individuals with high and low serum catecholamine levels, as indicated by an OR of 1, indicating no significant association.
The odds of chd are the same for individuals aged 55 and above compared to those below 55, as shown by an OR of 1, indicating no significant association.
The odds of chd are the same for individuals with abnormal and normal ECG results, with no evidence of a significant association.
Q5:
install.packages("pROC")
The downloaded binary packages are in
/var/folders/ml/9gd13rnj3h58_bnp0zq09v5r0000gn/T//RtmpGDymWo/downloaded_packages
library(pROC)
Type 'citation("pROC")' for a citation.
Attaching package: 'pROC'
The following object is masked from 'package:epiDisplay':
ci
The following objects are masked from 'package:stats':
cov, smooth, var
predicted_probs <-predict(Complete_model, type ="response")
roc_curve <-roc(chd$chd, predicted_probs)
Setting levels: control = no, case = yes
Setting direction: controls < cases
auc_value <-auc(roc_curve) plot(roc_curve, main ="ROC Curve for CHD Prediction Model")text(0.5, 0.5, labels =paste("AUROC =", round(auc_value, 2)), pos =4, cex =1.2)
The ROC curve and an AUROC value of 0.5 indicate that the model lacks predictive power in distinguishing between individuals with and without chd condition.. An AUROC of 0.5 suggests that the model performs no better than random guessing, meaning it is equivalent to flipping a coin to predict CHD presence or absence. The ROC curve, which appears as a diagonal line, shows this by showing no improvement over chance. This outcome implies that the predictors in the model—catecholamine levels (cat), age group (agegp), and ECG status (ecg)—do not contribute meaningful information for predicting CHD in this dataset. Consequently, these variables are not effective discriminators of CHD risk, and alternative predictors may be necessary to improve the model’s predictive accuracy.
Q6:
install.packages("aplore3")
The downloaded binary packages are in
/var/folders/ml/9gd13rnj3h58_bnp0zq09v5r0000gn/T//RtmpGDymWo/downloaded_packages
library(aplore3)
icu
id sta age gender race ser can crn inf cpr sys hra pre type
1 4 Died 87 Female White Surgical No No Yes No 80 96 No Emergency
2 8 Lived 27 Female White Medical No No Yes No 142 88 No Emergency
3 12 Lived 59 Male White Medical No No No No 112 80 Yes Emergency
4 14 Lived 77 Male White Surgical No No No No 100 70 No Elective
5 27 Died 76 Female White Surgical No No Yes No 128 90 Yes Emergency
6 28 Lived 54 Male White Medical No No Yes No 142 103 No Emergency
7 32 Lived 87 Female White Surgical No No Yes No 110 154 Yes Emergency
8 38 Lived 69 Male White Medical No No Yes No 110 132 No Emergency
9 40 Lived 63 Male White Surgical No No No No 104 66 No Elective
10 41 Lived 30 Female White Medical No No No No 144 110 No Emergency
11 42 Lived 35 Male Black Medical No No No No 108 60 No Emergency
12 47 Died 78 Male White Medical No No Yes No 130 132 No Emergency
13 50 Lived 70 Female White Surgical Yes No No No 138 103 No Elective
14 51 Lived 55 Female White Surgical No No Yes No 188 86 Yes Elective
15 52 Died 63 Male White Medical No Yes Yes No 112 106 Yes Emergency
16 53 Lived 48 Male Black Surgical Yes No No No 162 100 No Elective
17 58 Lived 66 Female White Surgical No No No No 160 80 Yes Elective
18 61 Lived 61 Female White Medical No Yes No No 174 99 No Emergency
19 73 Lived 66 Male White Medical No No No No 206 90 No Emergency
20 75 Lived 52 Male White Surgical No No Yes No 150 71 Yes Elective
21 82 Lived 55 Male White Surgical No No Yes No 140 116 No Elective
22 84 Lived 59 Male White Medical No No Yes No 48 39 No Emergency
23 92 Lived 63 Male White Medical No No No No 132 128 Yes Emergency
24 96 Lived 72 Male White Surgical No No No No 120 80 Yes Elective
25 98 Lived 60 Male White Medical No No Yes Yes 114 110 No Emergency
26 100 Lived 78 Male White Surgical No No No No 180 75 No Elective
27 102 Lived 16 Female White Medical No No No No 104 111 No Emergency
28 111 Lived 62 Male White Surgical No Yes No No 200 120 No Elective
29 112 Lived 61 Male White Medical No No Yes No 110 120 No Emergency
30 127 Died 19 Male White Surgical No No No No 140 76 No Emergency
31 136 Lived 35 Male White Medical No No No No 150 98 No Emergency
32 137 Lived 74 Female White Surgical No No No No 170 92 No Elective
33 143 Lived 68 Male White Surgical No No No No 158 96 No Elective
34 145 Died 67 Female White Medical No No Yes No 62 145 No Emergency
35 153 Lived 69 Female White Surgical No No No No 132 60 No Emergency
36 154 Died 53 Female White Medical No No Yes No 148 128 No Emergency
37 165 Died 92 Male White Medical No No Yes No 124 80 No Emergency
38 170 Lived 51 Male White Medical No No No No 110 99 No Emergency
39 173 Lived 55 Male White Surgical No No No No 128 92 No Elective
40 180 Lived 64 Female Other Surgical No No Yes No 158 90 Yes Emergency
41 184 Lived 88 Female White Surgical No No Yes No 140 88 Yes Emergency
42 186 Lived 23 Female White Surgical No No No No 112 64 No Emergency
43 187 Lived 73 Female White Surgical Yes No No No 134 60 No Elective
44 190 Lived 53 Male Other Surgical No No No No 110 70 Yes Elective
45 191 Lived 74 Male White Surgical No No No No 174 86 No Elective
46 195 Died 57 Male White Medical No No Yes Yes 110 124 No Emergency
47 202 Died 75 Female White Surgical Yes No No No 130 136 No Elective
48 204 Died 91 Male White Medical No No Yes No 64 125 No Emergency
49 207 Lived 68 Male White Surgical No No No No 142 89 No Elective
50 208 Died 70 Male White Surgical No No No No 168 122 No Elective
51 211 Lived 66 Female White Medical No No Yes No 170 95 Yes Emergency
52 214 Lived 60 Male White Surgical Yes No Yes No 110 92 No Elective
53 219 Lived 64 Male White Surgical No No Yes No 160 120 No Elective
54 222 Died 88 Male White Medical No No Yes Yes 141 140 No Emergency
55 225 Lived 66 Male Black Surgical Yes No Yes No 150 120 No Elective
56 237 Lived 19 Female White Surgical No No Yes No 142 106 No Emergency
57 238 Died 41 Male White Surgical No No Yes No 140 58 No Emergency
58 241 Died 61 Male White Medical No No No No 140 81 No Emergency
59 247 Lived 18 Female White Medical No No No No 146 112 No Emergency
60 249 Lived 63 Male White Surgical No No Yes No 162 84 Yes Emergency
61 260 Lived 45 Male White Medical No No No No 126 110 No Emergency
62 266 Lived 64 Male White Medical No No No No 162 114 No Emergency
63 271 Lived 68 Female White Medical No No Yes No 200 170 Yes Emergency
64 273 Died 80 Male White Surgical No No No No 100 85 No Emergency
65 276 Lived 64 Female White Medical No No Yes No 126 122 No Emergency
66 277 Lived 82 Male White Surgical No No No No 135 70 No Elective
67 278 Lived 73 Male White Surgical No No No No 170 88 No Elective
68 282 Lived 70 Male White Medical No No No No 86 153 Yes Emergency
69 285 Died 40 Male White Medical No No Yes No 86 80 Yes Emergency
70 292 Lived 61 Male White Surgical No No Yes No 68 124 No Emergency
71 295 Lived 64 Male White Surgical Yes No Yes No 116 88 No Elective
72 297 Lived 47 Male White Surgical Yes No Yes No 120 83 No Elective
73 298 Lived 69 Male White Surgical No No No No 170 100 No Elective
74 299 Died 75 Male White Medical No No Yes No 90 100 No Emergency
75 308 Lived 67 Female White Medical No No Yes No 190 125 No Emergency
76 310 Lived 18 Male White Surgical Yes No No No 156 99 No Elective
77 319 Lived 77 Male White Surgical No No Yes No 158 107 No Elective
78 327 Lived 32 Male Black Surgical No No No No 120 84 No Emergency
79 331 Died 63 Female White Surgical No Yes Yes Yes 36 86 No Emergency
80 333 Lived 19 Female White Surgical No No Yes No 104 121 Yes Elective
81 335 Lived 72 Female White Surgical No No No No 130 86 No Emergency
82 343 Lived 49 Male White Medical No No Yes No 112 112 No Emergency
83 346 Died 75 Female White Medical Yes No No No 190 94 No Emergency
84 357 Lived 68 Female White Surgical No No No No 154 74 No Elective
85 362 Lived 82 Male White Surgical No Yes Yes No 130 131 No Emergency
86 365 Lived 32 Female Other Medical No No Yes Yes 110 118 No Emergency
87 369 Lived 78 Female White Surgical No No Yes No 126 96 No Emergency
88 370 Lived 57 Male White Medical No No Yes No 128 104 No Emergency
89 371 Lived 46 Female White Surgical Yes No No No 132 90 No Emergency
90 376 Lived 23 Male White Medical No No Yes No 144 88 No Emergency
91 378 Lived 55 Male White Medical No No No No 132 112 No Emergency
92 379 Lived 18 Male White Surgical No No No No 112 76 No Emergency
93 380 Died 20 Male White Surgical No No No No 148 72 No Emergency
94 381 Lived 20 Male White Surgical No No No No 164 108 No Emergency
95 382 Lived 75 Female White Surgical No No No No 100 48 No Elective
96 384 Died 71 Male White Medical No No No No 142 95 No Emergency
97 398 Lived 79 Male White Surgical No No Yes No 112 67 No Elective
98 401 Lived 40 Male White Surgical No No No No 140 65 No Emergency
99 409 Lived 76 Male White Surgical No No Yes No 110 70 No Emergency
100 412 Died 51 Female White Surgical No No Yes No 134 100 Yes Emergency
101 413 Lived 66 Female White Surgical No No Yes No 139 92 No Elective
102 416 Lived 76 Male White Medical No No Yes No 190 100 No Emergency
103 427 Died 65 Male White Medical No No No No 66 94 No Emergency
104 438 Lived 80 Female White Surgical No No No No 162 44 No Emergency
105 439 Lived 23 Female White Medical No No Yes No 120 88 No Emergency
106 440 Lived 48 Male Black Surgical No No Yes No 92 162 Yes Emergency
107 442 Died 69 Female Other Medical No Yes No No 170 60 Yes Emergency
108 455 Lived 67 Male Black Surgical No No No No 90 92 Yes Elective
109 461 Died 55 Male White Surgical No Yes Yes No 122 100 Yes Emergency
110 462 Lived 69 Female White Surgical No No No No 150 85 No Emergency
111 468 Died 50 Female White Surgical Yes No No No 120 96 No Emergency
112 490 Died 78 Male White Medical No No Yes No 110 81 No Emergency
113 495 Lived 65 Male Other Surgical No No No No 208 124 No Elective
114 498 Lived 72 Male White Surgical No No No No 126 88 No Elective
115 502 Lived 55 Male White Medical No No No No 190 136 No Emergency
116 505 Lived 40 Male White Medical No No No No 130 65 No Emergency
117 508 Lived 55 Female White Medical No No Yes No 110 86 No Emergency
118 517 Lived 34 Male White Surgical No No No No 110 80 No Emergency
119 518 Died 71 Female White Medical No No No Yes 70 112 No Emergency
120 522 Lived 47 Female White Surgical No No No No 132 68 No Emergency
121 525 Lived 41 Female White Medical No No Yes No 118 145 No Emergency
122 526 Lived 84 Female White Medical No Yes Yes No 100 103 No Emergency
123 546 Lived 88 Female White Surgical No No No No 110 46 Yes Elective
124 548 Lived 77 Female White Surgical Yes No No No 212 87 No Elective
125 550 Lived 80 Male White Medical No No No No 122 126 No Emergency
126 552 Lived 16 Male White Surgical No No No No 100 140 No Emergency
127 560 Lived 70 Male White Surgical No No No No 160 60 No Elective
128 563 Lived 83 Female White Surgical No No Yes No 138 91 No Emergency
129 573 Lived 23 Male Black Medical No No No No 130 52 No Emergency
130 575 Lived 67 Female White Medical No No No Yes 120 120 No Emergency
131 584 Lived 18 Male White Surgical Yes No No No 130 140 No Elective
132 597 Lived 77 Female White Medical No No Yes No 136 138 No Elective
133 598 Lived 48 Female White Medical No No No Yes 128 96 No Emergency
134 601 Lived 24 Female Black Medical No No No No 140 86 No Emergency
135 605 Lived 71 Female White Medical No No Yes No 124 106 No Emergency
136 607 Lived 72 Male White Surgical No No No No 134 60 No Emergency
137 611 Died 85 Female White Surgical No No No No 136 96 No Emergency
138 613 Died 75 Male White Medical No Yes Yes No 130 119 No Emergency
139 619 Lived 77 Female White Surgical No Yes No No 170 115 Yes Elective
140 620 Lived 60 Male White Surgical No No Yes No 124 135 No Emergency
141 639 Lived 46 Male White Surgical Yes No No No 110 128 No Elective
142 644 Lived 65 Female White Medical No No No No 100 105 No Emergency
143 645 Lived 36 Male White Medical No No No No 224 125 No Emergency
144 648 Lived 68 Male White Surgical No No No No 112 64 No Elective
145 655 Lived 58 Male White Medical No No No No 154 98 No Emergency
146 659 Lived 76 Female White Medical No No Yes No 92 112 No Emergency
147 666 Died 65 Female White Medical No No Yes Yes 104 150 No Emergency
148 669 Lived 41 Female Black Medical No No No No 110 144 No Emergency
149 670 Lived 20 Male Other Medical No No No No 120 68 No Emergency
150 671 Died 49 Male White Medical No No Yes Yes 140 108 No Emergency
151 674 Lived 91 Male White Medical No Yes Yes No 152 125 No Emergency
152 675 Lived 75 Male White Surgical No No No No 140 90 No Emergency
153 676 Lived 25 Female White Medical No No No No 131 135 No Emergency
154 706 Died 75 Female White Medical No Yes Yes Yes 150 66 No Emergency
155 709 Lived 70 Male White Medical No No Yes No 78 143 No Emergency
156 713 Lived 47 Male White Surgical No No No No 156 112 No Emergency
157 727 Lived 75 Male Other Surgical No No No No 144 120 No Emergency
158 728 Lived 40 Male Black Medical No No Yes No 160 150 Yes Emergency
159 732 Lived 71 Male White Medical No No Yes No 148 192 No Emergency
160 740 Died 72 Female White Medical No No No No 90 160 No Emergency
161 746 Lived 70 Female White Medical No No Yes No 90 140 No Emergency
162 749 Lived 58 Male White Surgical No No No No 148 95 Yes Emergency
163 751 Died 69 Male White Medical No Yes No No 80 81 No Emergency
164 752 Died 64 Male White Medical Yes No Yes No 80 118 No Emergency
165 754 Lived 54 Male White Surgical No No No No 136 80 No Elective
166 761 Lived 77 Male White Surgical No No No No 128 59 No Elective
167 763 Lived 55 Male White Surgical Yes No Yes No 138 140 No Elective
168 764 Lived 21 Male White Surgical No No No No 120 62 No Emergency
169 765 Lived 53 Male Black Medical No Yes No Yes 170 115 No Emergency
170 766 Lived 31 Female White Medical Yes Yes Yes Yes 146 100 No Emergency
171 772 Lived 71 Male White Surgical Yes No No No 204 52 No Elective
172 776 Lived 49 Male Black Medical No No No No 150 100 No Emergency
173 784 Lived 60 Female Black Medical No No Yes No 116 92 Yes Emergency
174 789 Died 60 Male White Medical No No Yes No 56 114 Yes Emergency
175 794 Lived 50 Male White Medical No No Yes No 156 99 No Emergency
176 796 Lived 45 Female White Surgical No No No No 132 109 No Emergency
177 809 Lived 21 Male White Surgical No No No No 110 90 No Emergency
178 814 Lived 73 Female White Surgical No No No No 130 83 No Emergency
179 816 Lived 28 Male White Surgical No No Yes No 122 80 Yes Elective
180 829 Lived 17 Male White Surgical No No No No 140 78 No Emergency
181 837 Lived 17 Female Other Medical No No No No 130 140 No Emergency
182 846 Lived 21 Female White Surgical No No No No 142 79 No Emergency
183 847 Lived 68 Female White Surgical Yes No No No 91 79 No Elective
184 863 Lived 17 Male Other Surgical No No No No 136 78 No Emergency
185 867 Lived 60 Male White Medical No No Yes No 108 120 No Emergency
186 871 Died 60 Male Other Surgical No Yes Yes No 130 55 No Emergency
187 875 Lived 69 Male White Surgical No No No No 169 73 No Emergency
188 877 Lived 88 Female White Medical No Yes No No 190 88 No Emergency
189 880 Lived 20 Male White Surgical No No No No 120 80 No Emergency
190 881 Lived 89 Female White Surgical No No No No 190 114 No Emergency
191 889 Lived 62 Female White Medical No No No No 110 78 No Emergency
192 893 Lived 46 Male White Medical No Yes Yes No 142 89 No Emergency
193 906 Lived 19 Male White Surgical No No Yes No 100 137 No Emergency
194 912 Lived 71 Male White Medical No No Yes No 124 124 No Emergency
195 915 Lived 67 Male White Surgical No No No No 152 78 No Elective
196 921 Died 50 Female Black Medical No No No No 256 64 No Emergency
197 923 Lived 20 Male White Surgical No No No No 104 83 No Emergency
198 924 Lived 73 Female Black Medical No Yes No No 162 100 No Emergency
199 925 Lived 59 Male White Medical No No No No 100 88 No Emergency
200 929 Lived 42 Male White Surgical No No No No 122 84 No Emergency
fra po2 ph pco bic cre loc
1 Yes <= 60 < 7.25 > 45 >= 18 <= 2.0 Nothing
2 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
3 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
4 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
5 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
6 Yes > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
7 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
8 No <= 60 >= 7.25 <= 45 < 18 <= 2.0 Nothing
9 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
10 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
11 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
12 No > 60 >= 7.25 <= 45 < 18 <= 2.0 Nothing
13 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
14 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
15 No <= 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
16 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
17 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
18 No > 60 < 7.25 <= 45 < 18 > 2.0 Nothing
19 No > 60 >= 7.25 <= 45 >= 18 > 2.0 Nothing
20 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
21 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
22 No <= 60 >= 7.25 > 45 < 18 <= 2.0 Coma
23 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
24 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
25 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
26 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
27 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
28 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
29 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
30 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
31 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
32 No > 60 >= 7.25 > 45 >= 18 <= 2.0 Nothing
33 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
34 No > 60 >= 7.25 <= 45 >= 18 > 2.0 Nothing
35 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
36 No > 60 < 7.25 > 45 >= 18 <= 2.0 Nothing
37 No > 60 >= 7.25 <= 45 < 18 <= 2.0 Nothing
38 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
39 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
40 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
41 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
42 Yes > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
43 No > 60 >= 7.25 > 45 >= 18 <= 2.0 Nothing
44 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
45 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
46 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Coma
47 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
48 No > 60 >= 7.25 > 45 >= 18 <= 2.0 Nothing
49 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
50 No <= 60 >= 7.25 <= 45 >= 18 <= 2.0 Stupor
51 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
52 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
53 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
54 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
55 No > 60 >= 7.25 > 45 >= 18 <= 2.0 Nothing
56 Yes > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
57 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Coma
58 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
59 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
60 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
61 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
62 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
63 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
64 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
65 No <= 60 >= 7.25 > 45 >= 18 <= 2.0 Nothing
66 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
67 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
68 No > 60 >= 7.25 > 45 >= 18 <= 2.0 Nothing
69 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
70 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
71 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
72 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
73 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
74 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Stupor
75 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
76 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
77 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
78 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
79 Yes > 60 >= 7.25 <= 45 >= 18 > 2.0 Coma
80 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
81 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
82 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
83 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
84 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
85 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
86 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
87 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
88 No > 60 >= 7.25 > 45 >= 18 <= 2.0 Nothing
89 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
90 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
91 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
92 Yes > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
93 Yes > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
94 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
95 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
96 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
97 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
98 Yes > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
99 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
100 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Stupor
101 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
102 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
103 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Coma
104 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
105 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
106 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
107 No <= 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
108 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
109 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
110 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
111 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
112 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
113 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
114 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
115 No <= 60 < 7.25 > 45 >= 18 <= 2.0 Nothing
116 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
117 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
118 Yes > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
119 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Coma
120 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
121 No > 60 < 7.25 <= 45 < 18 <= 2.0 Nothing
122 No > 60 >= 7.25 <= 45 < 18 > 2.0 Nothing
123 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
124 No > 60 >= 7.25 > 45 >= 18 <= 2.0 Nothing
125 No <= 60 >= 7.25 <= 45 < 18 <= 2.0 Nothing
126 Yes > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
127 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
128 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
129 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
130 No > 60 < 7.25 > 45 >= 18 <= 2.0 Nothing
131 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
132 No <= 60 < 7.25 > 45 >= 18 <= 2.0 Nothing
133 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
134 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
135 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
136 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
137 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
138 No > 60 < 7.25 <= 45 < 18 > 2.0 Nothing
139 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
140 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
141 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
142 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
143 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
144 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
145 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
146 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
147 No > 60 >= 7.25 > 45 >= 18 <= 2.0 Coma
148 No > 60 >= 7.25 <= 45 < 18 > 2.0 Nothing
149 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
150 No > 60 >= 7.25 <= 45 < 18 <= 2.0 Nothing
151 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
152 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
153 No > 60 >= 7.25 <= 45 < 18 <= 2.0 Nothing
154 No > 60 >= 7.25 <= 45 >= 18 > 2.0 Coma
155 No <= 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
156 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
157 No > 60 >= 7.25 <= 45 >= 18 > 2.0 Nothing
158 Yes > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
159 No <= 60 < 7.25 > 45 >= 18 <= 2.0 Nothing
160 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
161 No <= 60 >= 7.25 <= 45 < 18 <= 2.0 Nothing
162 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
163 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Coma
164 No <= 60 >= 7.25 <= 45 >= 18 > 2.0 Nothing
165 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
166 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
167 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
168 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
169 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
170 No > 60 < 7.25 > 45 >= 18 <= 2.0 Nothing
171 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
172 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
173 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
174 No > 60 < 7.25 <= 45 < 18 <= 2.0 Nothing
175 No <= 60 >= 7.25 > 45 >= 18 <= 2.0 Nothing
176 Yes > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
177 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
178 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
179 Yes > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
180 Yes > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
181 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
182 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
183 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
184 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
185 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
186 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Stupor
187 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
188 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
189 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
190 No > 60 >= 7.25 > 45 >= 18 <= 2.0 Coma
191 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
192 No > 60 < 7.25 <= 45 < 18 <= 2.0 Nothing
193 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
194 No <= 60 < 7.25 > 45 >= 18 <= 2.0 Nothing
195 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
196 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Stupor
197 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
198 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
199 No > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
200 Yes > 60 >= 7.25 <= 45 >= 18 <= 2.0 Nothing
model_icu <-glm(sta ~ age + gender + cpr + hra + loc + pre,family =binomial(link ="logit"), data = icu)
summary(model_icu)
Call:
glm(formula = sta ~ age + gender + cpr + hra + loc + pre, family = binomial(link = "logit"),
data = icu)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -4.274e+00 1.136e+00 -3.764 0.000168 ***
age 3.009e-02 1.290e-02 2.332 0.019692 *
genderFemale -2.795e-01 4.433e-01 -0.630 0.528441
cprYes 1.275e+00 7.831e-01 1.628 0.103570
hra 5.864e-03 7.604e-03 0.771 0.440559
locStupor 1.855e+01 1.052e+03 0.018 0.985934
locComa 2.823e+00 9.014e-01 3.132 0.001736 **
preYes 5.612e-01 5.329e-01 1.053 0.292263
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 200.16 on 199 degrees of freedom
Residual deviance: 153.07 on 192 degrees of freedom
AIC: 169.07
Number of Fisher Scoring iterations: 15
Based on the provided coefficients of each variable, “age” and “the”level of consciousness” are significantly associated with death at hospital discharge. As a result, based on age coefficient(3.009e-02), older patients have a higher likelihood of death and based on level of consciousness coefficient (2.823e+00), patients in a coma have significantly increased odds of death compared to those with normal consciousness.
Null Deviance: 200.16 on 199 degrees of freedom.
Residual Deviance: 153.07 on 192 degrees of freedom.