<?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: Why the propensity score from PROC PSMATCH is different from the PS estimated from PROC LOGISTIC in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Why-the-propensity-score-from-PROC-PSMATCH-is-different-from-the/m-p/581217#M28505</link>
    <description>&lt;P&gt;You'll likely have to go to SAS tech support for an answer then. I'm fairly certain it's just a rounding issue, computers are not as precise as most people think &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is code that can be used to replicate the issue since we can't run your code, if anyone else wants to tackle this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*-----------------------------------------------------------------
            S A S   S A M P L E   L I B R A R Y                   
                                                                  
      NAME: PSMCHEX4                                              
     TITLE: Documentation Example 4 for PROC PSMATCH              
   PRODUCT: STAT                                                  
    SYSTEM: ALL                                                   
      KEYS: Propensity score matching                             
     PROCS: PSMATCH                                               
      DATA:                                                       
                                                                  
   SUPPORT: Yang Yuan             UPDATE: Oct 17, 2016            
       REF: PROC PSMATCH, EXAMPLE 4                               
      MISC:                                                       
-----------------------------------------------------------------*/

data School;
   Music= 'Yes';
   do j=1 to 60;
      if (ranuni(1312) &amp;gt; 0.4) then Gender='Female';
      else                         Gender='Male';

      Absence = ranexp(99);
      if (Absence &amp;lt; 0.5) then GPA= 4 + rannor(99)/3.5;
      else                    GPA= 4 - abs(rannor(99)/3.5);

      if (Gender='Female') then GPA= GPA + 0.02;

      id1= ranuni(99);
      id2= ranuni(99);
      output;
   end;

   Music= 'No';
   do j=1 to 100;

      Absence= ranexp(99);
      if (ranuni(99) &amp;gt; 0.45) then Gender='Female';
      else                        Gender='Male';
      if (Absence &amp;lt; 0.5) then GPA= 4 + rannor(99)/4.2;
      else                    GPA= 4 - abs(rannor(99)/4.2);

      id1= ranuni(99);
      id2= ranuni(99);
      output;
   end;

   do j=1 to 40;
      Absence= 2 + ranexp(99);
      if (ranuni(99) &amp;gt; 0.5) then Gender='Female';
      else                       Gender='Male';

      GPA= 3.4 - abs(rannor(99)/4.2);

      id1= ranuni(99);
      id2= ranuni(99);
      output;
   end;
run;

proc sort data=school;
   by id1;
run;

data school;
   set school;
   StudentID= _n_;
   Absence= int(Absence*100+0.5) / 100;
   GPA= int(GPA*100+0.5) / 100;
run;

proc sort data=school;
   by id2;
run;

proc print data=School(obs=10);
   var StudentID Music Gender Absence;
run;

ods graphics on;
proc psmatch data=School region=treated;
   class Music Gender;
   psmodel Music(Treated='Yes')= Gender Absence;
   match distance=lps method=greedy(k=1) exact=Gender caliper=0.5;
   assess lps var=(Gender Absence)
          / stddev=pooled(allobs=no) stdbinvar=no
            plots(nodetails)=all weight=none;
   output out(obs=match)=OutEx4 matchid=_MatchID;
run;

proc logistic data=school;
class music gender;
model music (event = 'Yes') = Gender Absence;
output out=check p=check;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 14 Aug 2019 17:02:53 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-08-14T17:02:53Z</dc:date>
    <item>
      <title>Why the propensity score from PROC PSMATCH is different from the PS estimated from PROC LOGISTIC?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Why-the-propensity-score-from-PROC-PSMATCH-is-different-from-the/m-p/581210#M28502</link>
      <description>&lt;P&gt;I used PROC PSMATCH to run a greedy 1:3 matching with caliper of 0.1 of std of logit of ps and get the matched output with lps, ps attached. I also ran a logistic regression model using exactly the same set of covariates to obtain ps and lps, but then found the PS calculated from PROC PSMATCH is slightly different from the PS estimated from logistic regression model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, obs A from PROC PSMATCH got PS=0.0843553047&amp;nbsp; and got PS=&amp;nbsp;0.0843554561 from PROC LOGISTIC.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought PROC PSMATCH uses logistic regression model as well. Then it should be the same as what I got from PROC LOGISTIC, unless PROC PSMATCH has some particular settings in the mode part. Does anyone come across the same issue? Can you tell what is the cause of the difference?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The codes I used are as below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc psmatch data=ps_dat region=allobs;
   class  treatment age_cat pre_med_01;
   psmodel treatment (Treated='1')= age_cat pre_med_01;
   match method =greedy(k=1)  caliper=.;
   assess lps allcov /* plots=all*/;
   output out(obs=all)=cdtvnas.sas_match_test lps=_Lps matchid=_MatchID;
run;

proc logistic data=ds;
	class age_cat pre_med_01;
	model treatment (event='1') = age_cat pre_med_01;
	output out=test1 prob=ps xbeta=logit;
run;

