<?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: Estimate Command for a Three-way interaction in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-Command-for-a-Three-way-interaction/m-p/814301#M40177</link>
    <description>&lt;P&gt;The macro call you used, as I mentioned earlier, produced six marginal effects of the effect= variable. Those marginal effects estimate the instantaneous rate of change in the response mean at those specific settings of the at= variables. So, the output data set (_meffect) contains the marginal effect estimates and the settings of the at= variables. A suitable plot of the marginal effects would the marginal effect value against one of the at= variables grouped by (or separately plotted by) the other at= variable. For example,&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgpanel data=_meffect;
  panelby ClinicSex;
  band upper=upper lower=lower x=PAreactpot  / nofill;
  scatter y=_meff x=PAreactpot;
  run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 19 May 2022 14:32:28 GMT</pubDate>
    <dc:creator>StatDave</dc:creator>
    <dc:date>2022-05-19T14:32:28Z</dc:date>
    <item>
      <title>Estimate Command for a Three-way interaction</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-Command-for-a-Three-way-interaction/m-p/813676#M40125</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using PROC GLM to examine a three-way interaction between: 1) Number of daily stressors (SAS var name= &lt;CODE class=""&gt;cAnyStressWide_sum &lt;/CODE&gt;), 2) Emotional reactivity (SAS var name= &lt;CODE class=""&gt;cPAreactpost&lt;/CODE&gt;), and 3) Gender (SAS var name= &lt;CODE class=""&gt;ClinicSex&lt;/CODE&gt;) to predict levels of Systolic blood pressure (SAS var name= &lt;CODE class=""&gt;SystolicSittingMeanLastTwo&lt;/CODE&gt;). I also graphed it using &lt;CODE class=""&gt;effectplot slicefit&lt;/CODE&gt;as shown below.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data JH.Final2; set JH.FINAL2;format _all_;run;&lt;BR /&gt;proc glm data=JH.Final2 ;&lt;BR /&gt;model SystolicSittingMeanLastTwo = cage marriedmidus work race_orig cedu cHHtotalIncome_total EverSmokeReg Exercise20mins CVDmeds cBMI cCESD cNeuroticism cpa_mlm2 cTotalChronBio cAnyStressWide_sum|cPAreactpost|ClinicSex&lt;BR /&gt;;run;&lt;BR /&gt;; store graph1; run;&lt;BR /&gt;&lt;BR /&gt;proc plm restore=graph1 noinfo;&lt;BR /&gt;effectplot slicefit(x=cAnyStressWide_sum sliceby=cPAreactpost = -0.0595500, 0, 0.0595500 plotby=ClinicSex = 1 2) / clm;&lt;BR /&gt;run;&lt;/PRE&gt;&lt;P&gt;When I run the above syntax, SAS outputs the below figure:&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="Heejeong_0-1652755767649.png" style="width: 479px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71514iD1E2EC16F0923366/image-dimensions/479x362?v=v2" width="479" height="362" role="button" title="Heejeong_0-1652755767649.png" alt="Heejeong_0-1652755767649.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to test whether each of the "blue," "red,", and "green"&amp;nbsp;&lt;CODE class=""&gt;cPAreactpost&amp;nbsp;&lt;/CODE&gt;lines are significantly different from 0.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using STATA, results indicated that for ClinicSex 1, none of the lines were significant but for&amp;nbsp;ClinicSex 2, the green line (0.05955 line) is significantly different from 0. However, when I tried replicating the command in SAS using the syntax below, the results indicate that none of the lines are significantly different from 0.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data JH.Final2; set JH.FINAL2;format _all_;run;
