Open iago-pssjd opened 2 years ago
The family you specified has a link-inverse function that requires an "extra"
argument. I'm not sure which values/objects this argument expects. I'll need some time to find out more...
library(VGAM)
#> Loading required package: stats4
#> Loading required package: splines
library(sjPlot)
library(sjmisc)
data(efc)
# make categorical
efc$c161sex <- to_factor(efc$c161sex)
# fit model with 3-way-interaction
fit <- vglm(neg_c_7 ~ c12hour * barthtot * c161sex, family = uninormal, data = efc)
link_inv <- fit@family@linkinv
link_inv
#> function (eta, extra = NULL)
#> {
#> M1 <- extra$M1
#> ncoly <- extra$ncoly
#> if ("identitylink" == "explink") {
#> if (any(eta[, M1 * (1:ncoly) - 1] <= 0)) {
#> warning("turning some columns of 'eta' positive in @linkinv")
#> for (ii in 1:ncoly) eta[, M1 * ii - 1] <- pmax(1e-05,
#> eta[, M1 * ii - 1])
#> }
#> }
#> eta2theta(eta[, M1 * (1:ncoly) - 1], "identitylink", earg = list(
#> theta = , inverse = FALSE, deriv = 0, short = TRUE, tag = FALSE))
#> }
#> <bytecode: 0x000001e171294bd0>
#> <environment: 0x000001e170acaa00>
Created on 2022-07-31 by the reprex package (v2.0.1)
I was just trying to reproduce the example in https://cran.r-project.org/web/packages/sjPlot/vignettes/plot_interactions.html, but with
VGAM::vglm
, which seems to be allowed for theggpredict
function (thanks to the existence ofget_predictions_vglm
), but I get the next error: