<?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: How to get confidence interval for root MSE in proc reg in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-get-confidence-interval-for-root-MSE-in-proc-reg/m-p/508158#M1608</link>
    <description>&lt;P&gt;Thank&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;, you understand my question more than what I wrote.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually, I am learning macro to simulate data and assess the performance of the model. I start with a linear regression model with one covariate. Three parameters are involved: intercept, slope, and sigma. I can do for beta's but for sigma I only know that root MSE is an estimate for sigma.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now you answer helps me to obtain the CI for sigma also. From that, I can compute the coverage probability, what I had done for beta's.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate your help!&lt;/P&gt;</description>
    <pubDate>Sun, 28 Oct 2018 20:12:25 GMT</pubDate>
    <dc:creator>trungdungtran</dc:creator>
    <dc:date>2018-10-28T20:12:25Z</dc:date>
    <item>
      <title>How to get confidence interval for root MSE in proc reg</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-get-confidence-interval-for-root-MSE-in-proc-reg/m-p/508104#M1600</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using proc reg, we can easily obtain the CI for beta parameters. One of the output now I would like to obtain the CI, that is the root MSE. Root MSE is an estimate for the standard deviation of the measurement errors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc reg data=lm1 plots=none;
Model y=x/clb;
Run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you tell me how to obtain the CI for it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MSE.png" style="width: 304px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24440i1FE8406D08AF0A14/image-size/large?v=v2&amp;amp;px=999" role="button" title="MSE.png" alt="MSE.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Trung Dung.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Oct 2018 12:08:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-get-confidence-interval-for-root-MSE-in-proc-reg/m-p/508104#M1600</guid>
      <dc:creator>trungdungtran</dc:creator>
      <dc:date>2018-10-28T12:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to get confidence interval for root MSE in proc reg</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-get-confidence-interval-for-root-MSE-in-proc-reg/m-p/508118#M1602</link>
      <description>&lt;P&gt;I'm not aware of a way to compute the confidence interval for root MSE in SAS. Apparently, Google is not aware of a way to do this either.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could always use bootstrap or jackknife methods to obtain confidence intervals for any estimate.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Oct 2018 14:56:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-get-confidence-interval-for-root-MSE-in-proc-reg/m-p/508118#M1602</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-10-28T14:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to get confidence interval for root MSE in proc reg</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-get-confidence-interval-for-root-MSE-in-proc-reg/m-p/508123#M1603</link>
      <description>&lt;P&gt;Yes, I did google and I cannot find anything like that, but at least I know that it is not an available option in SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your reply&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Oct 2018 15:07:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-get-confidence-interval-for-root-MSE-in-proc-reg/m-p/508123#M1603</guid>
      <dc:creator>trungdungtran</dc:creator>
      <dc:date>2018-10-28T15:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to get confidence interval for root MSE in proc reg</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-get-confidence-interval-for-root-MSE-in-proc-reg/m-p/508140#M1605</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/199021"&gt;@trungdungtran&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you say correctly, Root MSE is an estimate for the standard deviation &lt;FONT face="symbol"&gt;s&lt;/FONT&gt;&amp;nbsp;of the error term in the linear regression model. So, given this &lt;EM&gt;point&lt;/EM&gt; estimate, it's a reasonable question to ask for a &lt;EM&gt;confidence interval&lt;/EM&gt; estimate -- &lt;U&gt;for &lt;FONT face="symbol"&gt;s&lt;/FONT&gt;&lt;/U&gt;, not for Root MSE. (Edit: Note that this is perfectly analogous to the CIs you mentioned. They are for the &lt;EM&gt;true&lt;/EM&gt; parameters, not for the estimates.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Under the usual normality assumption, i.e., the error term has a normal distribution with mean 0 and standard deviation &lt;FONT face="symbol"&gt;s&lt;/FONT&gt;,&amp;nbsp;an exact confidence interval for &lt;FONT face="symbol"&gt;s&lt;/FONT&gt; can be computed easily from the error sum of squares, the corresponding degrees of freedom (see PROC REG output) and quantiles of the corresponding chi-square distribution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods output anova=anova(keep=source df ss where=(source='Error'))
           fitstatistics=fs(keep=label1 nvalue1 where=(label1='Root MSE') rename=(nvalue1=Root_MSE));

proc reg data=sashelp.class plots=none;
model weight=height / clb;
quit;

%let alpha=0.05;

data _null_;
set anova;
set fs;
lcl=sqrt(ss/cinv(1-&amp;amp;alpha/2,df)); /* lower (1-&amp;amp;alpha)*100% confidence limit for sigma */
ucl=sqrt(ss/cinv(&amp;amp;alpha/2,df));   /* upper (1-&amp;amp;alpha)*100% confidence limit for sigma */
put (lcl Root_MSE ucl) (=6.3);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;lcl=8.424 Root_MSE=11.226 ucl=16.830&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Reference: &lt;A href="https://www.wiley.com/en-us/Linear+Models-p-9780471184997" target="_blank"&gt;S.R. Searle, Linear Models&lt;/A&gt;&amp;nbsp;(cf. page 414, formula 59).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Still not convinced? Perform a simulation:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let alpha=0.05;
%let b0=-143;     /* (arbitrary) intercept */
%let b1=3.9;      /* (arbitrary) slope */
%let sigma=12.34; /* (arbitrary) error standard deviation */

