<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: compute 95%CI of r square in proc reg in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/compute-95-CI-of-r-square-in-proc-reg/m-p/926127#M83429</link>
    <description>&lt;P&gt;Sorry. I have no idea about it.&lt;BR /&gt;If you want symmetric CI, you could try option "&amp;nbsp;fisher(BIASADJ= no) ". But that is still not get exact symmetric CI.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc reg data=sashelp.heart(obs=100)  ;
weight ageatstart;
model weight= height Diastolic Systolic;
output out=want predicted=p;
quit;




ods output FisherPearsonCorr=FisherPearsonCorr;
proc corr data=want outp=outp fisher(BIASADJ= no);
var weight;
with p;
weight ageatstart;
run;

data FisherPearsonCorr;
 set FisherPearsonCorr;
RSquare=Corr**2;
lcl_rsquare=lcl**2;
ucl_rsquare=ucl**2;

_lcl2=lcl_rsquare-RSquare;
_ucl2=ucl_rsquare-RSquare;

run;

proc print noobs;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1714202076041.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95969i7DD31D59506F3626/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1714202076041.png" alt="Ksharp_0-1714202076041.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Or you could try Bootstrap Method to get RSquare CI.&lt;BR /&gt;&lt;BR /&gt;Maybe &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt; &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13633"&gt;@StatDave&lt;/a&gt; knew something you want.&lt;/P&gt;</description>
    <pubDate>Sat, 27 Apr 2024 07:15:14 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2024-04-27T07:15:14Z</dc:date>
    <item>
      <title>compute 95%CI of r square in proc reg</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/compute-95-CI-of-r-square-in-proc-reg/m-p/859684#M82504</link>
      <description>&lt;P&gt;Hi everyone!&lt;/P&gt;&lt;P&gt;I'm running a weighted linear regression with the following code;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc reg data=mydata ;&lt;BR /&gt;weight variance;&lt;BR /&gt;model sur_estim_y= sur_estim_x;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to obtain the 95%CI of the Rsquare estimate (or the standard dev of the Rsquare estimate)&lt;/P&gt;&lt;P&gt;In the manual I saw the possibility to compute 95%CI for the parameter estimates but not for the Rsquare.&lt;/P&gt;&lt;P&gt;Does anyone know how to do it?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2023 10:18:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/compute-95-CI-of-r-square-in-proc-reg/m-p/859684#M82504</guid>
      <dc:creator>ombra3d</dc:creator>
      <dc:date>2023-02-20T10:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: compute 95%CI of r square in proc reg</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/compute-95-CI-of-r-square-in-proc-reg/m-p/859688#M82505</link>
      <description>&lt;P&gt;This is what I found: &lt;A href="https://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=2ahUKEwjngf_OgKT9AhUDk4kEHXGVAWsQFnoECB0QAQ&amp;amp;url=https%3A%2F%2Fsupport.sas.com%2Fresources%2Fpapers%2Fproceedings%2Fproceedings%2Fsugi31%2F170-31.pdf&amp;amp;usg=AOvVaw3ySVR6exLvXq_1gDnwNZhz" target="_blank" rel="noopener"&gt;https://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=2ahUKEwjngf_OgKT9AhUDk4kEHXGVAWsQFnoECB0QAQ&amp;amp;url=https%3A%2F%2Fsupport.sas.com%2Fresources%2Fpapers%2Fproceedings%2Fproceedings%2Fsugi31%2F170-31.pdf&amp;amp;usg=AOvVaw3ySVR6exLvXq_1gDnwNZhz&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;R-squared is simple the square of the correlation coefficient, which is what this paper gets confidence intervals for.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2023 11:36:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/compute-95-CI-of-r-square-in-proc-reg/m-p/859688#M82505</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-02-20T11:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: compute 95%CI of r square in proc reg</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/compute-95-CI-of-r-square-in-proc-reg/m-p/859693#M82506</link>
      <description>&lt;P&gt;Calling&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13633"&gt;@StatDave&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2023 12:42:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/compute-95-CI-of-r-square-in-proc-reg/m-p/859693#M82506</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-02-20T12:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: compute 95%CI of r square in proc reg</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/compute-95-CI-of-r-square-in-proc-reg/m-p/859694#M82507</link>
      <description>&lt;P&gt;Thanks a lot!&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used proc corr and obtained the same Rsquare as from proc reg (corr coefficent **2)&amp;nbsp;&lt;/P&gt;&lt;P&gt;However i'm not sure I how to use standard error from the&amp;nbsp;corr coefficent&amp;nbsp; to compute 95%CI for the&amp;nbsp;Rsquare estimates&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2023 12:42:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/compute-95-CI-of-r-square-in-proc-reg/m-p/859694#M82507</guid>
      <dc:creator>ombra3d</dc:creator>
      <dc:date>2023-02-20T12:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: compute 95%CI of r square in proc reg</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/compute-95-CI-of-r-square-in-proc-reg/m-p/859695#M82508</link>
      <description>&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2023 12:47:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/compute-95-CI-of-r-square-in-proc-reg/m-p/859695#M82508</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-02-20T12:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: compute 95%CI of r square in proc reg</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/compute-95-CI-of-r-square-in-proc-reg/m-p/859698#M82509</link>
      <description>&lt;P&gt;Yes. RSquare is just the square of correlation between Y and Yhat(Y predicted value).&lt;/P&gt;
