Hi! I have been trying to run the tidy() function on a mediate object and I get the following error:
Error: No tidy method for objects of class mediate
Here is a minimal example:
library(broom)
library(mediation)
#> Loading required package: MASS
#> Loading required package: Matrix
#> Loading required package: mvtnorm
#> Loading required package: sandwich
#> mediation: Causal Mediation Analysis
#> Version: 4.5.0
model_med <- lm(vs ~ wt, data = mtcars)
model_out <- lm(am ~ wt*vs, data = mtcars)
mediation <- mediate(model_med, model_out, sims = 1000, treat = "wt", mediator = "vs", treat.value = 2.5, control.value = 3.5)
tidy(mediation)
#> Error: No tidy method for objects of class mediate
I can't seem to find any information on this error. I thought mediate objects could be passed to the tidy function. Does anyone have any clue why this is happening? Thanks!