proc glm data=JH.Final2 ;
model SystolicSittingMeanLastTwo = cage marriedmidus work race_orig  cedu cHHtotalIncome_total EverSmokeReg Exercise20mins CVDmeds cBMI cCESD cNeuroticism cpa_mlm2 cTotalChronBio  cAnyStressWide_sum|cPAreactpost|ClinicSex
;
estimate 'stressdays slope, PA reactivity=Quartile 1 (least reactive -SD) male' cAnyStressWide_sum 1 cPAreactpost -0.0595500 ClinicSex 1 cAnyStressWide_sum*cPAreactpost -0.0595500  ClinicSex*cAnyStressWide_sum 1 ClinicSex*cPAreactpost -0.0595500 ClinicSex*cPAreactpost*cAnyStressWide_sum -0.0595500;
estimate 'stressdays slope, PA reactivity=Quartile 1 (least reactive -SD) female'  cAnyStressWide_sum 1 cPAreactpost -0.0595500 ClinicSex 2 cAnyStressWide_sum*cPAreactpost -0.0595500  ClinicSex*cAnyStressWide_sum 2 ClinicSex*cPAreactpost -0.1191 ClinicSex*cPAreactpost*cAnyStressWide_sum -0.1191;

estimate 'stressdays slope, PA reactivity=Quartile 1 (most reactive MEAN) male'  cAnyStressWide_sum 1 cPAreactpost 0 ClinicSex 1 cAnyStressWide_sum*cPAreactpost 0  ClinicSex*cAnyStressWide_sum 1 ClinicSex*cPAreactpost 0 ClinicSex*cPAreactpost*cAnyStressWide_sum 0;
estimate 'stressdays slope, PA reactivity=Quartile 1 (most reactive MEAN) female' cAnyStressWide_sum 1 cPAreactpost 0 ClinicSex 2 cAnyStressWide_sum*cPAreactpost 0  ClinicSex*cAnyStressWide_sum 2 ClinicSex*cPAreactpost 0 ClinicSex*cPAreactpost*cAnyStressWide_sum 0;

