I'm using sas on demand for my project. Here is all my code:
PROC IMPORT DATAFILE="/home/khalillx0/sasuser.v94/project1data.csv"
OUT= project1
DBMS=csv REPLACE;
RUN;
ods listing;
proc contents;
run;
data one;
set project1;
pce0 = PCE/78.23517;
rpgas = Price/pce0;
logrpgas= log(rpgas);
logconsumption=log(consumption);
logincome=log(income);
num_mon= month (observation_date);
If num_mon=1 then dumjan=1; else dumjan=0;
If num_mon=2 then dumfeb=1;else dumfeb=0;
If num_mon=3 then dummar=1;else dummar=0;
If num_mon=4 then dumapr=1;else dumapr=0;
If num_mon=5 then dummay=1;else dummay=0;
If num_mon=6 then dumjun=1;else dumjun=0;
If num_mon=7 then dumjul=1;else dumjul=0;
If num_mon=8 then dumaug=1;else dumaug=0;
If num_mon=9 then dumsep=1; else dumsep=0;
If num_mon=10 then dumoct=1; else dumoct=0;
If num_mon=11 then dumnov=1; else dumnov=0;
If num_mon=12 then dumdec=1; else dumdec=0;
proc print;
run;
proc means;
var consumption income Oneyear Tenyear Unemployment rpgas PCE_lag;
run;
proc means;
var consumption income Oneyear Tenyear Unemployment rpgas PCE_lag;
where observation_date between '01Nov1975'd and '30Nov1980'd;
run;
proc means;
var consumption income Oneyear Tenyear Unemployment rpgas PCE_lag;
where observation_date between '01Mar2001'd and '30Mar2006'd;
run;
proc means;
var consumption income Oneyear Tenyear Unemployment rpgas PCE_lag;
where observation_date between '01Nov2013'd and '30Nov2018'd;
run;
symbol1 i=join c=black;
symbol2 i=join c=blue;
symbol3 i=join c=green;
proc gplot;
plot consumption*observation_date=1;
plot PCE_lag*observation_date=2;
plot income*observation_date=3;
run;
proc reg;
where '01Nov1975'd <= observation_date <= '30Nov1980'd;
model logconsumption = rpgas income;
run;
proc reg;
where '01Mar2001'd <= observation_date <= '31Mar2006'd;
model logconsumption = rpgas income;
run;
Then I get this error message for the last two proc reg demands:
I suspect you might be getting this problem:
http://support.sas.com/kb/49/421.html
Try the suggestions in this SAS note and let us know how you get on.
It might be that SGprint is a SAS filename that points to an invalid directory. Try redefining it to a writable location
filename SGprint "/home/khalillx0/sasuser.v94";
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.