DATA Step, Macro, Functions and more

Analytic Plan - New Variable from Date

Reply
Contributor
Posts: 50

Analytic Plan - New Variable from Date

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?

Super User
Posts: 10,500

Re: Analytic Plan - New Variable from Date

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?

 

 

Ask a Question
Discussion stats
  • 1 reply
  • 157 views
  • 0 likes
  • 2 in conversation