Sorry for being so persistent with this guys, but it's really bugging me.
I tried a different route to check the number of observations and HR, namely, instead of running "drop if", running "keep if" with obviously the values reversed. Hence, I used in one case I used:
As expected, this gave me the same number of observations and HR as when I ran "drop if" with the values reversed, but not the same as when I ran the syntax I had been using all along, namely:
You might be asking "well, why the hell you're using a database that includes a group of people you don't want to study and a type of condition you're not interested in", but the first version of the paper did include that type of condition and that group of people. Now that I'm not interested in them, however, it seems to be messing up my attempt to include the number of observations.
So it's kind of like a catch 22... if I drop them I'm afraid I will be getting a different number of observations and HR in the Cox Model. But if I don't drop that type of condition and group of people, I'm afraid the number of observations I'm getting corresponds to the whole database, not to the Cox model based on the type of condition and group of people I'm interested in.
Is there any way that type of condition and group of people are affecting my Cox model when building it using the if clause when generating the failure event?
PS: I posted the same issue here, http://stats.stackexchange.com/quest...if-clause-or-k and here https://www.reddit.com/r/stata/comme...when_using_if/
Yes, I'm that desperate... apologies for testing your patience, because I'm sure I'm missing something simple.
I tried a different route to check the number of observations and HR, namely, instead of running "drop if", running "keep if" with obviously the values reversed. Hence, I used in one case I used:
Code:
preserve keep if selforsalaried==2 keep if typecondition==1 gen evento1=. replace evento1=1 if conditiondays>0 & sex==1 & conditiondays!=. stset conditiondays if conditiondays<=550, failure(evento1==1) scale(1) xi: stcox i.year i.agegroup i.state i.industry i.contracttype i.incomegroup i.icd9, nolog restore
Code:
preserve gen evento1=. replace evento1=1 if conditiondays>0 & typecondition==1 & selforsalaried==2 & sex==1 & conditiongays!=. stset conditiondays if conditiondays<=550, failure(evento1==1) scale(1) xi: stcox i.year i.agegroup i.state i.industry i.contracttype i.incomegroup i.icd9, nolog restore
So it's kind of like a catch 22... if I drop them I'm afraid I will be getting a different number of observations and HR in the Cox Model. But if I don't drop that type of condition and group of people, I'm afraid the number of observations I'm getting corresponds to the whole database, not to the Cox model based on the type of condition and group of people I'm interested in.
Is there any way that type of condition and group of people are affecting my Cox model when building it using the if clause when generating the failure event?
PS: I posted the same issue here, http://stats.stackexchange.com/quest...if-clause-or-k and here https://www.reddit.com/r/stata/comme...when_using_if/
Yes, I'm that desperate... apologies for testing your patience, because I'm sure I'm missing something simple.
Comment