install.packages('bmem') library(bmem) ### Step 1. Prepare data ### # Read data into R and store them in an object called dset dset<-read.table("rdata.txt", header=T) ### Step 2. Specify the model ### M1<-specifyEquations(exog.variances=T) math = b*HE + c*ME HE = a*ME ### Step 3. Run the analysis ### indirect<-c('a*b', 'a*b+c') M1.res<-bmem(dset, M1, indirect, boot=1000, method='mi', m=100) ### plot the bootstrap distribution plot(M1.res, 'a*b') plot(M1.res, 'a*b+c')