Open albertostefanelli opened 2 days ago
However, semTools does not support any link function at this point ...
Is that true? I doubt it! But even if so, it seems to be a simple matter, as we can just manually specify it:
emmeans(..., tran = "probit")
However, if you're trying to estimate slopes, note you can't back-transform slopes when there is a transformation or link present. That said, the emtrends
function is pretty flexible in terms of computing difference quotients relative to other scales; see its documentation.
thanks for the answer. I confirm that that both the emtrends
and emmeans
functions provided by the semTools package do not support binomial dependent variables. Running any of these functions results in the following error
Error : {dem60_bin} is an ordered variable! Currently only continuous DVs are supported.
See `?lavaan2emmeans` for more info.
Error in (function (object, at, cov.reduce = mean, cov.keep = get_emm_option("cov.keep"), :
Perhaps a 'data' or 'params' argument is needed
I am trying to reproduce the slope estimation form a LPM model (first model in my previous post ) but using a probit model (second model in my previous post), all in lavaan. Any suggestion on the code contained in my previous post is appreciated. if I manage to figure out how to calculate the std. errors manually I can do a pull request in the semTool package to implement the support for the probit link.
OK, well that clarifies things. It may be possible to get qdrg()
to work with those models. But it seems to me you'll get more help from the semTools developers than from me.
My additional comment is that there must be a reason that ordered dependent variables are not supported by semTools::lavaan2emmeans
. So I suspect that it is not easy to do what you are trying to do.
On the other hand, it looks like you just have a binary response, but for some reason the DV is ordered. Maybe if it is just an ordinary probit model (unordered factor), it will be supported. But I don't understand how it came to be treated as an ordered factor.
I have posted on the semTools github but I am afraid I will get no response for the devs any time soon.
However, just for reference. to specify a probit model with an unordered factor lavaan uses the ordered =
argument. See this discussion from the dev of lavaan
I am trying to implement the calculation for simple slopes estimation for probit models in lavaan as it is currently not support in semTools (I will cross-post).
The idea is to be able to plot the slope of a regression coefficient and the corresponding CI. So far, we can achieve this in lavaan + emmeans using a linear probability model.
However, semTools does not support any link function at this point so I have to relay on manual calculations to obtain the predicted probabilities. So far, I am able to estimate the change in probability for the slope and the marginal probabilities. However, I am pretty sure that the way I am calculating the SE is wrong as they too small compared to the lpm model. any advice on this is highly appreciated.