BookmarkSubscribeRSS Feed
hwangnyc
Quartz | Level 8

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?

1 REPLY 1
ballardw
Super User

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?

 

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 638 views
  • 0 likes
  • 2 in conversation