BookmarkSubscribeRSS Feed
Epi_Stats
Obsidian | Level 7

Hi,

 

I’ve run a propensity score analysis with inverse probability of treatment weights (IPW) using SAS PROC CAUSALTRT.

 

I want to plot the logit of the propensity score after IPW, but can’t figure out how to weight the propensity scores in the code I’m using to generate the plot. Example code from SAS included below:

 

proc template;
  define statgraph densityplot;
    begingraph;
      entrytitle "Highway Mileage Distribution by Origin";
      layout overlay /
        xaxisopts=(griddisplay=on
          gridattrs=(color=lightgray pattern=dot))
        yaxisopts=(griddisplay=on
          gridattrs=(color=lightgray pattern=dot));
        densityplot mpg_highway / name="densityplot" group=origin;
        discretelegend "densityplot" / title="Origin:";
      endlayout;
    endgraph;
  end;
run;

proc sgrender template=densityplot data=sashelp.cars;
run;

I have seen papers which use IPW and report the propensity score graphically before and after IPW. I assume these researchers have weighted the propensity score in the after plot, but I don't understand how to achieve this, or if this is the correct approach to generate the propensity score plot after IPW?

 

In my output, I have a propensity score variable and the IPW variable.

 

Any help/advice would be greatly appreciated,

 

Thank you

 

 

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 0 replies
  • 989 views
  • 0 likes
  • 1 in conversation