BookmarkSubscribeRSS Feed
Grant001
Calcite | Level 5

Hello,

 

I have a panel data consisting data for four (4) different region (i.e. Canada, Hong Kong, New Zealand & UK). I would like to run an OLS time series regression for each individual region but I do not know how what specific codes to write.

 

Any suggestion will be much appreciated.

 

Best Regards,

Grant001.

4 REPLIES 4
Reeza
Super User

Here's some resources that may be helpful:

 

Linear Regression tutorial

https://stats.idre.ucla.edu/sas/webbooks/reg/chapter1/regressionwith-saschapter-1-simple-and-multipl...

 

Videos

http://video.sas.com/detail/videos/sas-analytics-u/video/3306911882001/simple-linear-regression-usin...

 

Documentation:

http://documentation.sas.com/?docsetId=statug&docsetTarget=statug_reg_gettingstarted01.htm&docsetVer...

More specifically, click on Examples to see fully worked examples. 

 

If you have specific questions feel free to post back, but please include more details, specifically, sample data or code and a clear explanation of your problem.

 

 

Grant001
Calcite | Level 5

Hi Reeze,

 

Thank you for your response.

 

My panel data-set is set up in this manner (picture attached below). What I really want to do is to run an individual OLS time series regression for Canada and then a separate OLS time series regression for Hong Kong, and so forth.

 

What may be the appropriate code to write in-order for SAS to filter down and run the regression for the specific region while leaving others out. 

 

Capture.PNG

Reeza
Super User

That's what BY group processing does. 

 

So once you have your model built, add a line that is :

 

By country;

And the regression will run for each country individually.

Grant001
Calcite | Level 5

Hi Reeza,

 

Thank you very much for your help.

 

Much appreciated.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1398 views
  • 2 likes
  • 2 in conversation