Propensity score matching after imputation in R with mice 9I have a dataset (500 rows) with missing values in different variables for a propensity score analysis. First I created the propensity score matching by omitting the rows with missing values (about 100 rows) in the variables I used for propensity score calculation, but now I would like to try to impute the missing values with the mice package.
In a first step I imputed the data like this:
impute <- mice(mydata, method = 
  methods, predictorMatrix = 
  predictormatrix, m = 5, maxit = 
   3)
mydata <- complete(impute)

So - as far as I understand - "mydata" now is a new data frame with the imputed values, but it is the first out of 5 different attempts of imputation (because the first attempt is used by default).
Now, as "mydata" is a data frame, I have my "full" data available and can continue with my propensity score matching code:
# matching
match <- matchit(treatment ~ independent1 + independet2 + independent3, data = mydata, method = "nearest")
matched_data <- match.data(match)

# model for outcome by treatment
model <- glm(outcome ~ treatment, data = matched_data, family = binomial(link = "logit"))
publish(model)

So this obviously works if I'm fine with using only the first out of 5 possible imputed datasets (as far as I now "complete" uses the first dataset by default).
Now my question is: I read about the "pool" function, but it seems that in the end I need a regression formula (like seen here https://rdrr.io/cran/mice/man/pool.html at the end of the page > "Example").
My favorite result of the imputed data would be a completed dataset with the same number of rows as before the imputation process (5oo rows) but with imputed values (by all 5 datasets) instead of NAs.
For example:
final_imputed_data <- complete(impute) # don't use the first imputed dataset (out of 5) but all 5

Or do I misunderstand the sense of multiple imputation?
 A: To do multiple imputation with propensity score matching, you should use the MatchThem package, which was designed specifically for this purpose. You need to do the following steps:

*

*Multiply impute the data, creating M (e.g., 5) separate datasets with the missing values filled in by estimates of the missing values. mice does this and stores the output in a mids object (which you have called impute). You should use way more than 5 (e.g., 50) imputations, as more is always better.

*Estimate propensity scores within each imputed dataset and then perform the matching within each imputed dataset. MatchThem does this using the matchthem() function, which uses the same sytnax as matchit() but takes in a mids object instead of a data frame.

*Assess balance on the matched multiply imputed data. The cobalt package works with matchthem objects (called mimids objects) to assess balance across and within imputed datasets.

*If balance is achieved, estimate the effect within the imputed datasets. The MatchThem functions with() and pool() (which work similarly to the corresponding functions in mice) do this, correctly incorporating the weights, matching structure, and correction for multiple imputation.

All this is described in the MatchThem paper and documentation. Remember that propensity score matching and multiple imputation are advanced statistical techniques and should only be used by someone with advanced statistical training using these methods.