&lt;P&gt;You could use fisher options of PROC CORR to get its CI .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;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;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1676897747357.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/80599i5ED007B6FFF80227/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1676897747357.png" alt="Ksharp_0-1676897747357.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2023 12:56:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/compute-95-CI-of-r-square-in-proc-reg/m-p/859698#M82509</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-02-20T12:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: compute 95%CI of r square in proc reg</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/compute-95-CI-of-r-square-in-proc-reg/m-p/926012#M83426</link>
      <description>&lt;P&gt;I like the idea of calculating a confidence interval via the correlation coefficient, like Ksharp explained. However, after trying it out on a concrete example, I find that it does not correspond to another method to calculate the CI via calculating a standard error for the R2 estimate as explained here (for example):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://agleontyev.netlify.app/post/2019-09-05-calculating-r-squared-confidence-intervals/" target="_blank"&gt;https://agleontyev.netlify.app/post/2019-09-05-calculating-r-squared-confidence-intervals/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Notably, this method will result in a symetric CI around the R2 estimate, whereas the method via the correlation coefficient will not yield a symetric CI. So I am a bit confused as to what method should take precedence.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If anyone can shed light on this it would be greatly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;KR,&lt;/P&gt;
&lt;P&gt;Joakim&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2024 13:51:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/compute-95-CI-of-r-square-in-proc-reg/m-p/926012#M83426</guid>
      <dc:creator>JoakimE</dc:creator>
      <dc:date>2024-04-26T13:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: compute 95%CI of r square in proc reg</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/compute-95-CI-of-r-square-in-proc-reg/m-p/926021#M83427</link>
      <description>&lt;P&gt;Something else that might be of importance with the Proc Corr approach is weights are treated slightly differently than in Proc Reg.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In Proc Reg&lt;/P&gt;
&lt;PRE&gt;Values of the weight variable must be nonnegative. If an observation’s weight is zero, the observation &lt;BR /&gt;is deleted from the analysis. If a weight is negative or missing, it is set to zero, and the &lt;BR /&gt;observation &lt;STRONG&gt;is excluded&lt;/STRONG&gt; from the analysis. &lt;/PRE&gt;
&lt;P&gt;In Proc Corr&lt;/P&gt;
&lt;PRE&gt;The observations with missing weights are excluded from the analysis. &lt;BR /&gt;By default, for observations with nonpositive weights, weights are set to zero and the observations &lt;BR /&gt;&lt;STRONG&gt;are included&lt;/STRONG&gt; in the analysis. &lt;BR /&gt;You can use the EXCLNPWGT option to exclude observations with negative or zero weights from the analysis. &lt;/PRE&gt;
&lt;P&gt;If you have non-positive weights it looks like you need the EXCLNPWGT option to match the R-square from Reg&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2024 14:20:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/compute-95-CI-of-r-square-in-proc-reg/m-p/926021#M83427</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-04-26T14:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: compute 95%CI of r square in proc reg</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/compute-95-CI-of-r-square-in-proc-reg/m-p/926127#M83429</link>
      <description>&lt;P&gt;Sorry. I have no idea about it.&lt;BR /&gt;If you want symmetric CI, you could try option "&amp;nbsp;fisher(BIASADJ= no) ". But that is still not get exact symmetric CI.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc reg data=sashelp.heart(obs=100)  ;
weight ageatstart;
model weight= height Diastolic Systolic;
output out=want predicted=p;
quit;




ods output FisherPearsonCorr=FisherPearsonCorr;
proc corr data=want outp=outp fisher(BIASADJ= no);
var weight;
with p;
weight ageatstart;
run;

data FisherPearsonCorr;
 set FisherPearsonCorr;
RSquare=Corr**2;
lcl_rsquare=lcl**2;
ucl_rsquare=ucl**2;

_lcl2=lcl_rsquare-RSquare;
_ucl2=ucl_rsquare-RSquare;

run;

proc print noobs;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1714202076041.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95969i7DD31D59506F3626/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1714202076041.png" alt="Ksharp_0-1714202076041.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Or you could try Bootstrap Method to get RSquare CI.&lt;BR /&gt;&lt;BR /&gt;Maybe &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt; &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13633"&gt;@StatDave&lt;/a&gt; knew something you want.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Apr 2024 07:15:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/compute-95-CI-of-r-square-in-proc-reg/m-p/926127#M83429</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-04-27T07:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: compute 95%CI of r square in proc reg</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/compute-95-CI-of-r-square-in-proc-reg/m-p/926140#M83430</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;&amp;nbsp;this method will result in a symmetric CI around the R2 estimate, whereas the method via the correlation coefficient will not yield a symmetric CI. So I am a bit confused as to what method should take precedence.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that R-squared is always in the interval [0, 1], so you would not expect a symmetric CI for the R-squared statistic. The true sampling distribution of R-squared is not symmetric. The formula you quote (in Cohen's book, but actually from Olkin &amp;amp; Finn, 1995, which I have not read)&amp;nbsp;is a large-sample asymptotic approximation that assumes symmetry for the R-squared distribution. I would not use it unless the sample R-squared is far from 0 and 1, and the sample size is large.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the case of one regressor, you can use the connection between the regression R-squared value and the (squared) correlation coefficient. I think KSharp has the right idea.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Apr 2024 11:01:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/compute-95-CI-of-r-square-in-proc-reg/m-p/926140#M83430</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2024-04-27T11:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: compute 95%CI of r square in proc reg</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/compute-95-CI-of-r-square-in-proc-reg/m-p/926275#M83431</link>
      <description>&lt;P&gt;Thank you Rick for a clear and logical explanation. It makes sense to me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And thanks Ksharp for neat solution to the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;KR,&lt;/P&gt;
&lt;P&gt;Joakim&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2024 10:59:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/compute-95-CI-of-r-square-in-proc-reg/m-p/926275#M83431</guid>
      <dc:creator>JoakimE</dc:creator>
      <dc:date>2024-04-29T10:59:14Z</dc:date>
    </item>
  </channel>
</rss>

