Fork me on GitHub

Adjustment for Confounding in the Presence of Multivariate Exposures

Ander Wilson

An Example

Load the regimes package, simulate data, and fit ACPME.

#load package
library(regimes)

#simulate data
dat <- simregimes(scenario="acpme1", seed=1234)

#estimate model
fit <- acpme(Z=dat$Z,C=dat$C,y=dat$Y, niter=1000)

Summarize results

#summerize
summer <- summary(fit)
summer
## Call:
## acpme(Z = dat$Z, C = dat$C, y = dat$Y, niter = 1000)
## 
## Estimates:
##     mean  lower upper
## X1 0.129 -0.207 0.431
## X2 0.344  0.189 0.493
##    0.363  0.292 0.440
## 
## 
## Covariate inclusion probabilities:
##     posterior prior
## C1      1.000 1.000
## C2      1.000 1.000
## C3      1.000 1.000
## C4      1.000 1.000
## C5      1.000 1.000
## C6      1.000 1.000
## C7      1.000 1.000
## C8      1.000 1.000
## C9      1.000 1.000
## C10     1.000 1.000
## C11     1.000 0.924
## C12     1.000 0.921
## C13     1.000 0.874
## C14     1.000 0.896
## C15     1.000 0.973
## C16     1.000 0.514
## C17     1.000 0.541
## C18     1.000 0.512
## C19     1.000 0.510
## C20     1.000 0.704
## C21     1.000 0.501
## C22     1.000 0.523
## C23     1.000 0.506
## C24     0.894 0.535
## C25     1.000 0.578
## C26     1.000 0.520
## C27     1.000 0.501
## C28     1.000 0.536
## C29     1.000 0.521
## C30     1.000 0.510
## C35     0.550 0.952
## C80     0.520 0.541
## C98     0.516 0.564
#summerize with a specific linear combination of the exposures
summer_e <- summary(fit, estimate=c(1,1,1))
summer_e$estimate
##       mean     lower    upper
## 1 0.836621 0.4739201 1.191193
#or multiple estimates
summer_e2 <- summary(fit, estimate=cbind(c(1,1,1),c(1,1,0)))
summer_e2$estimate
##        mean     lower    upper
## 1 0.8366210 0.4739201 1.191193
## 2 0.4732153 0.1116005 0.807915

Now display some results.

#plot estimtes
plts <- plot(summer)