Hi all,
My goal is to calculate time (days) from admission to the time a patient first received a surgical procedure, specifically, days from admission to the first "skin graft" performed for those who received this surgery. It seems straightforward, but allow me to explain this question which is actually a bit complicated.
In the NIS database, there are 25 procedure variables (PR1, PR2,..., PR25) for procedure coding (using ICD-10). And for each procedure variable, there is a corresponding variable indicating the days from admission to the time that procedure is performed (PRDAY1, PRDAY2,...,PRDAY25).
There are actually multiple ICD-10 codes for "skin graft". For example, "0HR0X73", "0HR1X73",...,"0HR7X73", and "0HR8X73" all mean "skin grafts", and they could be coded in any of the 25 procedure variables (PR1 - PR25).
We can imagine a scenario where a patient was coded "0HR0X73" in PR1 variable with "3" in the corresponding PRDAY1 variable and also coded "0HR1X73" in PR2 variable with "5" in the corresponding PRDAY2 variable. It means that this patient received a skin graft surgery on day 3 after admission and another skin graft surgery on day 5. Since my goal is to capture the time the first skin graft was performed, I would like to generate 2 variables, with one indicating that the patient received this procedure and the other one indicating it's day 3.
I am able to generate a variable indicating whether a patient received this procedure using the following codes, but I couldn't figure out a way to generate a variable indicating the time it's first performed.
gen Skingraft=0
forvalues j=1/25{
replace Skingraft=1 if inlist(PR`j', 0HR0X73", "0HR1X73",...,"0HR7X73", "0HR8X73" )
}
Thank in advance!
Related Posts with Calculate days from hospital admission to a procedure using National Inpatient Sample (NIS)
AverageHow should I proceed in the following situation: - I have the earnings of population in 2004 and 200…
Too many values error when trying using tabulate commandHi I am trying to create a table showing the distribution of age of first marriage across many diffe…
Two way graphsHello, I want to make of the assets turnover of two industries by semester in a way that in the grap…
Understanding Monte Carlo simulations in "When Should You Adjust Standard Errors for Clustering?" (Abadie at al, 2017)Hi statalist members, This is my first post here so pardon me if I deviate from the established eti…
Sample Cross-CorrelationDear All, I am currently working on an event-study related topic and stumbled accross a significance…
Subscribe to:
Post Comments (Atom)
0 Response to Calculate days from hospital admission to a procedure using National Inpatient Sample (NIS)
Post a Comment