<?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: psmatch by group in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/psmatch-by-group/m-p/923872#M363688</link>
    <description>&lt;P&gt;"&lt;SPAN&gt;still does not work." is vague.&amp;nbsp; But I assume you mean you are getting the same warning error messages as in your original note.&amp;nbsp; You will need help from others with experience with psmatch.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Apr 2024 21:08:49 GMT</pubDate>
    <dc:creator>mkeintz</dc:creator>
    <dc:date>2024-04-10T21:08:49Z</dc:date>
    <item>
      <title>psmatch by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/psmatch-by-group/m-p/923840#M363681</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to do psmatch and also would like to have treatment and control on the same day and county without replacement.&amp;nbsp; Below is my code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc psmatch data=sg_to_match region=cs;&lt;BR /&gt;by fips1 visitday;&lt;BR /&gt;class treat;&lt;BR /&gt;psmodel treat = atq ;&lt;BR /&gt;match method=optimal(k=1) caliper=1;&lt;BR /&gt;output out(obs=match)=Outgs lps=_Lps matchid=_MatchID;&lt;BR /&gt;run;&lt;/PRE&gt;
&lt;P&gt;But I got below error message:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;WARNING: The maximum likelihood estimates for the logistic regression model might not exist. The
         maximum likelihood estimates are based on the last maximum likelihood iteration.
ERROR: Floating Point Zero Divide.
ERROR: Termination due to Floating Point Exception
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.OUTGS may be incomplete.  When this step was stopped there were 0
         observations and 13 variables.
WARNING: Data set WORK.OUTGS was not replaced because this step was stopped.
&lt;/PRE&gt;
&lt;P&gt;Is it because there might not be variations of treat/control in some county day?&amp;nbsp; Is there any way I can automatically ignore those county days?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 16:23:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/psmatch-by-group/m-p/923840#M363681</guid>
      <dc:creator>daradanye</dc:creator>
      <dc:date>2024-04-10T16:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: psmatch by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/psmatch-by-group/m-p/923843#M363682</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32269"&gt;@daradanye&lt;/a&gt;&amp;nbsp;:&amp;nbsp; You ask&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;PRE&gt;proc psmatch data=sg_to_match region=cs;&lt;BR /&gt;by fips1 visitday;&lt;BR /&gt;class treat;&lt;BR /&gt;psmodel treat = atq ;&lt;BR /&gt;match method=optimal(k=1) caliper=1;&lt;BR /&gt;output out(obs=match)=Outgs lps=_Lps matchid=_MatchID;&lt;BR /&gt;run;&lt;/PRE&gt;
&lt;P&gt;But I got below error message:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;WARNING: The maximum likelihood estimates for the logistic regression model might not exist. The
         maximum likelihood estimates are based on the last maximum likelihood iteration.
ERROR: Floating Point Zero Divide.
ERROR: Termination due to Floating Point Exception
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.OUTGS may be incomplete.  When this step was stopped there were 0
         observations and 13 variables.
WARNING: Data set WORK.OUTGS was not replaced because this step was stopped.
&lt;/PRE&gt;
&lt;P&gt;Is it because there might not be variations of treat/control in some county day?&amp;nbsp; Is there any way I can automatically ignore those county days?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You can begin to answer that question by generating a frequency of TREAT for each FIPS/VISITDAY (but only for cases with non-missing ATQ).&amp;nbsp; If on any given fips/visitday there is only one level of TREAT, there is no variation to be explained.&amp;nbsp; I presume that this could be very upsetting to PROC PSMATCH.&amp;nbsp; &amp;nbsp;If you find such cases, then exclude those fips*visitday combinations from your analysis.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 17:09:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/psmatch-by-group/m-p/923843#M363682</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2024-04-10T17:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: psmatch by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/psmatch-by-group/m-p/923850#M363685</link>
      <description>&lt;P&gt;Thanks for the reply.&amp;nbsp; Following your suggestions, I did the following things.&amp;nbsp; But it seems that it still does not work.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sg_to_match;
set sg_to_match;
if atq =. then delete;
run;

proc sql;
create table sg_to_match as select 
*,sum(treat) as sumtreat, sum(control) as sumcontrol
from sg_to_match
group by fips1, visitday
order by fips1, visitday;
quit;

data sg_to_match;
set sg_to_match;
if sumtreat = 0 then delete;
if sumcontrol = 0 then delete;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 18:19:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/psmatch-by-group/m-p/923850#M363685</guid>
      <dc:creator>daradanye</dc:creator>
      <dc:date>2024-04-10T18:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: psmatch by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/psmatch-by-group/m-p/923872#M363688</link>
      <description>&lt;P&gt;"&lt;SPAN&gt;still does not work." is vague.&amp;nbsp; But I assume you mean you are getting the same warning error messages as in your original note.&amp;nbsp; You will need help from others with experience with psmatch.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 21:08:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/psmatch-by-group/m-p/923872#M363688</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2024-04-10T21:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: psmatch by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/psmatch-by-group/m-p/923877#M363690</link>
      <description>&lt;P&gt;You are re-using the same named data set so many times I doubt that you know which version is actually used at any given point in this process. You may also previously have corrupted data. I suggest that it may be time to go back to when you originally read the data and NOT re-use the same data set name over and over.&lt;/P&gt;
&lt;P&gt;In SAS every time you&amp;nbsp; use:&lt;/P&gt;
&lt;PRE&gt;data sg_to_match;
set sg_to_match;&lt;/PRE&gt;
&lt;P&gt;Or&lt;/P&gt;
&lt;PRE&gt;create table sg_to_match&lt;/PRE&gt;
&lt;P&gt;you &lt;STRONG&gt;completely replace&lt;/STRONG&gt; any existing data set with that name. So a minor logic error when modifying values or selecting observations may have changed the values of your variables or other issues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, unless you are very sure that you want to permanently remove for all purposes the observations where ATQ is missing i would suggest using a WHERE ATQ ne . ; in the Proc PSMATCH code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should also show the entire log for the procedure include the code and ALL the notes not just the errors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 22:11:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/psmatch-by-group/m-p/923877#M363690</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-04-10T22:11:32Z</dc:date>
    </item>
  </channel>
</rss>

