BookmarkSubscribeRSS Feed
SAScph
Fluorite | Level 6

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?

 

4 REPLIES 4
PeterClemmensen
Tourmaline | Level 20

What does your data look like?

SAScph
Fluorite | Level 6

its daily visitors and weather variables. I want to see if next days weather can determine next days visitors

Kurt_Bremser
Super User

Post a data step with datalines that reflects your dataset. Tell us which variables need to get a lead, and under what criteria (groups?)

Astounding
PROC Star

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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 4 replies
  • 468 views
  • 0 likes
  • 4 in conversation