1
votes

Is it possible to specify a vector of variables to ignore during matching using the %CEM macro for SAS (available at: https://gking.harvard.edu/cem)?

As an example, consider a dataset called "Test" with the following variables:

  • Person_id: The ID primary key
  • Treatment: Treatment variable, equals 1 if an individual had treatment and 0 otherwise
  • X1: Binary auxiliary variable, e.g. gender
  • X2: Discrete auxiliary variable, e.g. age group
  • X3: Continuous auxiliary variable
  • Y: Outcome variable of interest.

The goal is to estimate the impact of "Treatment" on Y. First, we want to match treated observations with controls using only X1 and X2 during matching.

The cem {cem} command in R provides an option, "drop", which allows one to specify a vector of variables to ignore during matching:

cem(treatment="treatment", data=Test, drop=c("X3","Y"),k2k=FALSE)

Using cem in Stata, one can simply specify the variables to use in the matching procedure:

. cem X1 X2, tr(treatment)

Would it be possible to run the %CEM macro in SAS using only X1 and X2 for matching?

1
If the data set can be passed to the %CEM macro, could you not just add a keep= or a drop= data set option for the variables you're interested in? E.g. %cem(my_data_set(keep=X1 X2)).Amir
Hi Amir, thank you very much for your quick reply and suggestion! I will give this a try and let you now how it goes.L.Michel

1 Answers

0
votes

The latest version of %CEM allows one to specify a vector of variables to use in the matching process, i.e.:

%CEM (
      lib = work, 
      dataset = Test, 
      id = Person_id, 
      treat = Treatment, 
      keep = X1 X2,
      del_miss = 0,
      method = Sturges,
      path_graph = C:\path_graph,
      report = on
);