BookmarkSubscribeRSS Feed
drip_
Obsidian | Level 7

Hi all,

 

I'm running a robust regression (m estimation) and would like to put out t statistics and (adjusted) r^2 to a dataset similar to the "outest = ... tableout" option when using proc reg.

 

Is it possible to do this?

 

Thanks in advance!

6 REPLIES 6
PaigeMiller
Diamond | Level 26

I don't see any place where ROBUSTREG produces t-statistics. The R-squared can be obtained by

 

ods output goodfit=goodfit;

if the estimation method produces R-squared as a standard output (M estimation does).

--
Paige Miller
drip_
Obsidian | Level 7
Thanks for your answer! Is it also possible to have the adjusted R-squared as an output?
PaigeMiller
Diamond | Level 26

As far as I can see, ROBUSTREG does not produce adjusted R-squared, only R-squared. However, there's nothing stopping you from applying the adjusted R-squared formula to the actual R-squared if you want.

--
Paige Miller
sbxkoenk
SAS Super FREQ

Hello,

 

outest= option in PROC ROBUSTREG is like outest= option in PROC REG.
What are you missing in the former that you have in the latter?

data a (drop=i);
   do i=1 to 1000;
      x1=rannor(1234);
      x2=rannor(1234);
      e=rannor(1234);
      if i > 900 then y=100 + e;
      else y=10 + 5*x1 + 3*x2 + .5 * e;
      output;
   end;
run;

proc reg data=a outest=abc;
   model y = x1 x2;
run;

proc robustreg data=a method=m outest=xyz;
   model y = x1 x2;
run;
/* end of program */

 

Thanks,

Koen

drip_
Obsidian | Level 7
What I'm missing specifically is the t-stats, so far I have only been able to obtain R-squared
Rick_SAS
SAS Super FREQ

What you are asking for does not make sense, as stated.

For ordinary least-squares regression (OLS), the null hypothesis Beta_i = 0 is tested by using a t test.

But for M estimation, the test statistic for H0 is not t-distributed. Instead, you can test for Beta_i = 0 by using a robust version of the F test. The robust test statistic is distributed as a chi-square statistic. The details are provided in the doc: SAS Help Center: M Estimation

 

If your goal is to test the null hypothesis that Beta_i=0, then you can use the FWLS option on the PROC ROBUSTREG statement to display a table that shows the parameter estimates for the final weighted least squares fit. The following statements build on the program that @sbxkoenk provided:

proc robustreg data=a method=m outest=xyz FWLS;
   model y = x1 x2;
   ods output ParameterEstimatesF=PEFinal;
run;

proc print data=PEFinal;
run;

The ProbChiSq variable contains the p-values for the test statistic under the null hypothesis.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 6 replies
  • 505 views
  • 5 likes
  • 4 in conversation