Hello,
I am running SAS 9.4 TS1M5 and have two questions about generating propensity scores and using PROC PSMATCH.
1) I have successfully run a logistic regression model using proc logistic to generate the probabilities and then calculate the inverse weights, but when I ran the same model using PROC PSMATCH, my probabilities (indicated by _PS_ in the output) did not match the probabilities generated by proc logistic (using the pred values). Does anyone know why this might be and if there's something incorrect with my code that would explain it? I have included both sets of code below.
proc logistic data=test;
class filled30day race sex VALVE PULMCIRC PERIVASC HTN_C PARA NEURO CHRNLUNG DM DMCX HYPOTHY RENLFAIL LIVER
LYMPH METS TUMOR COAG OBESE WGHTLOSS LYTES BLDLOSS ANEMDEF PSYCH DEPRESS pre_pdc icd ;
model filled30day = race sex indx_anydual VALVE PULMCIRC PERIVASC HTN_C PARA NEURO CHRNLUNG DM DMCX HYPOTHY RENLFAIL LIVER
LYMPH METS TUMOR COAG OBESE WGHTLOSS LYTES BLDLOSS ANEMDEF PSYCH DEPRESS pre_pdc preindx_snf_los
preadmitNo totperbach totperpov icd
/ link=glogit rsquare lackfit ;
output out=p_scores pred=ps_fill30 xbeta=logit_ps_fill30;
run;
proc psmatch data=test region=allobs;
class filled30day race sex VALVE PULMCIRC PERIVASC HTN_C PARA NEURO CHRNLUNG DM DMCX HYPOTHY RENLFAIL LIVER
LYMPH METS TUMOR COAG OBESE WGHTLOSS LYTES BLDLOSS ANEMDEF PSYCH DEPRESS pre_pdc icd icd;
psmodel filled30day (treated='1') = race sex VALVE PULMCIRC PERIVASC HTN_C PARA NEURO CHRNLUNG DM DMCX HYPOTHY RENLFAIL LIVER
LYMPH METS TUMOR COAG OBESE WGHTLOSS LYTES BLDLOSS ANEMDEF PSYCH DEPRESS pre_pdc preindx_snf_los
preadmitNo totperbach totperpov icd;
assess lps var=(race sex VALVE PULMCIRC PERIVASC HTN_C PARA NEURO CHRNLUNG DM DMCX HYPOTHY RENLFAIL LIVER
LYMPH METS TUMOR COAG OBESE WGHTLOSS LYTES BLDLOSS ANEMDEF PSYCH DEPRESS pre_pdc preindx_snf_los
preadmitNo totperbach totperpov icd)
/ varinfo weight=atewgt;
output out(obs=all)=OutEx1 atewgt=_ATEWT_;
run;
And here is a sample of the output and the mismatched values:
filled30day Log results pscore weight PSMATCH results _PS_ _ATEWT_
1 .43005 2.32532 .56981 1.75498
1 .32044 3.12072 .67946 1.47177
2) I am working with a second model with a treatment that has more than two levels. Does anyone know if it's possible to use PSMATCH when modeling an outcome with more than two treatment levels? Thank you.
Thank you for explaining it so clearly! I hadn't realized how the two different variable specifications aligned between the two procedures, so your replies were incredibly helpful. I specified ref='0' option in my proc logistic model and the output now matches perfectly with the psmatch output.
1) In the code you provided it looks like one possibility might be that PROC LOGISTIC and PROC PSMATCH are modeling different levels of the variable filled30day. The TREATED="1" option is used in the PSMODEL statement but I don't see the EVENT= or REF= option specified in the MODEL statement of PROC LOGISTIC. The EVENT= option in PROC LOGISTIC should be analogous to the TREATED= option in PROC PSMATCH, and the REF= option would be analogous to the CONTROL= option in PROC PSMATCH. What level of the response variable PROC LOGISTIC models or what level is used as the reference level should be printed in the log and in a note after the Response Profile table.
2) No, PROC PSMATCH only supports binary treatment variables.
For a binary response variable the reference level used in the GLOGIT model fit by PROC LOGISTIC (filled30day=1 according the note you provided) would match the control level in PROC PSMATCH not the treated level, so it does look like PROC LOGISTIC and PROC PSMATCH are modeling different levels of the response.
To change what level is used as the reference level in a GLOGIT model you can still use the REF= option to specify the other level of the variable filled30day.
Thank you for explaining it so clearly! I hadn't realized how the two different variable specifications aligned between the two procedures, so your replies were incredibly helpful. I specified ref='0' option in my proc logistic model and the output now matches perfectly with the psmatch output.
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.
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.