/* Simulate 100000 datasets with WGT values calculated from HEIGHT 
   using a linear regression model */

data sim;
call streaminit(27182818);
set sashelp.class(keep=height);
do i=1 to 100000;
  wgt=&amp;amp;b0+&amp;amp;b1*height+rand('norm',0,&amp;amp;sigma);
  output;
end;
run;

proc sort data=sim;
by i;
run;

/* Perform regression analyses */

ods exclude all;
ods noresults;
ods output anova=anova(keep=i source df ss where=(source='Error'));
proc reg data=sim plots=none;
by i;
model wgt=height;
quit;
ods exclude none;
ods results;

/* Compute (1-&amp;amp;alpha)*100% confidence intervals for &amp;amp;sigma 
   and determine if true value is covered or not (c=1 | c=0) */

data chk;
set anova;
lcl=sqrt(ss/cinv(1-&amp;amp;alpha/2,df));
ucl=sqrt(ss/cinv(&amp;amp;alpha/2,df));
c=(lcl&amp;lt;=&amp;amp;sigma&amp;lt;=ucl);
run;

/* Estimate coverage probability */

ods exclude BinomialTest;
proc freq data=chk;
tables c / binomial(level='1');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;                              Cumulative    Cumulative
c    Frequency     Percent     Frequency      Percent
------------------------------------------------------
0        5025        5.03          5025         5.03
1       94975       &lt;FONT color="#008000"&gt;&lt;STRONG&gt;94.98&lt;/STRONG&gt;&lt;/FONT&gt;        100000       100.00


      Binomial Proportion
             c = 1

Proportion                0.9498
ASE                       0.0007
95% Lower Conf Limit      0.9484
95% Upper Conf Limit      0.9511

Exact Conf Limits
95% Lower Conf Limit      &lt;STRONG&gt;&lt;FONT color="#008000"&gt;0.9484&lt;/FONT&gt;&lt;/STRONG&gt;
95% Upper Conf Limit      &lt;STRONG&gt;&lt;FONT color="#008000"&gt;0.9511&lt;/FONT&gt;&lt;/STRONG&gt;

Sample Size = 100000&lt;/PRE&gt;
&lt;P&gt;The result is what you'd expect with a true 95% coverage probability.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Oct 2018 18:44:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-get-confidence-interval-for-root-MSE-in-proc-reg/m-p/508140#M1605</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-10-28T18:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to get confidence interval for root MSE in proc reg</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-get-confidence-interval-for-root-MSE-in-proc-reg/m-p/508158#M1608</link>
      <description>&lt;P&gt;Thank&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;, you understand my question more than what I wrote.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually, I am learning macro to simulate data and assess the performance of the model. I start with a linear regression model with one covariate. Three parameters are involved: intercept, slope, and sigma. I can do for beta's but for sigma I only know that root MSE is an estimate for sigma.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now you answer helps me to obtain the CI for sigma also. From that, I can compute the coverage probability, what I had done for beta's.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate your help!&lt;/P&gt;</description>
      <pubDate>Sun, 28 Oct 2018 20:12:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-get-confidence-interval-for-root-MSE-in-proc-reg/m-p/508158#M1608</guid>
      <dc:creator>trungdungtran</dc:creator>
      <dc:date>2018-10-28T20:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to get confidence interval for root MSE in proc reg</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-get-confidence-interval-for-root-MSE-in-proc-reg/m-p/508180#M1625</link>
      <description>&lt;P&gt;You're welcome,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/199021"&gt;@trungdungtran&lt;/a&gt;.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/199021"&gt;@trungdungtran&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Actually, I am learning macro to simulate data and assess the performance of the model.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Macros and simulation? Make sure you read Rick Wicklin's blog post &lt;A href="https://blogs.sas.com/content/iml/2012/07/18/simulation-in-sas-the-slow-way-or-the-by-way.html" target="_blank"&gt;"Simulation in SAS: The slow way or the BY way"&lt;/A&gt;&amp;nbsp;the sooner the better. (Quote: "&lt;STRONG&gt;Never use a macro loop to create a simulation&lt;/STRONG&gt;&lt;SPAN&gt;.") There's also a more specific&amp;nbsp;article in Rick's blog:&amp;nbsp;&lt;A href="https://blogs.sas.com/content/iml/2017/01/25/simulate-regression-model-sas.html" target="_blank"&gt;"Simulate data for a linear regression model"&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Oct 2018 21:54:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-get-confidence-interval-for-root-MSE-in-proc-reg/m-p/508180#M1625</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-10-28T21:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to get confidence interval for root MSE in proc reg</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-get-confidence-interval-for-root-MSE-in-proc-reg/m-p/509434#M1785</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp;for suggestion about the blog post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am learning macro so I take this as an exercise for me to practice.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 09:40:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-get-confidence-interval-for-root-MSE-in-proc-reg/m-p/509434#M1785</guid>
      <dc:creator>trungdungtran</dc:creator>
      <dc:date>2018-11-01T09:40:17Z</dc:date>
    </item>
  </channel>
</rss>

