Hello everyone,
I'm trying to run a cox model in order to check the probability of quitting a medical service. dependent variable is called MedicalService and is a dummy variable 1 = Patient used this service and 0 = otherwise. My independent variable is patient health performance and is a logged variable. If someone can help, I want to check whether i did things the correct way. First, I want to ask whether I can lagged variables when using stcox. Before running the model i created the lagged variables and then i stsetby dataset. My code looks like the following:
Then I run the following code for a cox model:
My results are as follows:
I want to ask whether this is the correct way in order to check the probability of quitting the service and how can I interpret these results. Thank you for your help
I'm trying to run a cox model in order to check the probability of quitting a medical service. dependent variable is called MedicalService and is a dummy variable 1 = Patient used this service and 0 = otherwise. My independent variable is patient health performance and is a logged variable. If someone can help, I want to check whether i did things the correct way. First, I want to ask whether I can lagged variables when using stcox. Before running the model i created the lagged variables and then i stsetby dataset. My code looks like the following:
Code:
g lagperformance = L.performance stset time, id(PatientId) failure(MedicalService==1)
Code:
eststo: stcox lagperformance
Code:
Cox regression -- Breslow method for ties No. of subjects = 18,632 Number of obs = 486,236 No. of failures = 17,947 Time at risk = 486236 LR chi2(1) = 267.60 Log likelihood = -158701.47 Prob > chi2 = 0.0000 _t Haz. Ratio Std. Err. z P>z [95% Conf. Interval] Lagperformance .0590522 .0103678 -16.12 0.000 .0418591 .083307