estimate 'stressdays slope, PA reactivity=Quartile 1 (most reactive +SD) male'  cAnyStressWide_sum 1 cPAreactpost 0.0595500 ClinicSex 1 cAnyStressWide_sum*cPAreactpost 0.0595500  ClinicSex*cAnyStressWide_sum 1 ClinicSex*cPAreactpost 0.0595500 ClinicSex*cPAreactpost*cAnyStressWide_sum 0.0595500;
estimate 'stressdays slope, PA reactivity=Quartile 1 (most reactive +SD) female'  cAnyStressWide_sum 1 cPAreactpost 0.0595500 ClinicSex 2 cAnyStressWide_sum*cPAreactpost 0.0595500  ClinicSex*cAnyStressWide_sum 2 ClinicSex*cPAreactpost 0.1191 ClinicSex*cPAreactpost*cAnyStressWide_sum 0.1191/ e;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Heejeong_1-1652756175154.png" style="width: 594px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71524iB71EB1844A85E99F/image-dimensions/594x174?v=v2" width="594" height="174" role="button" title="Heejeong_1-1652756175154.png" alt="Heejeong_1-1652756175154.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;My main question in this post is whether I should be editing the estimate command above and whether it might be incorrect syntax that's giving me a different result than STATA output (in case it might be helpful, I've copy-pasted the STATA syntax below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;***STATA SYNTAX****
margins, dydx(AnyStressWide_sum) at(PAreactpostc= (-.0596702 0 .0596702) Sex=(1 2))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thank you so much in advance for any advice you might have and please let me know if you have any questions!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the best,&lt;/P&gt;&lt;P&gt;Joanna&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 02:59:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-Command-for-a-Three-way-interaction/m-p/813676#M40125</guid>
      <dc:creator>Heejeong</dc:creator>
      <dc:date>2022-05-17T02:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: Estimate Command for a Three-way interaction</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-Command-for-a-Three-way-interaction/m-p/813680#M40126</link>
      <description>&lt;P&gt;The ESTIMATE statement does not compute predictive margins or marginal effects. It computes estimates of linear combinations of the model parameters with all model predictors fixed at the specified values (add the E option to see the full set of coefficients used in the linear combination). If you want to compute margins, use the &lt;A href="http://support.sas.com/kb/63038" target="_self"&gt;Margins macro&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 03:17:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-Command-for-a-Three-way-interaction/m-p/813680#M40126</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2022-05-17T03:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: Estimate Command for a Three-way interaction</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-Command-for-a-Three-way-interaction/m-p/813935#M40150</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13633"&gt;@StatDave&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you SO much for your continued guidance (starting with your extremely helpful comments from my last post) as I learn more about the MARGINS and ESTIMATE statements in SAS. I wanted to ensure that I had a clear understanding of the two STATEMENTS so wanted to follow up with a few questions. I know you are extremely busy, so I greatly appreciate responses/thoughts on any of these questions!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Below are some thoughts and questions:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;1. Would it be correct to say that both MARGINS &amp;amp; ESTIMATE statements are predicting the values of the DV when the predictor variables are set at specific values?&lt;/P&gt;&lt;P&gt;2. But the main difference is the way MARGINS &amp;amp; ESTIMATES treat the covariates. The MARGINS statement uses the actual observed values whereas the ESTIMATE statement sets the covariate values a 0. If this is true, then what is the benefit of using the ESTIMATE statements? Also, if the difference in these two statements are "how the covariates are calculated," then would the results of MARGINS and ESTIMATE commands be identical if a model does not have any covariates?&lt;/P&gt;&lt;P&gt;3. I conceptually understand what a linear prediction is but I'm having a bit of trouble understanding the difference between "&lt;SPAN&gt;predictive margins or marginal effects" and "linear combinations of the model parameters." Since this is the main conceptual difference between the MARGINS and ESTIMATE statements, I wanted to make sure that I understand the difference clearly. Would the ESTIMATE statements only be feasible when running models with linear associations between the IVs and the DV? I think I'm having a hard time understanding&amp;nbsp;&lt;EM&gt;when&amp;nbsp;&lt;/EM&gt;to use the MARGINAL vs. the ESTIMATE statements.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you so much again for all your help!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Best,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Joanna&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 19:43:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-Command-for-a-Three-way-interaction/m-p/813935#M40150</guid>
      <dc:creator>Heejeong</dc:creator>
      <dc:date>2022-05-17T19:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: Estimate Command for a Three-way interaction</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-Command-for-a-Three-way-interaction/m-p/813956#M40156</link>
      <description>&lt;P&gt;Based on your great suggestion,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13633"&gt;@StatDave&lt;/a&gt;, I wrote the below MACRO statement but&amp;nbsp;I'm getting the below error messages. When I tried to look this up, I learned that I would see the "&lt;EM&gt;The negative of the Hessian is not positive definite&lt;/EM&gt;" error if any of my covariates or predictors values have negative values. But for one of my predictor variables (&lt;CODE class=""&gt;cPAreactpost),&lt;/CODE&gt;&lt;SPAN&gt;it will have to contain negative values regardless of how I code the variable.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If there is any tip/advice that could be shared with me, I would greatly appreciate it! Thank you so much!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc means data=JH.Final3;
var cPAreactpost; 
output out=out mean=mean std=sd;
run;
data mdat;
set out;
keep cPAreactpost;
do cPAreactpost = mean-sd, mean, mean+sd;
output;
end;
run;
data adat;
ClinicSex=1;
AnyStressWide_sum7=1;
run;
%Margins(data=JH.Final3, response=SystolicSittingMeanLastTwo, class=ClinicSex, 
model=SystolicSittingMeanLastTwo cage marriedmidus work race_orig  cedu cHHtotalIncome_total EverSmokeReg Exercise20mins CVDmeds cBMI cCESD cNeuroticism cpa_mlm2 cTotalChronBio  AnyStressWide_sum7|cPAreactpost|ClinicSex,
margins=cPAreactpost, margindata=mdat, 
at=AnyStressWide_sum7 ClinicSex, atdata=adat, options=diff reverse cl)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&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="Heejeong_0-1652821017387.png" style="width: 674px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71591iB024EE55F8A0FDB8/image-dimensions/674x64?v=v2" width="674" height="64" role="button" title="Heejeong_0-1652821017387.png" alt="Heejeong_0-1652821017387.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Heejeong_2-1652821067311.png" style="width: 658px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71593i56BBE7F4252ACBD0/image-dimensions/658x438?v=v2" width="658" height="438" role="button" title="Heejeong_2-1652821067311.png" alt="Heejeong_2-1652821067311.png" /&gt;&lt;/span&gt;&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="Heejeong_1-1652821046846.png" style="width: 658px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71592i6796C12C5E49F847/image-dimensions/658x558?v=v2" width="658" height="558" role="button" title="Heejeong_1-1652821046846.png" alt="Heejeong_1-1652821046846.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 21:03:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-Command-for-a-Three-way-interaction/m-p/813956#M40156</guid>
      <dc:creator>Heejeong</dc:creator>
      <dc:date>2022-05-17T21:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: Estimate Command for a Three-way interaction</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-Command-for-a-Three-way-interaction/m-p/813963#M40159</link>
      <description>&lt;P&gt;I'm not very familiar with Stata and its margins statement, but from the statement you show it seems that it is estimating the marginal effect of AnyStressWide_sum at each of six settings of PAreactpot and Sex. It appears to use the derivative-based computation of the marginal effect of the continuous variable. This computation of the marginal effect gives you the instantaneous change in the response mean at the indicated settings. This computation of the marginal effect is discussed and illustrated in &lt;A href="http://support.sas.com/kb/22604" target="_self"&gt;this note&lt;/A&gt;.&amp;nbsp;So, to do that you would call the Margins macro like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=JH.Final3;
   var cPAreactpost; 
   output out=out mean=mean std=sd;
   run;
data adat;
   set out;
   keep cPAreactpost ClinicSex;
   do cPAreactpost = mean-sd, mean, mean+sd;
     ClinicSex=1; output;
     ClinicSex=2; output;
   end;
   run;
%Margins(data=JH.Final3, response=SystolicSittingMeanLastTwo, class=ClinicSex, 
         model=SystolicSittingMeanLastTwo cage marriedmidus work race_orig cedu 
         cHHtotalIncome_total EverSmokeReg Exercise20mins CVDmeds cBMI cCESD 
         cNeuroticism cpa_mlm2 cTotalChronBio 
         AnyStressWide_sum7|cPAreactpost|ClinicSex,
         effect=AnyStressWide_sum7, at=PAreactpot ClinicSex, atdata=adat, 
         options=cl)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Regarding the Warning messages, it appears that PROC GENMOD (which the macro uses to fit the model) is unable to properly converge. It has nothing to do with your predictor having negative values. Note that GENMOD fits the model using an iterative maximum likelihood algorithm while GLM uses least squares, which doesn't require iteration. Convergence problems are always possible with such algorithms. You might want to experiment with fitting the model directly in PROC GENMOD. You might have to make some alteration to the model or tweak the algorithm to get proper convergence. Once you know how to get GENMOD to converge, then specify the same in the macro.&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 22:43:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-Command-for-a-Three-way-interaction/m-p/813963#M40159</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2022-05-17T22:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: Estimate Command for a Three-way interaction</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-Command-for-a-Three-way-interaction/m-p/814111#M40168</link>
      <description>&lt;P&gt;Thank you so much for this helpful response,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13633"&gt;@StatDave&lt;/a&gt;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First, the distribution explanation (maximum likelihood algorithm vs least-squares) clarifies the error message, I will try to troubleshoot by just using a GENMOD syntax! Could I potentially think that the convergence problem could be the reason why my output produces marginal effects that are almost all 0s?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Secondly, I read through the helpful documentation you sent me and as I was making sure that I understood the approach perfectly, I had 2 quick questions. Below, I've written out the syntax from the website and the syntax you wrote for me:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;&lt;U&gt;&lt;STRONG&gt;*FROM THE WEBSITE:&lt;/STRONG&gt;&lt;/U&gt;
 %Margins(data=Remiss,
          response=remiss, 
          roptions=event='1',
          model=blast smear,
          dist= binomial, 
          effect=blast,
          at= blast smear,
          atwhere=blast=1.1 and smear=.83,
          options=cl)

