I’m trying to create an analytic plan to populate the table below:
| Number of clients | Baseline (Entry into the Program) | Follow-up Average | ||||||
|
| No hospitalizations | 1+ hospitalizations | No hospitalizations | 1+ hospitalizations | ||||
|
| N | % | N | % | N | % | N | % |
Year of Follow-up |
|
|
|
|
|
|
|
|
|
2008 |
|
|
|
|
|
|
|
|
|
2009 |
|
|
|
|
|
|
|
|
|
2010 |
|
|
|
|
|
|
|
|
|
2011 |
|
|
|
|
|
|
|
|
|
2012 |
|
|
|
|
|
|
|
|
|
2013 |
|
|
|
|
|
|
|
|
|
The variables that I have are:
ID – an Identifier that separates each case
EventCode – The type of Event
EventCount – A Count of all events
EventDate – The date when the event occurred
EnrollmentDate – The date when the client was enrolled
Here is my plan so far:
Step 1 – Subset only “Hospitalizations” using the EventCode Variable.
Step 2 – Create a BaselineEventDate variable by using:
proc sort data= Events; by ID EventDate;
data Events2; set Events;
by childid AsthmaEventDate;
if first.childid then BaselineEventDate = AsthmaEventDate;
retain
BaselineEventDate
Run;
The issue I see with this approach is what happens if this person did not have a Hospitalizations at baseline but did have one at follow up? How should we approach this?
One would ask HOW do you get a followup without a baseline? If it is because the "baseline" would be in one year and the follow up in another year then you should decide if the followup should actually be assigned to the "baseline" year. That sort of a decision would be based on your business needs. If you expect follow ups for multiple years then I might suggest just getting the counts and don't worry about the "baseline".
Second, I note that you have a report column "Number of clients" but your Id says it is an identifier that separates each case. Could you possibly have a complication with Client and multiple cases?
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.