BookmarkSubscribeRSS Feed
pmorel3
Obsidian | Level 7

I am a beginner in SAS.

 

I do not know how to keep all of my regression estimates in order to do my PROC test below.

Ultimately, 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. That's why I prefer to compute delta before.

 

But the trouble is I have 12 main comparisons of these models to do and I don't want to write manually each estimate to compute my delta for each comparison.

 

Can you help me to write a code in order to link automatically my PROC test and all the regression estimates I need to compute my delta ?

 

 

 

proc format;           
	picture stderrf (round)       
     	low-high=' 9.99)' (prefix='(')                                
            .=' '; 
run;

ods output ParameterEstimates (persist) = t;                        
                                                                    
proc reg data = modelization ;                                              
      M1: model rp=rm;
	  MFS1: model rp=rm rm_zdy rm_ztbl rm_ztms rm_zdfy;

      M2: model rp=rm rmrsq;
      MFS2: model rp=rm rm_zdy rm_ztbl rm_ztms rm_zdfy rmrsq;

	  MPM10: model rp=rm rm_pred_mean;
	  MPM11: model rp=rm rm_pred_mean rmrsq;

	  MCFG1: model rp=rm zdy ztbl ztms zdfy rm_zdy rm_ztbl rm_ztms rm_zdfy;
      MCFG2: model rp=rm zdy ztbl ztms zdfy rm_zdy rm_ztbl rm_ztms rm_zdfy rmrsq;

	  MPM20: model rp=pred_mean rm rm_pred_mean;
      MPM21: model rp=pred_mean rm rm_pred_mean rmrsq;
run;                                                                
                                                                    
ods output close;                                                   
                                                                    
proc print data=t;                                                  
run;

proc tabulate data=t noseps;      
  class model variable;                      
  var estimate stderr;     
  table variable=''*(estimate =' '*sum=' '                          
                     stderr=' '*sum=' '*F=stderrf.),                
         model=' '                                                  
          / box=[label="Parameter"] rts=15 row=float misstext=' '; 
run;

/*Example of only 1 comparison by computing delta: difference of intercepts to make a test of significativity */
data modelization;
set modelization;
intercept23 = rp + 0.27098*rm + 0.001889*zdy - 0.12634*ztbl - 0.23400*ztms - 0.38475*zdfy + 0.27095*rm_zdy + 6.88259*rm_ztbl + 3.89297*rm_ztms - 0.72923*rm_zdfy + 0.73268*rmrsq; 
intercept24 = rp + 0.10546*rm + 1.68536*pred_mean + 6.90634*rm_pred_mean + 0.26742*rmrsq;
delta12 = intercept23-intercept24;
run;

   proc univariate data=modelization;
	  var delta12;
	run;
1 REPLY 1
pmorel3
Obsidian | Level 7

Is PROC SCORE suitable here ?

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
  • 1 reply
  • 281 views
  • 0 likes
  • 1 in conversation