R: error pops up when calculating confidence intervals with RMediation::medci

19 Views Asked by At

I have the following data:

exp_med_b <- c(-0.0594832340,-0.0219711830,-0.0418851800,0.0004572729,-0.0011745170)
med_out_b <- c(-0.02325445,-0.03738470,0.12305580,3.40118200,0.88303590)
exp_med_se <- c(0.040328500,0.013646880,0.030657290,0.001533312,0.002025108)
med_out_se <- c(0.01300451,0.08911688,0.07536918,1.21814000,0.54391590)

and am trying to run the following

library(RMediation)

confidence_intervals <- medci(mu.x=exp_med_b,
                              mu.y=med_out_b,
                              se.x=exp_med_se,
                              se.y=med_out_se,
                              type='dop')

but the following error pops up:

Error in integrate(gx, lower = -Inf, upper = Inf, z = z) : maximum number of subdivisions reached

Any help is greatly appreciated.

0

There are 0 best solutions below