library(metapsyData) library(metapsyTools) d <- getData("depression-anxiety-transdiagnostic", version = "22.0.5") dat <- d$data # Add labels for 3-arm study Fernandez, 2020 dat[dat$study == "Fernandez, 2020", "multi_arm1"] <- dat[dat$study == "Fernandez, 2020", "condition_arm1"] # Run combined MA for depression outcome data filterPoolingData(dat, depanx == "dep") %>% runMetaAnalysis(which.run = "combined", rho.within.study = 0.5, which.combine = "arms") %>% {.$model.combined$data$N = .$model.combined$data$totaln_arm1 + .$model.combined$data$totaln_arm2; .$model.combined$data} -> depression # Run combined MA for anxiety outcome data filterPoolingData(dat, depanx == "anx") %>% runMetaAnalysis(which.run = "combined", rho.within.study = 0.5, which.combine = "arms") %>% {.$model.combined$data$N = .$model.combined$data$totaln_arm1 + .$model.combined$data$totaln_arm2; .$model.combined$data} -> anxiety # Run combined MA for mixed outcome data filterPoolingData(dat, depanx == "mix") %>% runMetaAnalysis(which.run = "combined", rho.within.study = 0.5, which.combine = "arms") %>% {.$model.combined$data$N = .$model.combined$data$totaln_arm1 + .$model.combined$data$totaln_arm2; .$model.combined$data} -> mix # Combine and save list(depression = depression, anxiety = anxiety, mix = mix, metadata = d$returnMetadata()) -> TransdiagnosticDB save(TransdiagnosticDB, file="www/data/TransdiagnosticDB.rda")