Unused factor levels in categorical (independent or control) variables should be dropped. Argument drop.unused.levels in function model.frame() controls this and should be set to TRUE.
Likely this needs to be fixed in the default method of fit_mediation(), where non-numeric x variables and covariates are converted using model.matrix().
Unused factor levels in categorical (independent or control) variables should be dropped. Argument
drop.unused.levels
in functionmodel.frame()
controls this and should be set toTRUE
.