<?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 Output Estimated Proportions based on Proc Logistic Outputs (e.g. 'Margin' statement in Stata)? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Output-Estimated-Proportions-based-on-Proc-Logistic-Outputs-e-g/m-p/775456#M37965</link>
    <description>&lt;P&gt;Hello Everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to modelling and have the following bit of code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Predictor&lt;/STRONG&gt;: V_ASIAN (Race)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Outcome&lt;/STRONG&gt;:&amp;nbsp;SC_ETHRACE_AM (discrimination)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Controls:&lt;/STRONG&gt; Age5 (Age groups), Sex, Edu_Level (5 groups), Region (5 groups), LFS (labour force status 3 groups)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Parametrization:&amp;nbsp;&lt;/STRONG&gt;I'm using dummy coding with specific reference groups listed&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Purpose&lt;/STRONG&gt;: To see what the effect of reporting a given racialized group (3 groups) will have on the reported perceived discrimination (YES, NO - dichotomous) while controlling for age, sex, education level, region and labour force status (See above).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Output&lt;/STRONG&gt;: At the moment the basic output that PROC LOGISTIC is spitting out are the odds ratio for each pair combination.&amp;nbsp;In Stata there is a statement ('margin') that will allow for an estimated proportion given the model. So that instead of saying a given Racialized group has 10x the odds of being discriminated against compared to the reference category, I can say what the adjusted proportion of discrimination for a given racialized group would be while having controlled for several characteristics.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Prep:&amp;nbsp;&lt;/STRONG&gt;I've removed non-response for predictors, outcome and control variables and I need to use normalized survey weights.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question:&lt;/STRONG&gt; Is there a transformation technique/statement that would provide me the estimated proportions (see above) + the standard error + Confidence intervals + Pvalues? In STATA this is easily done with the "MARGIN" statement.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you all so much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc logistic data=work.V2 ;
CLASS V_ASIAN (ref='3') AGE5(ref='3') SEX(ref='1') 
EDU_LEVEL(ref='4') REGION (ref='3') LFS (REF='1') /param=ref ;	
model SC_ETHRACE_AM = V_ASIAN age5 sex edu_level region lfs; &lt;BR /&gt;weight wght_per / norm; &lt;BR /&gt;run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 20 Oct 2021 17:41:34 GMT</pubDate>
    <dc:creator>AlexPaezSilva</dc:creator>
    <dc:date>2021-10-20T17:41:34Z</dc:date>
    <item>
      <title>Output Estimated Proportions based on Proc Logistic Outputs (e.g. 'Margin' statement in Stata)?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Output-Estimated-Proportions-based-on-Proc-Logistic-Outputs-e-g/m-p/775456#M37965</link>
      <description>&lt;P&gt;Hello Everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to modelling and have the following bit of code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Predictor&lt;/STRONG&gt;: V_ASIAN (Race)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Outcome&lt;/STRONG&gt;:&amp;nbsp;SC_ETHRACE_AM (discrimination)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Controls:&lt;/STRONG&gt; Age5 (Age groups), Sex, Edu_Level (5 groups), Region (5 groups), LFS (labour force status 3 groups)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Parametrization:&amp;nbsp;&lt;/STRONG&gt;I'm using dummy coding with specific reference groups listed&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Purpose&lt;/STRONG&gt;: To see what the effect of reporting a given racialized group (3 groups) will have on the reported perceived discrimination (YES, NO - dichotomous) while controlling for age, sex, education level, region and labour force status (See above).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Output&lt;/STRONG&gt;: At the moment the basic output that PROC LOGISTIC is spitting out are the odds ratio for each pair combination.&amp;nbsp;In Stata there is a statement ('margin') that will allow for an estimated proportion given the model. So that instead of saying a given Racialized group has 10x the odds of being discriminated against compared to the reference category, I can say what the adjusted proportion of discrimination for a given racialized group would be while having controlled for several characteristics.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Prep:&amp;nbsp;&lt;/STRONG&gt;I've removed non-response for predictors, outcome and control variables and I need to use normalized survey weights.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question:&lt;/STRONG&gt; Is there a transformation technique/statement that would provide me the estimated proportions (see above) + the standard error + Confidence intervals + Pvalues? In STATA this is easily done with the "MARGIN" statement.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you all so much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc logistic data=work.V2 ;
