I'm trying to run a very simple multilevel Cox proportional hazard model (stcox) and am getting "numerical derivatives are approximate; flat or discontinuous region encountered."
My command is:
stcox gender, shared(patient_id).
I'm using a reduced test dataset that has 1518 observations with 32 failures. I'm estimating the risk of a patient getting an infection (yes or no) during hospital stays. A patient can have more than one hospital stay, so hospital stays are the unit of analysis and stays are nested within patients. Only one hospital is involved.
I've tried specifying both efron and breslow to handle ties but the result is the same.
However, this model works:
stcox gender, vce(cluster patient_id).
But my understanding is that vce(cluster) may not be ideal and may violate the proportionality assumptions. From the STATA manual:
"One solution would be to fit a standard Cox model, adjusting the standard errors of the estimated hazard ratios to account for the possible correlation by specifying vce(cluster patient).
We could instead model the correlation by assuming that the correlation is the result of a latent patient-level effect, or frailty. That is, rather than fitting a standard model and specifying vce(cluster patient), we could fit a frailty model by specifying shared(patient)".
Any idea what could be causing this simple model to fail?
My command is:
stcox gender, shared(patient_id).
I'm using a reduced test dataset that has 1518 observations with 32 failures. I'm estimating the risk of a patient getting an infection (yes or no) during hospital stays. A patient can have more than one hospital stay, so hospital stays are the unit of analysis and stays are nested within patients. Only one hospital is involved.
I've tried specifying both efron and breslow to handle ties but the result is the same.
However, this model works:
stcox gender, vce(cluster patient_id).
But my understanding is that vce(cluster) may not be ideal and may violate the proportionality assumptions. From the STATA manual:
"One solution would be to fit a standard Cox model, adjusting the standard errors of the estimated hazard ratios to account for the possible correlation by specifying vce(cluster patient).
We could instead model the correlation by assuming that the correlation is the result of a latent patient-level effect, or frailty. That is, rather than fitting a standard model and specifying vce(cluster patient), we could fit a frailty model by specifying shared(patient)".
Any idea what could be causing this simple model to fail?

Comment