Hi
I want to create a lead for next days observations in my varmax model. Not for forecasting but for predicting. How can this be done?
What does your data look like?
its daily visitors and weather variables. I want to see if next days weather can determine next days visitors
Post a data step with datalines that reflects your dataset. Tell us which variables need to get a lead, and under what criteria (groups?)
Since you've provided the idea of what your data looks like, I can provide the idea of what the program would look like.
data want;
set have;
set have (firstobs=2 keep=visitors weather rename=(visitors=nextday_visitors weather=nextday_weather));
run;
Since the final observation has no values for "next day", it should be thrown out. This program happens to accomplish that.
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!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.