CLASS V_ASIAN (ref='3') AGE5(ref='3') SEX(ref='1') 
EDU_LEVEL(ref='4') REGION (ref='3') LFS (REF='1') /param=ref ;	
model SC_ETHRACE_AM = V_ASIAN age5 sex edu_level region lfs; &lt;BR /&gt;weight wght_per / norm; &lt;BR /&gt;run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 17:41:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Output-Estimated-Proportions-based-on-Proc-Logistic-Outputs-e-g/m-p/775456#M37965</guid>
      <dc:creator>AlexPaezSilva</dc:creator>
      <dc:date>2021-10-20T17:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: Output Estimated Proportions based on Proc Logistic Outputs (e.g. 'Margin' statement in Stata)?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Output-Estimated-Proportions-based-on-Proc-Logistic-Outputs-e-g/m-p/775457#M37966</link>
      <description>&lt;P&gt;I think you want the ODDSRATIO and/or ESTIMATE statements.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 17:48:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Output-Estimated-Proportions-based-on-Proc-Logistic-Outputs-e-g/m-p/775457#M37966</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-10-20T17:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Output Estimated Proportions based on Proc Logistic Outputs (e.g. 'Margin' statement in Stata)?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Output-Estimated-Proportions-based-on-Proc-Logistic-Outputs-e-g/m-p/775459#M37967</link>
      <description>&lt;P&gt;The PROC LOGISTIC statement OUTPUT allows you to obtain predicted values, confidence intervals for the predicted values, standard error of the predicted values.&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_logistic_syntax27.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_logistic_syntax27.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 17:53:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Output-Estimated-Proportions-based-on-Proc-Logistic-Outputs-e-g/m-p/775459#M37967</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-10-20T17:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: Output Estimated Proportions based on Proc Logistic Outputs (e.g. 'Margin' statement in Stata)?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Output-Estimated-Proportions-based-on-Proc-Logistic-Outputs-e-g/m-p/775502#M37970</link>
      <description>&lt;P&gt;First, if your weights are survey weights then you should NOT be using PROC LOGISTIC. If does not use the proper variance estimator for survey data. Use PROC SURVEYLOGISTIC instead. For either of these procedures, I strongly advise you to always use the EVENT= response variable option to specify the level of your binary response variable that represents the level whose probability you want to model (for example: model sc_ethrace_am(event="Yes")= ... ). Now, if your goal is to estimate the predicted event probability for each level of a predictor, like V_ASIAN, controlling for the other predictors then you can do that with the LSMEANS statement. The ILINK and CL options in this statement give the predicted probability estimate (in the Mean column) and a confidence interval.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;lsmeans v_asian / ilink cl;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that LS-means are not the same as margins. In part, LS-means fix ALL of the other predictors at their means or reference levels while margins use the actual values and then averages over the predicted values. Margins can be estimated using the &lt;A href="http://support.sas.com/kb/63038" target="_self"&gt;MARGINS macro&lt;/A&gt;, but that macro is not available for survey models.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 19:39:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Output-Estimated-Proportions-based-on-Proc-Logistic-Outputs-e-g/m-p/775502#M37970</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-10-20T19:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: Output Estimated Proportions based on Proc Logistic Outputs (e.g. 'Margin' statement in Stata)?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Output-Estimated-Proportions-based-on-Proc-Logistic-Outputs-e-g/m-p/775728#M37984</link>
      <description>&lt;P&gt;Hi &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;P&gt;Thanks for that, I really appreciate it.&amp;nbsp;&lt;BR /&gt;I was wondering, however, about why weights would not be properly accounted for in PROC LOGISTIC&amp;nbsp;&lt;/P&gt;&lt;P&gt;given that the proc contains a weight statement? I take your point but I'm just curious as to why they&amp;nbsp;&lt;/P&gt;&lt;P&gt;would allow weighted models in a proc that isn't set up to handle that? Is it any type of weight or specific types of weights&lt;/P&gt;&lt;P&gt;that are problematic?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a bunch!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Oct 2021 18:37:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Output-Estimated-Proportions-based-on-Proc-Logistic-Outputs-e-g/m-p/775728#M37984</guid>
      <dc:creator>AlexPaezSilva</dc:creator>
      <dc:date>2021-10-21T18:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: Output Estimated Proportions based on Proc Logistic Outputs (e.g. 'Margin' statement in Stata)?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Output-Estimated-Proportions-based-on-Proc-Logistic-Outputs-e-g/m-p/775730#M37985</link>
      <description>&lt;P&gt;The issue is in the computation of the variances of the model parameter estimates. As I mentioned, there are special variance estimators that are used for analysis of survey data. In the non-survey procedures, the values of the WEIGHT variable just multiply the observations' contributions to the log likelihood and then the usual maximum likelihood estimation is done. The estimators needed for survey data are not employed.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Oct 2021 18:50:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Output-Estimated-Proportions-based-on-Proc-Logistic-Outputs-e-g/m-p/775730#M37985</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-10-21T18:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: Output Estimated Proportions based on Proc Logistic Outputs (e.g. 'Margin' statement in Stata)?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Output-Estimated-Proportions-based-on-Proc-Logistic-Outputs-e-g/m-p/776848#M38063</link>
      <description>&lt;P&gt;So I tried the LSMEANS route but it keeps crashing. I'm unsure as to why given that all the variables listed are categorical (e.g. Male=2, Female=1, etc.) and there are no continuous variables.&lt;/P&gt;&lt;P&gt;I get the following error:&lt;BR /&gt;&lt;STRONG&gt;"ERROR: Only CLASS variables allowed in this effect."&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/*LSMEANS TEST WITH GLM PARAMETRIZATION*/
