Find sample data below.
An individual can have a kidney stone......
first treatment is is to monitor (1), if this fails - the patient can have a stent(2) and if this fails, procedure 3 (nephrostomy)
I would like to see the
individual (or rather individuals) who had procedure 1 and see if this has failed to become procedure 2 and subsequently if 2 has failed to become procedure 3.
The aim is to compare it to those individuals who have procedure (2) first and calculate the risk of failure to become procedure 3.
I can do the failure statistics, or rather survival statistics.
But I can not think of a way to create the data.
1. Should I create a new dataset?
2. Should I create a new variable; using - bys + date + laterality +mrn
It would be easier to have one row for each patient, generate a variable that indicates if the procedure (1) has failed to become (2) to become (3) .
However not sure if this is possible, perhaps an expert in data cleaning can help.
/mrn is the Scottish way for specifying patient identification number
Of course this data is falsified.
An individual can have a kidney stone......
first treatment is is to monitor (1), if this fails - the patient can have a stent(2) and if this fails, procedure 3 (nephrostomy)
I would like to see the
individual (or rather individuals) who had procedure 1 and see if this has failed to become procedure 2 and subsequently if 2 has failed to become procedure 3.
The aim is to compare it to those individuals who have procedure (2) first and calculate the risk of failure to become procedure 3.
I can do the failure statistics, or rather survival statistics.
But I can not think of a way to create the data.
1. Should I create a new dataset?
2. Should I create a new variable; using - bys + date + laterality +mrn
It would be easier to have one row for each patient, generate a variable that indicates if the procedure (1) has failed to become (2) to become (3) .
However not sure if this is possible, perhaps an expert in data cleaning can help.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float(procedure mrn gender age barcodeno fail laterality date2) 1 12 1 22 12 1 1 14641 2 12 1 25 17 1 1 15342 3 12 1 87 20 0 1 16805 2 103 2 90 76 1 2 16802 3 103 2 100 98 0 2 18295 1 65 2 87 90 0 2 17563 end format %td date2 label values gender f label def f 1 "male", modify label def f 2 "female", modify label values laterality right label def right 1 "Right", modify label def right 2 "left", modify
Of course this data is falsified.
Comment