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. 

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 890 views
  • 0 likes
  • 3 in conversation