2
$\begingroup$

I am applying a propensity score matching on R using the package Matchit. I read that to match the observations, you should take the covariates and balance them. However, only pre-treatment observations of such covariates must be selected for the matching, unless the covariates are not affected by the treatment.

My problem: If I filter the dataset only for the pre-treatment observations, I will get a final matched data with only the pre-treatment observations, which is not useful to me as I then need to run a regression with the full dataset of observations.

Question: How can I filter the dataset to get pre-treatment observations only, get the matching, and then use the matched dataset with FULL observations (pre- and post-treatment) to run the final regression?

$\endgroup$
1
  • $\begingroup$ On which statistical principle are you basing the choice of using matching and discarding data? Why is a propensity score relevant here? Consider using the full dataset and using multiple imputation for missing baseline measurements. If more than 1/2 (depending on the absolute sample size) of the observations are missing your dataset may be unsuitable for answering the question at hand. $\endgroup$ Commented Mar 10, 2022 at 13:14

1 Answer 1

1
$\begingroup$

In MatchIt, you tell the matchit() function which variables you want to match on. You don't need to filter the dataset before running matchit(). When you run match.data() on the matchit output, you will get a dataset that is a subset of your original data but only with the matched units. Follow the tutorials in the MatchIt vignettes.

If, for whatever reason, your pre-treatment covariates and outcomes are stored in two different datasets, you can run matchit() on the dataset containing the pretreatment covariates and treatment, extract the matched dataset using match.data(), and then merge (i.e., left join) the outcome dataset with this matched dataset so that only those with rows in the matched dataset are retained.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.