Mediation analysis in R, Error in if (xhat == 0) out <- 1 else { : missing value where TRUE/FALSE needed
i am doing a mediation analysis in R using the mediate function of the mediation package.
exposure, mediator and outcome variables are all dichotomous. So i made 2 glm models.
When running the mediate function i keep getting the same error: Error in if (xhat == 0) out <- 1 else { : missing value where TRUE/FALSE needed.