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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.