# Concordance of logistic regression and Cox ph?

I am new to survival analysis and have a very basic question regarding some preliminary results I have produced.

Using a dataset with a binary outcome, time to that outcome, as well as a continuous variable of interest I find that the variable of interest is strongly associated with the outcome using logistic regression, but is not associated with survival using Cox regression. The sample is around 1000 with around 150 outcomes.

Any thoughts are more than appreciated. Thanks.

• It might help if you could provide a bit more information about your project, in particular summaries of the actual results with the logistic and Cox regressions. Are there other variables included in your analyses besides the variable of interest?
– EdM
Oct 24, 2016 at 15:08
• Details of the censoring might help too as well as what @EdM suggestes Oct 24, 2016 at 15:28

If I understand you correctly, you have a data set of around 1000 individuals, each with a measurement of a variable of interest, followed for different lengths of time. About 150 individuals have an event, and the rest are thus censored.

A possible scenario is that individuals with a low value on the variable of interest are censored earlier for some reason. If they are censored before they get a chance to have the event, it might look like a low value on the variable of interest is associated with a lower risk of having the event in the logistic regression, but in the cox regression, there will be no such association. I'll give a fabricated example:

Consider we have a study of cohort of 60-year-olds. We measure their body mass index (BMI) at the start of the study (our variable of interest). We then follow the cohort and note a diagnosis of Alzheimer's dementia as the event (outcome). In the logistic regression we see that lower BMI is associated with dementia, but in the cox regression this association is not significant. The reason for this is that those in the cohort with high BMI (particularly those who are obese) have a much higher mortality between 60-70 due to cardiovascular disease associated with obesity, so many will die (which in this study equals being censored) before developing dementia which makes the dementia diagnoses more common in individuals with lower BMI even though there is no causal link.

Here is a quick simulation done in R. I simulate a cohort of 10000 individuals of the same age (say, 60), followed for 20 years. The outcome measure is Alzheimer disease, and the true hazard ratio of BMI is 1 (no effect). The competing risk event is death, and the hazard ratio of BMI is 1.2:

library(survival)
set.seed(1)
h1 <- 0.00003 # base hazard for dementia
h2 <- 0.00003 # base hazard for dying
b1 <- log(1.0) # log HR for BMI/dementia
b2 <- log(1.2) # Log Hazard Ratio for BMI/death
n <- 10000 # sample size
futime <- 20*365 # follow-up time of 20 years
id <- seq(1:n)
BMI <- rnorm(n,27,4)
hr.dementia <- exp((BMI-mean(BMI)) * b1)
hr.death <- exp((BMI - mean(BMI)) * b2)
time <- NULL
alzheimer <- NULL
for (i in 1:n) {
dementia <- which(rbinom(futime,1,h1*hr.dementia[i])==1)
death <- which(rbinom(futime,1,h1*hr.death[i])==1)
if (length(dementia)==0) {
dementia <- 99999
}
if (length(death)==0) {
death <- 99999
}
dementia <- min(dementia)
death <- min(death)
if (dementia < death) {
time[i] <- dementia
alzheimer[i] <- 1
}
if (death < dementia) {
time[i] <- death
alzheimer[i] <- 0
}
if (death == 99999 & dementia == 99999) {
time[i] <- futime
alzheimer[i] <- 0
}

}
df <- data.frame(id,BMI, time, alzheimer)


Now we'll run a logistic regression:

summary(glm(alzheimer ~ BMI, data=df, family=binomial))

Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -0.641915   0.173920  -3.691 0.000223 ***
BMI         -0.032803   0.006457  -5.080 3.77e-07 ***

exp(-0.032803)
[1] 0.9677292


We can see that the odds ratio of having Alzheimer dementia is 0.97 (per 1 point of BMI) with a p-value of far below 0.001. Now in the Cox regression model:

summary(coxph(Surv(time,alzheimer) ~ BMI, data=df))

coef exp(coef)  se(coef)      z Pr(>|z|)
BMI -0.007752  0.992278  0.005999 -1.292    0.196

exp(coef) exp(-coef) lower .95 upper .95
BMI    0.9923      1.008    0.9807     1.004


The HR is 0.99 but with confidence intervals overlapping 1 (no effect), and a corresponding p-value of 0.196.

So in this case, the competing risks scenario will make it look like there is a highly significant effect in the logistic regression model, but the Cox regression model will reveal that this is not the case.

There may of course be other reasons for an association between the variable of interest and observation time in the study, but I think it's likely that there is some sort of association between your variable of interest and the observation time in the study. If you could provide a bit more information about your study, we might better help you to understand what's going on.

• Thanks @JonB for the detailed and thoughtful reply. This has helped my conceptualization of the problem and survival analysis in general immensely! Indeed, there are reasons that individuals in my cohort might not record an outcome (hospitalization was what first jumped out at me), but after some thinking I realized that my problem was that I coded the censors as 0 instead of length of monitoring (rookie mistake). When I fixed that my variable of interest showed significance as expected. Thanks again for your help, and everyone else's comments. Oct 28, 2016 at 15:57