data1 | R Documentation |
A toy dataset for causal mediation analysis with 3 uncausally related mediators.
data("data1")
A data frame with 1000 observations on the following 8 variables.
Treatment
a factor with levels 0
1
C1
a factor with levels 0
1
C2
a factor with levels 0
1
C3
a factor with levels 0
1
M1
a numeric vector
M2
a numeric vector
M3
a numeric vector
Outcome
a numeric vector
#data(data1)
#data1$Treatment=as.factor(data1$Treatment)
#data1$C1=as.factor(data1$C1)
#data1$C2=as.factor(data1$C2)
#data1$C3=as.factor(data1$C3)
#data1$M1=as.numeric(data1$M1)
#data1$M2=as.numeric(data1$M2)
#data1$M3=as.numeric(data1$M3)
#data1$Outcome=as.numeric(data1$Outcome)
#summary(data1)
#M1reg=lm(M1~ Treatment + C1 + C2, data=data1)
#M2reg=lm(M2~ Treatment + C1 + C3, data=data1)
#M3reg=lm(M3~ Treatment + C1 , data=data1)
#Yreg=lm(Outcome~ Treatment + M1 + M2 + M3 + C1 + C2 + C3, data=data1)
#med.analysis=multimediate(lmodel.m=list(M1reg,M2reg,M3reg),
#correlated=TRUE,model.y=Yreg,treat="Treatment",
#treat.value=1,control.value=0,J=1000,conf.level=0.95)
#summary(med.analysis,opt="avg")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.