CMAverse icon indicating copy to clipboard operation
CMAverse copied to clipboard

Unable to account for complex survey design

Open kodalih opened this issue 1 year ago • 0 comments

First, thanks for working on the package and making it publicly available.

I am using your package "CMAverse" to perform a single mediator analysis in the Nationally representative survey- NHANES. I have created a survey design object and added it to the model as data. However, the results of causal mediation analysis are the same for both unweighted and weighted (accounting for complex survey design) datasets. My understanding about the CMAverse package is that it can account for survey design to provide estimation, however, the codes neglect the survey's complex structure.

#to create survey object survey_object <- analysis_data %>% as_survey_design(id = SDMVPSU, strata = SDMVSTRA, weights = WTMEC4YR, nest = TRUE)

#Estimate causal effects and make inferences using cmest set.seed(2021) cma_model <- cmest(data = survey_object, model = "rb", outcome ="permth_int", event = "mortstat", exposure = "Exposure", mediator = "Mediator", basec = c("Confounder1", "Confounder2"),
EMint = TRUE, mreg = list("linear"), yreg = "coxph", astar = 2, a = 7, mval = list(0), estimation = "imputation", inference = "bootstrap", nboot = 10000)

Do you have any suggestions about how I can account for complex surveys?

Thank you for your time and consideration.

Regards,

Hanish

kodalih avatar Feb 22 '24 23:02 kodalih