&lt;U&gt;&lt;STRONG&gt;*FROM DAVE:&lt;/STRONG&gt;&lt;/U&gt;
proc means data=JH.Final3;
var cPAreactpost; 
output out=out mean=mean std=sd;
run;
data adat;
set out;
keep cPAreactpost ClinicSex;
do cPAreactpost = mean-sd, mean, mean+sd;
ClinicSex=1; output;
ClinicSex=2; output;
end;
run;&lt;BR /&gt;
%Margins(data=JH.Final3, &lt;BR /&gt;response=SystolicSittingMeanLastTwo, &lt;BR /&gt;class=ClinicSex, 
model=SystolicSittingMeanLastTwo cage marriedmidus work race_orig cedu cHHtotalIncome_total EverSmokeReg Exercise20mins CVDmeds cBMI cCESD 
cNeuroticism cpa_mlm2 cTotalChronBio AnyStressWide_sum7|cPAreactpost|ClinicSex,
effect=AnyStressWide_sum7, &lt;BR /&gt;at=PAreactpot ClinicSex, &lt;BR /&gt;atdata=adat, 
options=cl)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1)&amp;nbsp;In our syntax, do we not have the “&lt;CODE class=""&gt;roptions=event='1'&lt;/CODE&gt;',” and “&lt;CODE class=""&gt;dist= binomial&lt;/CODE&gt;” syntax because our DV is a continuous variable and does not have a binomial distribution?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) Also, the way the website wrote out the model statement is a bit different than ours. The website only wrote out the predictors (e.g., “&lt;CODE class=""&gt;model=blast smear&lt;/CODE&gt;”), whereas we included the DV (e.g.,&amp;nbsp;&lt;CODE class=""&gt;model=SystolicSittingMeanLastTwo cage&lt;/CODE&gt; &lt;CODE class=""&gt;marriedmidus work race_orig cedu cHHtotalIncome_total EverSmokeReg Exercise20mins CVDmeds cBMI cCESD cNeuroticism cpa_mlm2 cTotalChronBio AnyStressWide_sum7|cPAreactpost|ClinicSex&lt;/CODE&gt;”). Would it be safe for me to assume that both approaches are correct?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3) The website uses specific values of each predictor variable (&lt;CODE class=""&gt;atwhere=blast=1.1 and smear=.83&lt;/CODE&gt;) to run the macro statement but you helped me create another dataset that contains more than one specified value of the two predictor variables (&lt;CODE class=""&gt;data adat; set out; keep cPAreactpost ClinicSex; do cPAreactpost = mean-sd, mean, mean+sd;&lt;/CODE&gt; &lt;CODE class=""&gt;ClinicSex=1; output;ClinicSex=2; output; end;).&lt;/CODE&gt;&lt;SPAN&gt;Would it be correct for me to think that your approach is better because it allows me to use&amp;nbsp;&lt;EM&gt;more than 1 specified value&lt;/EM&gt;&amp;nbsp;at which we are estimating the marginal effects?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you so much in advance for your additional help, I am learning so much and so grateful for this opportunity!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 16:19:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-Command-for-a-Three-way-interaction/m-p/814111#M40168</guid>
      <dc:creator>Heejeong</dc:creator>
      <dc:date>2022-05-18T16:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Estimate Command for a Three-way interaction</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-Command-for-a-Three-way-interaction/m-p/814121#M40169</link>
      <description>I didn't notice that you had the response variable in model=. That is incorrect and is likely why GENMOD had the problem fitting the model since doing this uses the response as a predictor which obviously is wrong. So, remove the response variable from model=. Yes, those roptions= and dist= options in the note I referred to are for the binary response in that example and not appropriate in your case. If the specific values at which you want to compute the marginal effects actually occur in your input data (the data= data set), then you can use atwhere=. I assume that isn't the case for your values computed from the mean and standard deviation. The approach I show using atdata= can always be used.</description>
      <pubDate>Wed, 18 May 2022 16:52:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-Command-for-a-Three-way-interaction/m-p/814121#M40169</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2022-05-18T16:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: Estimate Command for a Three-way interaction</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-Command-for-a-Three-way-interaction/m-p/814203#M40171</link>
      <description>&lt;P&gt;Thank you so much,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13633"&gt;@StatDave&lt;/a&gt;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This solved the problem and I was able to replicate my findings from STATA!&lt;/P&gt;&lt;P&gt;I am now trying to graph the margins using PROC SGPLOT and using the syntax below. I am using the dataset "_meffect" which I thought was the final dataset outputted from the MACRO statement but I keep getting an error saying that the stress variable "Stress7" is not found? Also, the predictor variable names are different because I shortened the names due to an error message. Thank you for any tips you might have on this!&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc sgplot data=_meffect noautolegend;
 SERIES X = ESTIMATE Y = Stress7;
 SERIES X = ESTIMATE Y = cPAreact;
 SERIES X = ESTIMATE Y = Sex;
