<?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: likelihood ratio test in mixed model in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/likelihood-ratio-test-in-mixed-model/m-p/921141#M45768</link>
    <description>&lt;P&gt;You can switch to METHOD=ML and compare the likelihoods if you use the same covariance structures in both models. The parameter estimates will change if you change the fixed effects. That is not unexpected.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 20 Mar 2024 16:35:57 GMT</pubDate>
    <dc:creator>StatsMan</dc:creator>
    <dc:date>2024-03-20T16:35:57Z</dc:date>
    <item>
      <title>likelihood ratio test in mixed model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/likelihood-ratio-test-in-mixed-model/m-p/921034#M45754</link>
      <description>&lt;P&gt;I would like to compare two nested linear mixed models: one without interaction (referred to as model 1) and one with interaction (referred to as model 2).&lt;/P&gt;
&lt;P&gt;Interaction term: time&amp;nbsp; (6 classes) x&amp;nbsp; gender (2 classes).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My mentor instructed me to compare these models using the Likelihood Ratio Test. I have reviewed many instructions but still feel confused about a few aspects.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. For the difference in DF, adding the gender*time interaction would increase the parameters by (6-1) * (2-1)=5. Am I understand it correctly?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. I conducted tests for both models. Model 1: -2LL=3267, and for Model 2, -2LL=3272. This indicates that adding the interaction increased the deviance and decreased the model fit. In this case, should I proceed with the Likelihood Ratio Test?&amp;nbsp;Because all the instructional materials I have reviewed so far assume that adding variables decreases the deviance. So they calculate the -2LL (reduced model) - -2LL( full model), and if the p is significant, the full model works better. In my case, it is reverse.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I can proceed with the test, the deviance difference would be 3272-3267=5. Assuming a DF difference of 5, test statistic would be 11.07, and a p-value of 0.041.&amp;nbsp; Does this imply that Model 1 (without the interaction term) improve the results? It sounds a little bit strange..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for any answers on these questions.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2024 02:01:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/likelihood-ratio-test-in-mixed-model/m-p/921034#M45754</guid>
      <dc:creator>GiaLee</dc:creator>
      <dc:date>2024-03-20T02:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: likelihood ratio test in mixed model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/likelihood-ratio-test-in-mixed-model/m-p/921042#M45757</link>
      <description>&lt;P&gt;Here is an example for PROC GENMOD.&lt;BR /&gt;But I think the same rule could apply to PROC MIXED .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/kb/24/447.html#ex4" target="_blank"&gt;24447 - Examples of writing CONTRAST and ESTIMATE statements (sas.com)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2024 02:55:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/likelihood-ratio-test-in-mixed-model/m-p/921042#M45757</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-03-20T02:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: likelihood ratio test in mixed model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/likelihood-ratio-test-in-mixed-model/m-p/921043#M45758</link>
      <description>Thanks for your quick reply. This notes answered my first question, thanks! &lt;BR /&gt;&lt;BR /&gt;However, the example is still like all other instructions show: adding an interaction term decreases the deviance. And then, they did the LRT. &lt;BR /&gt;While in my case, adding an interaction term increases the deviance. And I don't know if I can still perform the LRT in this situation.</description>
      <pubDate>Wed, 20 Mar 2024 03:22:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/likelihood-ratio-test-in-mixed-model/m-p/921043#M45758</guid>
      <dc:creator>GiaLee</dc:creator>
      <dc:date>2024-03-20T03:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: likelihood ratio test in mixed model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/likelihood-ratio-test-in-mixed-model/m-p/921104#M45765</link>
      <description>&lt;P&gt;Posting the code used and actual output will help the community answer your question more quickly and more accurately. Comparison of likelihood stats from competing mixed models can by tricky. Changes in the model can make the comparisons can make those comparisons invalid. Seeing the code will help the community provide a better response. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2024 13:37:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/likelihood-ratio-test-in-mixed-model/m-p/921104#M45765</guid>
      <dc:creator>StatsMan</dc:creator>
      <dc:date>2024-03-20T13:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: likelihood ratio test in mixed model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/likelihood-ratio-test-in-mixed-model/m-p/921115#M45766</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thanks for your reply. Here is the code. I compared the reduced model with the full model. The only difference is the interaction term. I found that adding interaction terms increased the -2LL (3271 - 3286). So I wonder if this result is correct, and if I could still do the Likelihood ratio test. If yes, will the hypothesis be changed to whether excluding the interaction term helps with model fit?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Reduced model:&amp;nbsp; &lt;/P&gt;
