Closed aolney closed 6 years ago
If the problem is that factors are not allowed because of the interpretability of removing the intercept then this could be a simple documentation fix.
Ok, I stand corrected, this is in the documentation.
For binary response models, the ’mediator’ must be a numeric variable with values 0 or 1 as opposed to a factor.
I humbly suggest it also be included in the vignette as it is quite surprising, and the vignette includes binomial mediation examples
Thanks for the comment. I spent more than two hours trying to solve the problem before I found this. I would like to say this comment worths at least four hours.
Running the following model, with MapChange as a binary factor
yields the error message
Error in if (xhat == 0) out <- 1 else { : missing value where TRUE/FALSE needed
I believe this is an error in function
pval
:caused by
xhat
having value NA.Interestingly I can remove this error by keeping
MapChange
asnum
instead offactor