BookmarkSubscribeRSS Feed
pmorel3
Obsidian | Level 7

Hello everyone,

I'm a beginner in sas and I'm wondering a question.

 

I have 10 models to estimate in order to say which is the correct one to predict returns (rp). Consequently, I decided to make 12 main comparisons (2 by 2) of my regression models by statistically comparing each time only my 2 intercepts (not the other betas coefficients) with tests. The trouble is I do not want to do this only with one returns serie but ultimately with around 2,000 (returns series). However, for now, I would like to make it as easy as I can. If I can do this on 1 serie, I can do it on 2,000.

 

So ultimately, I would like firstly to save on a distinct database all the parameters of my 10 regressions models (intercepts, bêtas coefficients, p-value, F-test, etc.). Secondly, I would like, for each model,to compute intercepts mean, intercepts percentiles, intercepts distribution, etc. Secondly, to know which model is correct to predict returns, I would like to compare 2 by 2 all of my 10 models by testing each time whether the 2 intercepts are statistically the same or not.

 

Please find below my 12 comparisons:

 

proc reg data=modelization outest=est; /*1*/
      M1: model rp=rm / selection=rsquare b best=1;
	  MFS1: model rp=rm rm_zdy rm_ztbl rm_ztms rm_zdfy / selection=rsquare b best=1;
   proc print data=est;
   run;

proc reg data=modelization outest=est; /*2*/
      M2: model rp=rm rmrsq / selection=rsquare b best=1;
      MFS2: model rp=rm rm_zdy rm_ztbl rm_ztms rm_zdfy rmrsq / selection=rsquare b best=1;
   proc print data=est;
   run;

proc reg data=modelization outest=est; /*3*/
	  M1: model rp=rm / selection=rsquare b best=1;
	  MPM10: model rp=rm rm_pred_mean / selection=rsquare b best=1;
proc print data=est;
   run;

proc reg data=modelization outest=est; /*4*/
	  M2: model rp=rm rmrsq / selection=rsquare b best=1;
	  MPM11: model rp=rm rm_pred_mean rmrsq / selection=rsquare b best=1;
proc print data=est;
   run;

proc reg data=modelization outest=est; /*5*/
	  M1: model rp=rm / selection=rsquare b best=1;
	  MCFG1: model rp=rm zdy ztbl ztms zdfy rm_zdy rm_ztbl rm_ztms rm_zdfy / selection=rsquare b best=1;
proc print data=est;
   run;

proc reg data=modelization outest=est; /*6*/
	  M2: model rp=rm rmrsq / selection=rsquare b best=1;
      MCFG2: model rp=rm zdy ztbl ztms zdfy rm_zdy rm_ztbl rm_ztms rm_zdfy rmrsq / selection=rsquare b best=1;
proc print data=est;
   run;

proc reg data=modelization outest=est; /*7*/
      M1: model rp=rm / selection=rsquare b best=1;
	  MPM20: model rp=pred_mean rm rm_pred_mean / selection=rsquare b best=1;
proc print data=est;
   run;

proc reg data=modelization outest=est; /*8*/
      M2: model rp=rm rmrsq / selection=rsquare b best=1;
      MPM21: model rp=pred_mean rm rm_pred_mean rmrsq / selection=rsquare b best=1;
proc print data=est;
   run;

proc reg data=modelization outest=est; /*9*/
	  MFS1: model rp=rm rm_zdy rm_ztbl rm_ztms rm_zdfy / selection=rsquare b best=1;
      MPM10: model rp=rm rm_pred_mean / selection=rsquare b best=1;
proc print data=est;
   run;

proc reg data=modelization outest=est; /*10*/
      MFS2: model rp=rm rm_zdy rm_ztbl rm_ztms rm_zdfy rmrsq / selection=rsquare b best=1;
      MPM11: model rp=rm rm_pred_mean rmrsq / selection=rsquare b best=1;
proc print data=est;
   run;

proc reg data=modelization outest=est; /*11*/
	  MCFG1: model rp=rm zdy ztbl ztms zdfy rm_zdy rm_ztbl rm_ztms rm_zdfy / selection=rsquare b best=1;
	  MPM20: model rp=pred_mean rm rm_pred_mean / selection=rsquare b best=1;
proc print data=est;
   run;

   proc reg data=modelization outest=est; /*12*/
	  MCFG2: model rp=rm zdy ztbl ztms zdfy rm_zdy rm_ztbl rm_ztms rm_zdfy rmrsq / selection=rsquare b best=1;
      MPM21: model rp=pred_mean rm rm_pred_mean rmrsq / selection=rsquare b best=1;    
   proc print data=est;
   run;

I hope that you can help me to write the codes relative to my goals.

Thank you,

1 REPLY 1
PaigeMiller
Diamond | Level 26

This is a duplication of a question asked in another thread, which I have attempted to answer (partially).

 

Let's keep all discussion in that other thread at https://communities.sas.com/t5/SAS-Programming/Significance-test-of-intercepts-difference/td-p/61994...

 

DO NOT REPLY HERE.

--
Paige Miller

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 519 views
  • 0 likes
  • 2 in conversation