&lt;P&gt;PROC MIXED DATA = test&amp;nbsp; METHOD = REML COVTEST;&lt;BR /&gt;CLASS record_id time_(ref="6") female(ref="0") race_JL (ref="White") &lt;BR /&gt;depression_(ref="0") anxiety_(ref="0") hypertension_(ref="0") overweight(ref="0") fatigue_JL(ref="0")&lt;BR /&gt;site_JL(ref="outpatien") vaccine(ref="0") comor_cat (ref="none or mild");&lt;BR /&gt;MODEL Score = time_ female race_JL depression_ anxiety_&lt;BR /&gt;hypertension_ overweight fatigue_JL site_JL vaccine comor_cat/ SOLUTION OUTpred=PREDDATA S CL;&lt;BR /&gt;RANDOM INTERCEPT / SUBJECT = record_id;&lt;BR /&gt;repeated time_ / type=ar(1) sub=record_id; store out=MixedModel; &lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2024-03-20 at 10.15.27.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/94797i3B7935EEAF379E30/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2024-03-20 at 10.15.27.png" alt="Screen Shot 2024-03-20 at 10.15.27.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt; Full model:&amp;nbsp;&lt;BR /&gt;PROC MIXED DATA = all_long_1 METHOD = REML COVTEST;&lt;BR /&gt;CLASS record_id time_(ref="6") female(ref="0") race_JL (ref="White") &lt;BR /&gt;depression_(ref="0") anxiety_(ref="0") hypertension_(ref="0") overweight(ref="0") fatigue_JL(ref="0")&lt;BR /&gt;site_JL(ref="outpatien") vaccine(ref="0") comor_cat (ref="none or mild");&lt;BR /&gt;MODEL Score = time_ female &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;time_*female&lt;/STRONG&gt;&lt;/FONT&gt; race_JL depression_ anxiety_&lt;BR /&gt;hypertension_ overweight fatigue_JL site_JL vaccine comor_cat/ SOLUTION OUTpred=PREDDATA S CL;&lt;BR /&gt;RANDOM INTERCEPT / SUBJECT = record_id;&lt;BR /&gt;repeated time_ / type=ar(1) sub=record_id; store out=MixedModel; &lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2024-03-20 at 10.15.37.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/94796i7F97C0C489C08E5B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2024-03-20 at 10.15.37.png" alt="Screen Shot 2024-03-20 at 10.15.37.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2024 14:22:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/likelihood-ratio-test-in-mixed-model/m-p/921115#M45766</guid>
      <dc:creator>GiaLee</dc:creator>
      <dc:date>2024-03-20T14:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: likelihood ratio test in mixed model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/likelihood-ratio-test-in-mixed-model/m-p/921122#M45767</link>
      <description>&lt;DIV class=""&gt;I may have found the reason for the problem:&lt;/DIV&gt;
&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class=""&gt;&amp;nbsp;"the&amp;nbsp;&lt;SPAN class=""&gt;problem was coming from mixed model using restricted maximum likelihood (REML) instead of maximum likelihood (ML) for the parameters optimization. This makes the likelihood not comparable between two models having different fixed effects”.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;The reason is that REML estimates the random effects by considering linear combinations of the data that remove the fixed effects. If these fixed effects are changed, the likelihoods of the two models will not be directly comparable”.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class=""&gt;
&lt;P&gt;So does this mean the mixed model cannot perform the LRT test since it only uses REML?&lt;/P&gt;
&lt;P&gt;(I tried changing the syntax from "method = reml" to "method = ml", which gave us the -2LL instead of -2resLL, but it also changed the parameter estimates)&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 20 Mar 2024 15:04:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/likelihood-ratio-test-in-mixed-model/m-p/921122#M45767</guid>
      <dc:creator>GiaLee</dc:creator>
      <dc:date>2024-03-20T15:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: likelihood ratio test in mixed model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/likelihood-ratio-test-in-mixed-model/m-p/921141#M45768</link>
      <description>&lt;P&gt;You can switch to METHOD=ML and compare the likelihoods if you use the same covariance structures in both models. The parameter estimates will change if you change the fixed effects. That is not unexpected.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2024 16:35:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/likelihood-ratio-test-in-mixed-model/m-p/921141#M45768</guid>
      <dc:creator>StatsMan</dc:creator>
      <dc:date>2024-03-20T16:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: likelihood ratio test in mixed model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/likelihood-ratio-test-in-mixed-model/m-p/921143#M45769</link>
      <description>Thanks!  It works!</description>
      <pubDate>Wed, 20 Mar 2024 16:47:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/likelihood-ratio-test-in-mixed-model/m-p/921143#M45769</guid>
      <dc:creator>GiaLee</dc:creator>
      <dc:date>2024-03-20T16:47:57Z</dc:date>
    </item>
  </channel>
</rss>

