Why do I get significantly different answers from the logistic regression and survival analyses? How can I fix this code?
Logistic regression:
logit1 <- glm(Hospitalization~ Age+Sex+Race_cat+Condition+Tobaco_Use+previous.positive+Vaccination_Category, data = dataset_D,family = "binomial")
status.top
top.headers “Vaccination Protection” “# of Individuals” “# Hospitalization (%)” “Adjusted Protection: Odds (95% CI)”
“Unvaccinated” “304326” “1228 (0.4%)” “Reference”
“Fully Vaccinated” “189331” “50 (0%)” “94.7 (93.0-96.0)”
Survival analysis:
dataset_D$survival.time = as.numeric((dataset_D$Hos_Admitted_Date )- date.start)
dataset_D$survival.time = ifelse(is.na(dataset_D$survival.time )== T|dataset_D$survival.time==0|dataset_D$survival.time<0,0.5,dataset_D$survival.time)
out1 = coxph(Surv(survival.time,Hospitalization) ~ Age+Sex+Race_cat+Condition+Tobaco_Use+previous.positive+Vaccination_Category,data=dataset_D)
status.top
top.headers “Vaccination Protection” “# of Individuals” “# Hospitalization (%)” “Adjusted Protection: Odds (95% CI)”
“Unvaccinated” “304326” “1228 (0.4%)” “Reference”
“Fully Vaccinated” “189331” “50 (0%)” “57.6 (43.6-68.2)”
I expected the results to be similar from both methods. But the results were completely different. How can I fix this? Or is it something expected from logistic regression and survival analysis?