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.
For example, obs A from PROC PSMATCH got PS=0.0843553047 and got PS= 0.0843554561 from PROC LOGISTIC.
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?
The codes I used are as below
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;
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 🙂
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.
/*-----------------------------------------------------------------
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) > 0.4) then Gender='Female';
else Gender='Male';
Absence = ranexp(99);
if (Absence < 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) > 0.45) then Gender='Female';
else Gender='Male';
if (Absence < 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) > 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;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.