<?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: Calculate marginal effects in PROC MIXED in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Calculate-marginal-effects-in-PROC-MIXED/m-p/867434#M342603</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A nice blog about the terminology :&lt;BR /&gt;Marginalia: A guide to figuring out what the heck marginal effects, marginal slopes, average marginal effects, marginal effects at the mean, and all these other marginal things are&lt;BR /&gt;by Andrew Heiss&lt;BR /&gt;&lt;A href="https://www.andrewheiss.com/blog/2022/05/20/marginalia/" target="_blank"&gt;https://www.andrewheiss.com/blog/2022/05/20/marginalia/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For an answer, see here :&lt;BR /&gt;Usage Note 30333: FASTats: Frequently Asked-For Statistics&lt;BR /&gt;&lt;A href="https://support.sas.com/kb/30/333.html" target="_blank"&gt;https://support.sas.com/kb/30/333.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Search for "marginal effects".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Margins, predictive and marginal effects&lt;BR /&gt;&lt;/STRONG&gt;The MARGINS statement can estimate and test predictive margins and marginal effects for CLASS (categorical) predictors and is available beginning in these releases in these SAS Viya procedures: GLIMMIX (2021.1.3), LOGISTIC, SURVEYLOGISTIC, SURVEYPHREG, SURVEYREG, LMIXED (2022.12). For both categorical and continuous predictors, the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://support.sas.com/kb/63038.html" target="_blank"&gt;Margins macro&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(SAS Note 63038)&amp;nbsp;is available in SAS/STAT beginning in SAS 9.4M8 or can be downloaded. The Margins macro can estimate and test predictive margins and average marginal effects in generalized linear and GEE models fit using SAS/STAT PROC GENMOD. Predictive margins and average marginal effects can be estimated by the macro at specified values of other model variables or at computed values such as means or medians.&amp;nbsp;For binary or ordinal logit or probit models, point estimates of marginal effects for predictors not involved in interactions can be obtained from the MARGINAL option in the OUTPUT statement of SAS/ETS PROC QLIM.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://support.sas.com/kb/22604.html" target="_blank"&gt;SAS Note 22604&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;discusses and illustrates the estimation of marginal effects in logit&amp;nbsp;and probit&amp;nbsp;models.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Usage Note 22604: Marginal effect estimation for predictors in logistic and probit models&lt;BR /&gt;&lt;A href="https://support.sas.com/kb/22/604.html" target="_blank"&gt;https://support.sas.com/kb/22/604.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
    <pubDate>Fri, 31 Mar 2023 12:40:29 GMT</pubDate>
    <dc:creator>sbxkoenk</dc:creator>
    <dc:date>2023-03-31T12:40:29Z</dc:date>
    <item>
      <title>Calculate marginal effects in PROC MIXED</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-marginal-effects-in-PROC-MIXED/m-p/867379#M342570</link>
      <description>&lt;P&gt;Hello all, I need some help with marginal effects in proc mixed. I am comparing two treatments from a clinical trial. I have tried the following code:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt; &lt;STRONG&gt;MIXED&lt;/STRONG&gt; DATA=Data METHOD=ml;&lt;/P&gt;&lt;P&gt;CLASS trt_group patient_id;&lt;/P&gt;&lt;P&gt;MODEL y=visit_yrs|trt_group/solution residual;&lt;/P&gt;&lt;P&gt;Random int visit_yrs/subject=patient_id;&lt;/P&gt;&lt;P&gt;FORMAT trt_group trt_group.;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;What I'd like to do is get the marginal effects for the treatment group (ie mean of all readings for all participants across the study). I believe lsmeans only allows categorical variables. I did try putting visit_wks as a class variable to accommodate the lsmeans statement, however that seems to change all the parameters for the model. I hope I've got the terminology correct. &amp;nbsp;Any help would be greatly appreciated!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 04:23:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-marginal-effects-in-PROC-MIXED/m-p/867379#M342570</guid>
      <dc:creator>Novice_user</dc:creator>
      <dc:date>2023-03-31T04:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate marginal effects in PROC MIXED</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-marginal-effects-in-PROC-MIXED/m-p/867434#M342603</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A nice blog about the terminology :&lt;BR /&gt;Marginalia: A guide to figuring out what the heck marginal effects, marginal slopes, average marginal effects, marginal effects at the mean, and all these other marginal things are&lt;BR /&gt;by Andrew Heiss&lt;BR /&gt;&lt;A href="https://www.andrewheiss.com/blog/2022/05/20/marginalia/" target="_blank"&gt;https://www.andrewheiss.com/blog/2022/05/20/marginalia/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For an answer, see here :&lt;BR /&gt;Usage Note 30333: FASTats: Frequently Asked-For Statistics&lt;BR /&gt;&lt;A href="https://support.sas.com/kb/30/333.html" target="_blank"&gt;https://support.sas.com/kb/30/333.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Search for "marginal effects".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Margins, predictive and marginal effects&lt;BR /&gt;&lt;/STRONG&gt;The MARGINS statement can estimate and test predictive margins and marginal effects for CLASS (categorical) predictors and is available beginning in these releases in these SAS Viya procedures: GLIMMIX (2021.1.3), LOGISTIC, SURVEYLOGISTIC, SURVEYPHREG, SURVEYREG, LMIXED (2022.12). For both categorical and continuous predictors, the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://support.sas.com/kb/63038.html" target="_blank"&gt;Margins macro&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(SAS Note 63038)&amp;nbsp;is available in SAS/STAT beginning in SAS 9.4M8 or can be downloaded. The Margins macro can estimate and test predictive margins and average marginal effects in generalized linear and GEE models fit using SAS/STAT PROC GENMOD. Predictive margins and average marginal effects can be estimated by the macro at specified values of other model variables or at computed values such as means or medians.&amp;nbsp;For binary or ordinal logit or probit models, point estimates of marginal effects for predictors not involved in interactions can be obtained from the MARGINAL option in the OUTPUT statement of SAS/ETS PROC QLIM.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://support.sas.com/kb/22604.html" target="_blank"&gt;SAS Note 22604&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;discusses and illustrates the estimation of marginal effects in logit&amp;nbsp;and probit&amp;nbsp;models.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Usage Note 22604: Marginal effect estimation for predictors in logistic and probit models&lt;BR /&gt;&lt;A href="https://support.sas.com/kb/22/604.html" target="_blank"&gt;https://support.sas.com/kb/22/604.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 12:40:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-marginal-effects-in-PROC-MIXED/m-p/867434#M342603</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-03-31T12:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate marginal effects in PROC MIXED</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-marginal-effects-in-PROC-MIXED/m-p/867899#M342783</link>
      <description>&lt;P&gt;Many thanks Koen, that information was interesting. &amp;nbsp;Unfortunately, I still couldn't figure out a way to calculate the mean across the whole study. &amp;nbsp;Is the only way to calculate the lsmeans at specific time points, save to an output, and take a mean of those means? &amp;nbsp;Or is there a simpler way?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2023 03:10:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-marginal-effects-in-PROC-MIXED/m-p/867899#M342783</guid>
      <dc:creator>Novice_user</dc:creator>
      <dc:date>2023-04-04T03:10:25Z</dc:date>
    </item>
  </channel>
</rss>

