0

To apply the average treatment effect, I employ the matchthem package.

Although the dataset includes numeric and chatacteristic variables with too many NAs. Due to this, neither of mice or amelia is possible to apply.

My questions are:

1- How to overcome on endogeneity in a dataset with missing covariate values?

2- The treatment (DM) actually includes binary variables, but it returns below errod. How can I fix this?

library('mice')
imputed.datasets = mice(alldata)
imputed.datasets2 <- na.omit(imputed.datasets)
models <- matchthem(CL ~ DM, imputed.datasets2,
                approach = "within",
                method = "cem")

Matching Observations | dataset: #1Error: The treatment must be a binary variable.

David
  • 1
  • 2
  • Welcome. Please read this: https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example and then edit your question accordingly. – John Polo Aug 22 '22 at 19:12
  • Thanks John, I took a look at that but seems you got my q wrong because it's not related to that topic – David Aug 24 '22 at 13:35
  • The comment is not an answer. It points to a link that explains how to write a good question. As your question is currently written, it does not include code for anyone to know what you did, nor a sample of data. In other words, your question, as it is currently written, does not provide people with the information necessary to attempt an answer for you. It's not even clear if you are asking about code or a statistical issue. If you are asking about endogeneity applied to a incomplete dataset as a general issue, your question might be a better fit for https://stats.stackexchange.com/ – John Polo Aug 24 '22 at 15:23

0 Answers0