1
$\begingroup$

I am analyzing observational study data. My predictor variable is tg4 with 4 categories (0,1,2,3) and my response variable is dm (0,1). my analysis step as follow:

  1. I use mice package to impute missing data as follow chi<-chi %>% mice(seed = 123, print = FALSE, m=5)
  2. Covariate balance assessment using standardized mean differences (SMD) (I tried to use tableone package) but it does not work because I have 5 imputed datasets.
  3. calculating propensity score using multinomial logistic regression.
  4. calculating weight
  5. calculating pooled hazard ratio for all dataset
suvtime<-Surv(time=chi$time,event = chi$dm)
fit<- coxph(suvtime~tg4,data=chi, weights =weights)

Thank you for your help.

$\endgroup$

1 Answer 1

2
$\begingroup$

There is a set of packages you can use for this. The MatchThem package performs matching and IPW in multiply imputed datasets; you can supply it with a mids objects from mice and it will perform the weighting in all of the imputed datasets. It calls the weightit() function from the WeightIt package to do the weighting. You can then use the bal.tab() function in cobalt to assess balance on the imputed datasets. Once you have achieved balance, you can fit your outcome model using the with() function in MatchThem.

I recommend you 1) look at the WeightIt package and see its capabilities for multi-category treatments (there are many options beyond multinomial logistic regression); 2) look at the MatchThem package for applying WeightIt functionality to multiply imputed datasets and estimating treatment effects pooling across the datasets; and 3) look at the cobalt package for assessing balance generally and specifically with multiply imputed data and multi-category treatments. I am the author of all three of these packages, and they are designed to work seamlessly together specifically for this type of analysis.

$\endgroup$
3
  • $\begingroup$ Thank you very much, it works. I have a question for the output of assessing balance generally. When I use cobalt package for assessing balance bal.tab ().I got pairwise comparison instead of comparing all categories at ones(i.e I would like to get mean and SMD as one summary table) $\endgroup$
    – Bkry
    Commented Feb 6, 2022 at 5:28
  • $\begingroup$ I'm not exactly sure what you mean. You can request means using disp.means = TRUE. Read the cobalt vignettes carefully; your question is likely answered in it. $\endgroup$
    – Noah
    Commented Feb 6, 2022 at 6:00
  • $\begingroup$ Thank you, it was really helpful. $\endgroup$
    – Bkry
    Commented Feb 6, 2022 at 8:46

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.