<?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: Proc Mixed - R-Squared in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-Mixed-R-Squared/m-p/639095#M30585</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15363"&gt;@SteveDenham&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I actually looked at the AIC as well! Maybe I should just focus on the AIC instead of the pseudo-R-squared because as you have stated the sum of squares is not what is being optimized in mixed models. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Brittney&lt;/P&gt;</description>
    <pubDate>Fri, 10 Apr 2020 23:19:49 GMT</pubDate>
    <dc:creator>bnd</dc:creator>
    <dc:date>2020-04-10T23:19:49Z</dc:date>
    <item>
      <title>Proc Mixed - R-Squared</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-Mixed-R-Squared/m-p/637361#M30496</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Is there a way to calculate the r-squared or pseudo-r-squared for proc mixed in SAS (models with fixed and random effects)? Or would it have to be hand calculated?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I saw one post that stated to run the null model and then the full-model and to look at the variance components.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any other thoughts, suggestions, or clarifications as to how to best calculate the r-squared when using proc mixed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 21:39:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-Mixed-R-Squared/m-p/637361#M30496</guid>
      <dc:creator>bnd</dc:creator>
      <dc:date>2020-04-03T21:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Mixed - R-Squared</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-Mixed-R-Squared/m-p/637526#M30497</link>
      <description>&lt;P&gt;There is no generally agreed upon way to compute R-squared for generalized linear models, such as PROC MIXED. A number of methods have been proposed, these all have certain advantages and certain disadvantages. Your favorite search engine will find many discussions about this.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Apr 2020 11:34:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-Mixed-R-Squared/m-p/637526#M30497</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-04-04T11:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Mixed - R-Squared</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-Mixed-R-Squared/m-p/638210#M30524</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks! There are many ways to compute the R-squared for multilevel models. I think I have found one that works well.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 00:51:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-Mixed-R-Squared/m-p/638210#M30524</guid>
      <dc:creator>bnd</dc:creator>
      <dc:date>2020-04-08T00:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Mixed - R-Squared</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-Mixed-R-Squared/m-p/638286#M30535</link>
      <description>&lt;P&gt;Would you care to share that method with the rest of us?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 11:30:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-Mixed-R-Squared/m-p/638286#M30535</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-04-08T11:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Mixed - R-Squared</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-Mixed-R-Squared/m-p/638288#M30536</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/313316"&gt;@bnd&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks! There are many ways to compute the R-squared for multilevel models. I think I have found one that works well.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, I agree with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15363"&gt;@SteveDenham&lt;/a&gt;, you need to explain what method you chose, and why, so we can all learn.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 11:32:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-Mixed-R-Squared/m-p/638288#M30536</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-04-08T11:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Mixed - R-Squared</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-Mixed-R-Squared/m-p/638856#M30566</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15363"&gt;@SteveDenham&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I chose this formula, R-squared = 1 - SSE_Model / SSE_IntOnly. SSE represents the sum of squared residuals from the model and SSE_IntOnly represents the sum of squared residuals from the intercept-only model. I chose this model because I was looking for a simple and less complicated formula to calculate the percent reduction in variance from the null model to the full model. I used the covariance parameter estimates table from proc mixed to calculate the R-squared.&amp;nbsp;&lt;A href="http://math.usu.edu/jrstevens/stat5200/25.Rsquare_Design.pdf" target="_blank"&gt;http://math.usu.edu/jrstevens/stat5200/25.Rsquare_Design.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not sure if I have explained this well! I am very new to calculating the R-squared for multilevel models. I am not sure if this approach is the best or if R-squared should even be calculated this way, but it was a simple formula for me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also found this formula, R-squared = SSR/CTSS, where the SSR is the reduction sums of squares due to the model over and above the mean and the CTSS is the corrected total sum of squares. I got the same percent reductions using this formula.&amp;nbsp;&lt;A href="http://animsci.agrenv.mcgill.ca/StatisticalMethodsII/drvpseudor.pdf" target="_blank"&gt;http://animsci.agrenv.mcgill.ca/StatisticalMethodsII/drvpseudor.pdf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Apr 2020 02:47:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-Mixed-R-Squared/m-p/638856#M30566</guid>
      <dc:creator>bnd</dc:creator>
      <dc:date>2020-04-10T02:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Mixed - R-Squared</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-Mixed-R-Squared/m-p/638987#M30580</link>
      <description>&lt;P&gt;While this works, remind yourself over and over that the sums of squares in a mixed model are NOT what is optimized.&amp;nbsp; It is a maximum likelihood method, and only in the fully balanced design with uncorrelated errors would the sums of squares be the same.&amp;nbsp; A good substitute might be to look at the AIC values and determine the amount of information retained from the null model in the fit model.&amp;nbsp; You could even put this on a relative basis. See the Wikipedia article on Akaike Information Criterion&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Akaike_information_criterion" target="_self"&gt;https://en.wikipedia.org/wiki/Akaike_information_criterion&lt;/A&gt;&amp;nbsp;, which is a very good summary and points out how to compare models and the caveats involved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Fri, 10 Apr 2020 14:59:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-Mixed-R-Squared/m-p/638987#M30580</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-04-10T14:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Mixed - R-Squared</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-Mixed-R-Squared/m-p/639095#M30585</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15363"&gt;@SteveDenham&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I actually looked at the AIC as well! Maybe I should just focus on the AIC instead of the pseudo-R-squared because as you have stated the sum of squares is not what is being optimized in mixed models. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Brittney&lt;/P&gt;</description>
      <pubDate>Fri, 10 Apr 2020 23:19:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-Mixed-R-Squared/m-p/639095#M30585</guid>
      <dc:creator>bnd</dc:creator>
      <dc:date>2020-04-10T23:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Mixed - R-Squared</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-Mixed-R-Squared/m-p/737935#M35835</link>
      <description>Hi Steve,&lt;BR /&gt;&lt;BR /&gt;Do you think likelihood ratio r-squared will be a better pseudo-r2 in mixed model, as described here &lt;A href="https://www.ars.usda.gov/ARSUserFiles/80000000/SpatialWorkshop/19kramersupplrsq.pdf" target="_blank"&gt;https://www.ars.usda.gov/ARSUserFiles/80000000/SpatialWorkshop/19kramersupplrsq.pdf&lt;/A&gt;?&lt;BR /&gt;&lt;BR /&gt;Also, the formula for likelihood ratio r-squared is Rlr = 1-exp(-2/n(LLM-LL0)). In the longitudinal data, do you know the "n" here should be the total person-year observations or just the total subjects included in the data set?&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Apr 2021 14:57:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-Mixed-R-Squared/m-p/737935#M35835</guid>
      <dc:creator>zjppdozen</dc:creator>
      <dc:date>2021-04-29T14:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Mixed - R-Squared</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-Mixed-R-Squared/m-p/738218#M35844</link>
      <description>&lt;P&gt;The Kramer paper looks quite good, and I can see some utility in the MLE based pseudo-R2.&amp;nbsp; However, you would have to be sure to change to an ML method from the standard REML methods used in MIXED and GLIMMIX, and that leads to biased estimates (as a simple example, compare the biased estimate of the variance (denominator=n) to the unbiased estimate (denominator = n-1), the proof that the biased estimate is the ML estimate is a pretty standard math stats course proof).&amp;nbsp; I think we are still looking for an appropriate approach to goodness of fit for REML mixed models.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW, the n in the formula is the total number of observations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Fri, 30 Apr 2021 16:44:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-Mixed-R-Squared/m-p/738218#M35844</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2021-04-30T16:44:30Z</dc:date>
    </item>
  </channel>
</rss>

