BookmarkSubscribeRSS Feed
Ashwini_uci
Obsidian | Level 7

Has anyone worked on Propensity score matching? ANy ideas how to go about it? I have never done that before. I use SAS.

Are there any macro programs available to do it?

Any help will be appreciated.

Thanks

2 REPLIES 2
Tom
Super User Tom
Super User

I have a simple one that I wrote a couple of years ago based on ideas in a paper by Craig Roberts and John R. Gerlach and the

PSMatching macro presented at SAS Global Forum 2007 by Marcelo Coca Perraillon.

http://www2.sas.com/proceedings/forum2007/185-2007.pdf

It assumes that you have already calculated a single numeric score variable that will be used to match cases to controls.

Here is the program header that describes what it can do.

%macro psmatch

/*----------------------------------------------------------------------

Propensity Score Matching - match treated cases to controls

----------------------------------------------------------------------*/

(treated=       /* Input dataset of treated cases (REQ) */

,control=       /* Input dataset of controls (REQ) */

,out=           /* Output dataset of matched id numbers (DEF=MATCH) */

,method=        /* Matching method (NN RADIUS CALIPER) (DEF=NN) */

,caliper=       /* Pscore delta (used by CALIPER and RADIUS method)*/

,id=            /* Name of ID variable (DEF=ID) */

,pscore=        /* Name of Propensity Score variable (DEF=PSCORE) */

,nmatch=        /* Number of controls to match per subject (DEF=1) */

,replacement=   /* Select controls with replacement? (def=Y) */

,seed1=         /* Seed for randomizing treated case order */

,seed2=         /* Seed for randomizing control order */

);

/*----------------------------------------------------------------------

Propensity Score Matching

Match treated cases to one or more controls. This does simple distance

based on absolute difference between the Propensity Score of the case

and the potential matched control. The propensity score variable must

already be in the input datasets. Three methods of selecting the matches

are available.

Methods

  NN      - Nearest neighbor. Find control with closest propensity score.

  CALIPER - Same as NN but only consider scores within +/- &CALIPER

  RADIUS  - Match ALL controls within +/- &CALIPER

Based on ideas in paper by Craig Roberts and John R. Gerlach and the

PSMatching macro presented at SAS Global Forum 2007 by Marcelo Coca

Perraillon. http://www2.sas.com/proceedings/forum2007/185-2007.pdf

Assumptions:

- TREATED and CONTROL input datasets use same variable names for ID

   and  propensity score variables.

- The propensity score variable must be numeric.

- The ID values must be unique keys for their datasets.

Calls to: parmv.sas varexist.sas

Outputs:

  Dataset with list of matched cases and controls. The output dataset

is not sorted. Unmatched treated cases are not included in the output.

  VAR      Description

  -------- -------------------------------------------------------

  IDT      Treated case ID

  IDC      Control case ID

  DISTANCE Distance between the propensity scores (absolute value)

Usage Notes:

- When using SAS Version 9.1 or higher will use a hash object.

- Creates work datasets _TREATED and _CONTROL.

- When NMATCH > 1 then also creates and deletes view _TREATV_.

- When METHOD=RADIUS replacement parameter does not apply. Controls

   are selected within a treated case without replacement but are

   available for matching to other treated cases (with replacement).

- Treated and Control datasets are randomly ordered so that when there

   are multiple controls of equal distance a random one will be

   selected.

-----------------------------------------------------------------------

History:

02AUG2009  abernt Creation

----------------------------------------------------------------------*/

Yasu
Fluorite | Level 6

Hi,

If you are interested in the analysis of observational studies,

I reccommend the following book. I think the chapter 3 will help you especially.

Analysis of Observational Health Care Data Using SAS

http://www.amazon.com/Analysis-Observational-Health-Care-Using/dp/1607642271

Good luck.

Yasu

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 2 replies
  • 3539 views
  • 0 likes
  • 3 in conversation