@rookie21 wrote:
The goal is to in the end to get on record pr patient - but first as you write: one record per patient per operation?
Does it make better sense now ?
Yes it makes better sense now. But I would probably go for one record per patient per operation, rather than a wide record with one patient and multiple operations. Perhaps as you move forward on this project, it will become more clear why we are recommending it this way.
To me, the "goal" is really to achieve some sort of meaningful analysis of the data. So, when you say the goal is a particular data layout (one record per patient, or one record per patient per operation), that is really a step along the way, not the goal. And depending on whether or not you take the proper steps along the way, you will have an easy path or a much more difficult path.
I am keeping it one record pr operation pr patient for now.
Truthfully thankful for the job u guys are doing.
Hopefully I'll get a better sense of when to do what with more experience
Each step right now is like a milestone, so thats a goal in itself. Getting to understand that these are just some groundwork before the real analysis starts
Thanks again for all the help !
Can each operation have multiple "leads"? What does "lead" mean? Are you collecting electrocardiograms during the operation?
Can each operation have multiple "leads"?
- Yes, each operation can have up till 3 leads
What does "lead" mean? Are you collecting electrocardiograms during the operation?
No, not electrocardiograms. Its implantation of heart devices. And leads are those wires which are put in the body.
So if I divide the variables into 4 levels. I have:
- a patient identifier: record
- operation information: id (unique for each operation) date (operation date)
- battery information: record_1 (actually copied from record), id_1 (copied from id above)
- lead/wire information: id_lead (unique for each implanted wire) and type_lead
Now I got the data to include one record pr operation pr patient. As the data was pivoted in three "extra" levels, I got a total of more than 500 variables.
I've used a datastep to clean it up a bit by using keep and drop statements.
Im doing some more coding to classify what happens at each operation.
After that I shall present my data with only one record pr patient in the study group.
Think I can use:
proc summary data = want;
by record ;
output out=one_line_pr_patient (drop=_type_) idgroup(out[1] ( id_1 -- type_lead_3 ) =);
run;
and then again clean it up a bit, so the variables with same contents is dropped.
Or is there a more "correct" way of specifing earlyer with variables (the string of lead information) that can get pivoted ?
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.