BookmarkSubscribeRSS Feed
LNA2021
Calcite | Level 5

Hi,

I'm trying to create a time-series database to use PROC ARIMA to evaluate the impact of the intervention on my data.

The problem is that I don't know how to create a point of change to examine the before and after intervention impact. I use the below syntax but it's not working, I get an error.

Could you please help with that?

 

Data Project;
Set Project_new (keep=BirthDate Outcome);
Trend =sum (Intck ("quarter", 2018-03-31, BirthDate, ”c”),
N_PreIntervention);
Intervention =max (0, Trend > N_PreIntervention );
TrendPre =max (0, Trend *(Not (Intervention)));
TrendPst =max (0, Trend * Intervention));

Run;

 

PROC SUMMARY data=Project_new (where = (0<= Trend<=47)) nway;

Var outcome;

Class Trend;

Id Intervention TrendPre TrendPst;

Output out=Quarterly_timeseries mean (outcome)= outcome  std (outcome)= Std_outcome;

Run;

4 REPLIES 4
Kurt_Bremser
Super User

Whenever you have problems with code, the log is essential (see Maxim 2). So please post your complete log by copy/pasting it into a box opened with this button:

Bildschirmfoto 2020-04-07 um 08.32.59.jpg

Kurt_Bremser
Super User

Please do NOT post pictures. Just copy/paste the log text into a code box, that's all.

The first ERROR message is very clear; fix that issue, and you may have fixed all.

ballardw
Super User

If you error involves this line:

Trend =sum (Intck ("quarter", 2018-03-31, BirthDate, ”c”),

and something about a value is not a date or valid that would be because if you want to specify a specific date in code the appearance is 'ddMONyy'd or 'ddMONyyyy'd, such as '31MAR2018'd. The quotes plus the d tell SAS that you intend to use a date value. ONLY  this format works for date literals because there just too many different arrangements that dates might appear as. SAS has chosen to recognize one so that it is consistent across preferences. 

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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
  • 4 replies
  • 590 views
  • 0 likes
  • 3 in conversation