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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 741 views
  • 4 likes
  • 3 in conversation