<?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 PSMATCH/ASSESS statement not recognizing a binary variable as binary in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-PSMATCH-ASSESS-statement-not-recognizing-a-binary-variable/m-p/820079#M40556</link>
    <description>&lt;P&gt;Hi Michael and Steve. &amp;nbsp;Your focus on missing values helped me figure out the problem with the marital status dummies not being recognized as binary by SAS. &amp;nbsp;One of the covariates I included in the logistic regression model used to generate the propensity scores was spouse/partner's employment. &amp;nbsp;The inclusion of that variable meant that the values of respondent's marital status variable had to be, by definition, "married" (which was confirmed by the fact that "is your spouse employed" question was asked only if a person answered they were married/had a partner to the marital status question). &amp;nbsp; This in turn caused the marital status dummies to lose their variability -- all obs showed a value of 1 for the married status dummies and a value of 0 for the other marital status dummies. &amp;nbsp;I was able to resolve the problem by eliminating the spouse employed variable, thus retaining the variance in the marital status dummies. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that makes sense. &amp;nbsp; Thanks for your help!&lt;/P&gt;&lt;P&gt;Kelly&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jun 2022 16:56:58 GMT</pubDate>
    <dc:creator>Kelly_K</dc:creator>
    <dc:date>2022-06-23T16:56:58Z</dc:date>
    <item>
      <title>PROC PSMATCH/ASSESS statement not recognizing a binary variable as binary</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-PSMATCH-ASSESS-statement-not-recognizing-a-binary-variable/m-p/819493#M40523</link>
      <description>&lt;P&gt;Hi, everyone.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using the ASSESS statement in PROC PSMATCH to generate diagnostic tools for my propensity score matches.&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;All of my categorical variables are binary, but SAS continues to insist that two of them are not and drops them from the ASSESS statement.&lt;SPAN class=""&gt;&amp;nbsp; &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="Screen Shot 2022-06-21 at 9.03.18 PM.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/72519i04A3F19E7823A388/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2022-06-21 at 9.03.18 PM.png" alt="Screen Shot 2022-06-21 at 9.03.18 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I've tripled checked these variables and they are, in fact, binary.&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="Screen Shot 2022-06-21 at 9.03.57 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/72520i69747FBFBE096290/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2022-06-21 at 9.03.57 PM.png" alt="Screen Shot 2022-06-21 at 9.03.57 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;I will note that I created these as dummy variables using the PROC GLMSELECT procedure described &lt;A href="https://blogs.sas.com/content/iml/2020/08/31/best-generate-dummy-variables-sas.html" target="_self"&gt;here&lt;/A&gt;. &amp;nbsp;However, none of the other 20+ dummies that were created with this procedure trigger this warning.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any thoughts on why I'm getting this result?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(FYI: &amp;nbsp;This is the same question as the one in this &lt;A href="https://communities.sas.com/t5/Statistical-Procedures/Question-on-PSMATCH/td-p/762686" target="_self"&gt;post&lt;/A&gt;, but the responses seem to assume that the variable generating the warning was not in fact binary.&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;There isn't an answer (or I'm not seeing it) about what to do if the variable is, in fact, binary.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 01:28:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-PSMATCH-ASSESS-statement-not-recognizing-a-binary-variable/m-p/819493#M40523</guid>
      <dc:creator>Kelly_K</dc:creator>
      <dc:date>2022-06-22T01:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: PROC PSMATCH/ASSESS statement not recognizing a binary variable as binary</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-PSMATCH-ASSESS-statement-not-recognizing-a-binary-variable/m-p/819577#M40527</link>
      <description>&lt;P&gt;You have three responses for resp_never_married - missing, 0 and 1, so the program assumes that the variable is not binary.&amp;nbsp; Try removing the missing response records and see it that improves things.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 11:12:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-PSMATCH-ASSESS-statement-not-recognizing-a-binary-variable/m-p/819577#M40527</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2022-06-22T11:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: PROC PSMATCH/ASSESS statement not recognizing a binary variable as binary</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-PSMATCH-ASSESS-statement-not-recognizing-a-binary-variable/m-p/819615#M40530</link>
      <description>&lt;P&gt;Hi, Steve. Thanks for the quick reply. I tried your suggestion but the problem persists. &amp;nbsp;Here is a screenshot of the warning message I received after I dropped the missing observations for the marital variable.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-06-22 at 9.08.10 AM.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/72541i828154281F707BBC/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2022-06-22 at 9.08.10 AM.png" alt="Screen Shot 2022-06-22 at 9.08.10 AM.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="Screen Shot 2022-06-22 at 9.16.14 AM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/72542iD55984AD523E2011/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2022-06-22 at 9.16.14 AM.png" alt="Screen Shot 2022-06-22 at 9.16.14 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I will also note that most of my other nonbinary categorical variables have missing values as well but they don't trigger the same problem. For example:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-06-22 at 9.19.48 AM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/72544iB714D66A91341F0E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2022-06-22 at 9.19.48 AM.png" alt="Screen Shot 2022-06-22 at 9.19.48 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Perhaps this is another clue: &amp;nbsp;Because I received the warning that "the maximum likelihood estimates for the logistic regression model might not exist" while running the PROC PSMATCH procedure, I generated my propensity scores using the PROC LOGISTIC procedure. &amp;nbsp;I noticed that the output differed for the marital variables compared to the other nonbinary categorical variables:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-06-22 at 9.29.10 AM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/72545i880044DC5BE53F40/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2022-06-22 at 9.29.10 AM.png" alt="Screen Shot 2022-06-22 at 9.29.10 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It looks like SAS is not seeing the obs that are coded as "1" for the marital variables. &amp;nbsp;Does this provide any insight into what is going on?&lt;/P&gt;&lt;P&gt;Kelly&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, 22 Jun 2022 13:34:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-PSMATCH-ASSESS-statement-not-recognizing-a-binary-variable/m-p/819615#M40530</guid>
      <dc:creator>Kelly_K</dc:creator>
      <dc:date>2022-06-22T13:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: PROC PSMATCH/ASSESS statement not recognizing a binary variable as binary</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-PSMATCH-ASSESS-statement-not-recognizing-a-binary-variable/m-p/819677#M40534</link>
      <description>&lt;P&gt;I suspect the issue is due to missing values in the response or other covariates. PROC PSMATCH only uses the observations with non-missing values, and based on the PROC LOGISTIC output you provided I suspect that the 116 observations with resp_never_married=1 and the 41 observations with resp_sep_div_wid=1 all have a missing value for some other covariate and are ultimately excluded. In that case PROC PSMATCH detects only 1 level for those variables, not exactly 2, and therefore issues that warning and excludes them from the ASSESS statement output. You might try just using that 0/1 coding treating them as continuous inputs and not listing them in the CLASS statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT: I realized my comment about treating those variables as continuous is a bit silly. If my assumption is correct, that means they are constant, so the values are the same in each treatment condition and they are trivially balanced.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 21:10:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-PSMATCH-ASSESS-statement-not-recognizing-a-binary-variable/m-p/819677#M40534</guid>
      <dc:creator>MichaelL_SAS</dc:creator>
      <dc:date>2022-06-22T21:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: PROC PSMATCH/ASSESS statement not recognizing a binary variable as binary</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-PSMATCH-ASSESS-statement-not-recognizing-a-binary-variable/m-p/820079#M40556</link>
      <description>&lt;P&gt;Hi Michael and Steve. &amp;nbsp;Your focus on missing values helped me figure out the problem with the marital status dummies not being recognized as binary by SAS. &amp;nbsp;One of the covariates I included in the logistic regression model used to generate the propensity scores was spouse/partner's employment. &amp;nbsp;The inclusion of that variable meant that the values of respondent's marital status variable had to be, by definition, "married" (which was confirmed by the fact that "is your spouse employed" question was asked only if a person answered they were married/had a partner to the marital status question). &amp;nbsp; This in turn caused the marital status dummies to lose their variability -- all obs showed a value of 1 for the married status dummies and a value of 0 for the other marital status dummies. &amp;nbsp;I was able to resolve the problem by eliminating the spouse employed variable, thus retaining the variance in the marital status dummies. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that makes sense. &amp;nbsp; Thanks for your help!&lt;/P&gt;&lt;P&gt;Kelly&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2022 16:56:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-PSMATCH-ASSESS-statement-not-recognizing-a-binary-variable/m-p/820079#M40556</guid>
      <dc:creator>Kelly_K</dc:creator>
      <dc:date>2022-06-23T16:56:58Z</dc:date>
    </item>
  </channel>
</rss>

