BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
bgladd
Fluorite | Level 6

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.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
bgladd
Fluorite | Level 6

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. 

View solution in original post

4 REPLIES 4
MichaelL_SAS
SAS Employee

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. 

bgladd
Fluorite | Level 6
Hello,

Thanks for getting back to me. In proc logistic I don't have to specify event= option (here's the Log note: NOTE: The EVENT= option for the response variable is ignored for LINK=GLOGIT.) and according to the log (NOTE: PROC LOGISTIC is fitting the generalized logit model. The logits modeled
contrast each response level against the reference level (filled30day=1).) the event being modeled was 1, so the proc logistic and PSMATCH appear to be set up the same way.

Any other ideas? Some of my coworkers are suspect of proc psmatch's accuracy and they do not use it, but I like the ease of the output options and was hoping it work.

Re: 2). That's what I thought. If PSMATCH can be fixed, that would be my next wish-list suggestion for SAS.

Thank you.
Barbara




MichaelL_SAS
SAS Employee

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. 

bgladd
Fluorite | Level 6

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. 

sas-innovate-white.png

Our biggest data and AI event of the year.

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.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 4 replies
  • 1921 views
  • 1 like
  • 2 in conversation