proc surveylogistic data=work.SI_V2;
class V_ASIAN VISMIN AGE5_GLM SEX_GLM EDU_GLM REGION_GLM LFS_GLM / param=GLM;
model SC_ETHRACE_AM (event='1')= VISMIN AGE5_GLM SEX_GLM EDU_GLM REGION_GLM LFS_GLM;
weight NORM_WT;
LSMEANS SC_ETHRACE_AM / ilink cl ;
run;&lt;/PRE&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>Wed, 27 Oct 2021 19:32:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Output-Estimated-Proportions-based-on-Proc-Logistic-Outputs-e-g/m-p/776848#M38063</guid>
      <dc:creator>AlexPaezSilva</dc:creator>
      <dc:date>2021-10-27T19:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: Output Estimated Proportions based on Proc Logistic Outputs (e.g. 'Margin' statement in Stata)?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Output-Estimated-Proportions-based-on-Proc-Logistic-Outputs-e-g/m-p/776854#M38064</link>
      <description>The dependent variable isn't a class/categorical variable.....</description>
      <pubDate>Wed, 27 Oct 2021 19:45:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Output-Estimated-Proportions-based-on-Proc-Logistic-Outputs-e-g/m-p/776854#M38064</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-10-27T19:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: Output Estimated Proportions based on Proc Logistic Outputs (e.g. 'Margin' statement in Stata)?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Output-Estimated-Proportions-based-on-Proc-Logistic-Outputs-e-g/m-p/776857#M38065</link>
      <description>&lt;P&gt;Oops! It was just a typo, the line was meant to look like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;LSMEANS V_ASIAN / ilink cl diff;
run;&lt;/PRE&gt;&lt;P&gt;That solves this part of it then.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It runs now, though the output is full "non-est" and blanks so there's something else happening now (see below). *sigh*&lt;/P&gt;&lt;P&gt;Must I absolutely specify the AT option to get any probabilities? I assumed the above code would give me the predicted means, standard error and lower/upper bounds but it doesn't seem like it (see screenshot).&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="AlexPaezSilva_0-1635364310823.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65104iF32F591568C0EB79/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlexPaezSilva_0-1635364310823.png" alt="AlexPaezSilva_0-1635364310823.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 19:53:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Output-Estimated-Proportions-based-on-Proc-Logistic-Outputs-e-g/m-p/776857#M38065</guid>
      <dc:creator>AlexPaezSilva</dc:creator>
      <dc:date>2021-10-27T19:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: Output Estimated Proportions based on Proc Logistic Outputs (e.g. 'Margin' statement in Stata)?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Output-Estimated-Proportions-based-on-Proc-Logistic-Outputs-e-g/m-p/776865#M38067</link>
      <description>LS-means are linear combinations of model parameters and they can be nonestimable depending on your model specification and the arrangement of your data. Changes to either might allow the estimates to be provided. You could try simplifying your model. Or it might help to change the linear combinations that are used such as by specifying the OM option and/or the BYLEVEL option in the LSMEANS statement. You will want to read about what these options do in the documentation of the LSMEANS statement.</description>
      <pubDate>Wed, 27 Oct 2021 20:18:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Output-Estimated-Proportions-based-on-Proc-Logistic-Outputs-e-g/m-p/776865#M38067</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-10-27T20:18:39Z</dc:date>
    </item>
  </channel>
</rss>

