Load the regimes package, simulate data, and fit ACPME.
#load package
library(regimes)
#simulate data
<- simregimes(scenario="acpme1", seed=1234)
dat
#estimate model
<- acpme(Z=dat$Z,C=dat$C,y=dat$Y, niter=1000) fit
Summarize results
#summerize
<- summary(fit)
summer 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
<- summary(fit, estimate=c(1,1,1))
summer_e $estimate summer_e
## mean lower upper
## 1 0.836621 0.4739201 1.191193
#or multiple estimates
<- summary(fit, estimate=cbind(c(1,1,1),c(1,1,0)))
summer_e2 $estimate summer_e2
## mean lower upper
## 1 0.8366210 0.4739201 1.191193
## 2 0.4732153 0.1116005 0.807915
Now display some results.
#plot estimtes
<- plot(summer) plts