R code like this:
library(mma)
data <- subset(d,d$RACE=="1-White" | d$RACE=="3-Black")
x <- data[, c("AGE","GENDER","EMPLOYMENT", "PIR", "Food_Security", "EDUCATION", "HEALTH_ACCESS", "HEALTH_INSURANCE", "HOME", "MARITAL")]
x
pred <- data[, c("RACE")]
pred
y=Surv(data$permth_int,data$mortstat)
data.b.surv <- data.org(x,y,pred=pred,mediator=3:10,jointm=3:10,predref = "1-White" ,
alpha=0.99,alpha2=0.99)
summary(data.b.surv)
# point estimates #
set.seed(2023)
point <- med(data=data.b.surv, n=100,refy = "1-White", type="lp", w=data$NHANES_Weight)
point
total <- mean(point$a.binx$te)
total
indirect <- apply(point$a.binx$ie$pred,2,mean)
indirect
prop <- indirect/total
prop
I would like to calculate the mediation in mma R package. I have successfully estimate the relative effect (indirect/total), while I can't calculate the standard error (SE) or 95% CI. If I can estimate the SEs, I can estimate the 95% CI in “prop±1.96*SE”. Can you help me?
I have successfully estimate the relative effect (indirect/total), while I can't calculate the standard error (SE) or 95% CI. If I can estimate the SEs, I can estimate the 95% CI in “prop±1.96*SE”. Can you help me?