BookmarkSubscribeRSS Feed
MikeA
Calcite | Level 5

Hello, 

 

I have an excel file with data for years 2017-2019. I want to import the excel file and train the 2017-18 data to predict for 2019, which is unknown. For example, if I want to predict weather college applicants  would accept an offer or not based on the 2017-18 profile, how could I go about that?  Can anyone please provide me with a sample code that I can use to perform such a task, by splitting the years into training and testing and how I may be able to put the variable for which I want the prediction? 

 

Thank you, 

 

2 REPLIES 2
PeterClemmensen
Tourmaline | Level 20

Hi @MikeA and welcome to the SAS Communities 🙂

 

A good place to start is the article Create training, validation, and test data sets in SAS

Reeza
Super User
You cannot use a standard test/train split when dealing with time series data because your splits need to be based on time. So you're looking for basic filters which can be accomplished via WHERE statements.

ie

where year in (2018, 2017);

or

where year = '2017-18';
Depending on your variable types.

Almost all procedures support a WHERE statement including a data step or proc sql.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 996 views
  • 4 likes
  • 3 in conversation