&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 16:30:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Why-the-propensity-score-from-PROC-PSMATCH-is-different-from-the/m-p/581210#M28502</guid>
      <dc:creator>yistella</dc:creator>
      <dc:date>2019-08-14T16:30:03Z</dc:date>
    </item>
    <item>
      <title>Re: Why the propensity score from PROC PSMATCH is different from the PS estimated from PROC LOGISTIC</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Why-the-propensity-score-from-PROC-PSMATCH-is-different-from-the/m-p/581213#M28503</link>
      <description>Are differences at the 6th decimal place really different? I wouldn't call that a significant difference. Without the output we couldn't tell you. It's possible when you created the matched dataset, ps_dat from the DS data (data sets used in each proc are not the same) that something small changed somewhere.</description>
      <pubDate>Wed, 14 Aug 2019 16:46:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Why-the-propensity-score-from-PROC-PSMATCH-is-different-from-the/m-p/581213#M28503</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-08-14T16:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Why the propensity score from PROC PSMATCH is different from the PS estimated from PROC LOGISTIC</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Why-the-propensity-score-from-PROC-PSMATCH-is-different-from-the/m-p/581215#M28504</link>
      <description>Thanks for the comment. I agree that the difference is really small, but I&lt;BR /&gt;am just curious why there would be difference even it is super small. If&lt;BR /&gt;PROC PSMATCH used the exactly same default setting as PROC LOGISTIC used, I&lt;BR /&gt;assume the PS should be exactly same. I used the same input data to run&lt;BR /&gt;these two procedures. I don't think matching process would make a change in&lt;BR /&gt;the estimated propensity score, right?&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Aug 2019 16:53:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Why-the-propensity-score-from-PROC-PSMATCH-is-different-from-the/m-p/581215#M28504</guid>
      <dc:creator>yistella</dc:creator>
      <dc:date>2019-08-14T16:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: Why the propensity score from PROC PSMATCH is different from the PS estimated from PROC LOGISTIC</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Why-the-propensity-score-from-PROC-PSMATCH-is-different-from-the/m-p/581217#M28505</link>
      <description>&lt;P&gt;You'll likely have to go to SAS tech support for an answer then. I'm fairly certain it's just a rounding issue, computers are not as precise as most people think &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is code that can be used to replicate the issue since we can't run your code, if anyone else wants to tackle this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*-----------------------------------------------------------------
            S A S   S A M P L E   L I B R A R Y                   
                                                                  
      NAME: PSMCHEX4                                              
     TITLE: Documentation Example 4 for PROC PSMATCH              
   PRODUCT: STAT                                                  
    SYSTEM: ALL                                                   
      KEYS: Propensity score matching                             
     PROCS: PSMATCH                                               
      DATA:                                                       
                                                                  
   SUPPORT: Yang Yuan             UPDATE: Oct 17, 2016            
       REF: PROC PSMATCH, EXAMPLE 4                               
      MISC:                                                       
-----------------------------------------------------------------*/

data School;
   Music= 'Yes';
   do j=1 to 60;
      if (ranuni(1312) &amp;gt; 0.4) then Gender='Female';
      else                         Gender='Male';

      Absence = ranexp(99);
      if (Absence &amp;lt; 0.5) then GPA= 4 + rannor(99)/3.5;
      else                    GPA= 4 - abs(rannor(99)/3.5);

      if (Gender='Female') then GPA= GPA + 0.02;

      id1= ranuni(99);
      id2= ranuni(99);
      output;
   end;

   Music= 'No';
   do j=1 to 100;

      Absence= ranexp(99);
      if (ranuni(99) &amp;gt; 0.45) then Gender='Female';
      else                        Gender='Male';
      if (Absence &amp;lt; 0.5) then GPA= 4 + rannor(99)/4.2;
      else                    GPA= 4 - abs(rannor(99)/4.2);

      id1= ranuni(99);
      id2= ranuni(99);
      output;
   end;

   do j=1 to 40;
      Absence= 2 + ranexp(99);
      if (ranuni(99) &amp;gt; 0.5) then Gender='Female';
      else                       Gender='Male';

      GPA= 3.4 - abs(rannor(99)/4.2);

      id1= ranuni(99);
      id2= ranuni(99);
      output;
   end;
run;

proc sort data=school;
   by id1;
run;

data school;
   set school;
   StudentID= _n_;
   Absence= int(Absence*100+0.5) / 100;
   GPA= int(GPA*100+0.5) / 100;
run;

proc sort data=school;
   by id2;
run;

proc print data=School(obs=10);
   var StudentID Music Gender Absence;
run;

ods graphics on;
proc psmatch data=School region=treated;
   class Music Gender;
   psmodel Music(Treated='Yes')= Gender Absence;
   match distance=lps method=greedy(k=1) exact=Gender caliper=0.5;
   assess lps var=(Gender Absence)
          / stddev=pooled(allobs=no) stdbinvar=no
            plots(nodetails)=all weight=none;
   output out(obs=match)=OutEx4 matchid=_MatchID;
run;

proc logistic data=school;
class music gender;
model music (event = 'Yes') = Gender Absence;
output out=check p=check;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Aug 2019 17:02:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Why-the-propensity-score-from-PROC-PSMATCH-is-different-from-the/m-p/581217#M28505</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-08-14T17:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: Why the propensity score from PROC PSMATCH is different from the PS estimated from PROC LOGISTIC</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Why-the-propensity-score-from-PROC-PSMATCH-is-different-from-the/m-p/581218#M28506</link>
      <description>Thanks a lot for the comment and mock up code!&lt;BR /&gt;&lt;BR /&gt;I think you might be right and it could be computer rounding issue during&lt;BR /&gt;different processes. I will check with the tech support.&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Aug 2019 17:09:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Why-the-propensity-score-from-PROC-PSMATCH-is-different-from-the/m-p/581218#M28506</guid>
      <dc:creator>yistella</dc:creator>
      <dc:date>2019-08-14T17:09:16Z</dc:date>
    </item>
  </channel>
</rss>

