
Model Estimation using Logistic Regression summary(sepsis) # Shock Malnutrition Alcoholism Age Sepsis_alive <- subset(sepsis, sepsis$Death!= 1) # Now we get the subset of patients who are alive. Thus both alcoholism and malnutrtion are significantly associated with death when we test using the Odds ratio.Ĭalculating the association of age with death sepsis_death <- subset(sepsis, sepsis$Death= 1) # Subsetting a data to extract only the data of the patients who died. Hence odds ratio is a better statistic to report when we are looking for association between binary variables.Ĭalculate odds ratio for malnutrition or2 <- oddsratio( table(sepsis$Death, sepsis$Malnutrition), log = FALSE)Ĭalculate odds ratio for alcoholism or3 <- oddsratio( table(sepsis$Death, sepsis$Alcoholism), log = FALSE) If we have a 95% confidence interval, then we can also test for the significance of the model as if the lower bound of the 95% confidence interval excludes 1 (an odds ratio of 1 is the null hypothesis or H0) then we can reject the H0. Why is odds ratio a preferred statistic? As we get a number. # Pearson's Chi-squared test with Yates' continuity correction Chisquare for association chisq.test(sepdeath) # Warning in chisq.test(sepdeath): Chi-squared approximation may be incorrect #