title "Effects of Stressful Days, Positive Affective Responsivity, and  Gender on Systolic Blood Pressure";
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 May 2022 02:50:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-Command-for-a-Three-way-interaction/m-p/814203#M40171</guid>
      <dc:creator>Heejeong</dc:creator>
      <dc:date>2022-05-19T02:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: Estimate Command for a Three-way interaction</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-Command-for-a-Three-way-interaction/m-p/814301#M40177</link>
      <description>&lt;P&gt;The macro call you used, as I mentioned earlier, produced six marginal effects of the effect= variable. Those marginal effects estimate the instantaneous rate of change in the response mean at those specific settings of the at= variables. So, the output data set (_meffect) contains the marginal effect estimates and the settings of the at= variables. A suitable plot of the marginal effects would the marginal effect value against one of the at= variables grouped by (or separately plotted by) the other at= variable. For example,&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgpanel data=_meffect;
  panelby ClinicSex;
  band upper=upper lower=lower x=PAreactpot  / nofill;
  scatter y=_meff x=PAreactpot;
  run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 May 2022 14:32:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-Command-for-a-Three-way-interaction/m-p/814301#M40177</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2022-05-19T14:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: Estimate Command for a Three-way interaction</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-Command-for-a-Three-way-interaction/m-p/814577#M40202</link>
      <description>&lt;P&gt;Thank you so much! I was able to graph it with your response. I just wanted to post the exact syntax and the graph in case it might be helpful for anyone else! Thank you so much again for all your help,&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc sort data=_meffect; 
by cPAreact;
run;
proc sgpanel data=_meffect;
  panelby Sex;
  band upper=upper lower=lower x=cPAreact  / fill;
  scatter y=_meff x=cPAreact;
  run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Heejeong_1-1653162410627.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71685i9B3B52A8000050AC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Heejeong_1-1653162410627.png" alt="Heejeong_1-1653162410627.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 May 2022 19:48:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-Command-for-a-Three-way-interaction/m-p/814577#M40202</guid>
      <dc:creator>Heejeong</dc:creator>
      <dc:date>2022-05-21T19:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: Estimate Command for a Three-way interaction</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-Command-for-a-Three-way-interaction/m-p/825795#M40899</link>
      <description>&lt;P&gt;Thank you so much for all your help with my questions regarding this three-way interaction analysis,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13633"&gt;@StatDave&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;I was wondering if there was any way to change the syntax to make my final graph look at the graph I made in STATA below?&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="Heejeong_0-1658957796063.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/73814iDCEFC064B5EC9A45/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Heejeong_0-1658957796063.png" alt="Heejeong_0-1658957796063.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Below is the graph that I made in SAS and I understand that analysis creates these six marginal effects values automatically but I really want to see how the DV (systolic blood pressure) changes across 1+SD, Mean, 1-SD and across each stressful day (minimum 1 &amp;amp; max 7).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any way that I could do this, I would greatly appreciate your help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;Joanna&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2022 22:41:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-Command-for-a-Three-way-interaction/m-p/825795#M40899</guid>
      <dc:creator>Heejeong</dc:creator>
      <dc:date>2022-07-27T22:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: Estimate Command for a Three-way interaction</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-Command-for-a-Three-way-interaction/m-p/825983#M40912</link>
      <description>Then you probably need to have more than just the 3 distinct values on each horizontal axis (1-sd, mean, 1+sd). You could do that by adding more values in the DO statement in the DATA ADAT; step that I showed in my earlier reply.</description>
      <pubDate>Thu, 28 Jul 2022 16:08:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-Command-for-a-Three-way-interaction/m-p/825983#M40912</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2022-07-28T16:08:40Z</dc:date>
    </item>
  </channel>
</rss>

