Hi everyone-
I am currently doing a simple linear regression of a variable over time. My date format right now is in the format (mmddyyyy) [no forward slashes, no letters]. Whenever I try to include a "where" statement when I do proc reg, errors come up. Can anyone help with this? I have included two of the codes that I have tried below:
PROC REG DATA=work.ELYRIA PLOTS = (FITPLOT);
where '03/24/2021'd <= sasdate <= '04/25/2021'd ;
MODEL LOGMGC = sasdate;
RUN;
or
PROC REG DATA=work.ELYRIA PLOTS = (FITPLOT);
where 03/24/2021'd <= sasdate <= 04/25/2021 ;
MODEL LOGMGC = sasdate;
RUN;
A SAS date literal must be in the form
"DDMMMYYYY"d
where DD is the day of the month, MMM the three-letter month abbreviation (e.g JAN for January), and YYYY is the year. Therefore, your WHERE statement must be
where "24mar2021"d <= sasdate <= "25apr2021"d;
A SAS date literal must be in the form
"DDMMMYYYY"d
where DD is the day of the month, MMM the three-letter month abbreviation (e.g JAN for January), and YYYY is the year. Therefore, your WHERE statement must be
where "24mar2021"d <= sasdate <= "25apr2021"d;
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
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.