BookmarkSubscribeRSS Feed
ombra3d
Calcite | Level 5

Hi everyone!

I'm running a weighted linear regression with the following code;

 

proc reg data=mydata ;
weight variance;
model sur_estim_y= sur_estim_x;
run;

 

I want to obtain the 95%CI of the Rsquare estimate (or the standard dev of the Rsquare estimate)

In the manual I saw the possibility to compute 95%CI for the parameter estimates but not for the Rsquare.

Does anyone know how to do it? 

Thanks a lot

5 REPLIES 5
PaigeMiller
Diamond | Level 26

This is what I found: https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwjngf_OgKT9A...

 

R-squared is simple the square of the correlation coefficient, which is what this paper gets confidence intervals for.

--
Paige Miller
ombra3d
Calcite | Level 5

Thanks a lot! 

I used proc corr and obtained the same Rsquare as from proc reg (corr coefficent **2) 

However i'm not sure I how to use standard error from the corr coefficent  to compute 95%CI for the Rsquare estimates

PaigeMiller
Diamond | Level 26

You obtain the confidence limits for the correlation coefficient r as shown in the article. Then you square them to get the confidence limits for R-squared.

--
Paige Miller
Ksharp
Super User

Yes. RSquare is just the square of correlation between Y and Yhat(Y predicted value).

You could use fisher options of PROC CORR to get its CI .

 

proc reg data=sashelp.class  ;
weight age;
model weight= height;
output out=want predicted=p;
quit;




ods output FisherPearsonCorr=FisherPearsonCorr;
proc corr data=want outp=outp fisher;
var weight;
with p;
weight age;
run;

data FisherPearsonCorr;
 set FisherPearsonCorr;
RSquare=Corr**2;
lcl_rsquare=lcl**2;
ucl_rsquare=ucl**2;
run;

proc print noobs;run;

Ksharp_0-1676897747357.png

 

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 319 views
  • 0 likes
  • 3 in conversation