You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried to use broom.helpers and ggstats to generate marginal predictions from a multinomial model (using nnet package) and graph it (similarly to what is done with logistic regression on this webpage).
Any idea what's going on? I don't understand if the problem is located in broom.helpers, ggstats or elsewhere.
library(nnet)
mod<- multinom(Species~., data=iris)
#> # weights: 18 (10 variable)#> initial value 164.791843 #> iter 10 value 16.177348#> iter 20 value 7.111438#> iter 30 value 6.182999#> iter 40 value 5.984028#> iter 50 value 5.961278#> iter 60 value 5.954900#> iter 70 value 5.951851#> iter 80 value 5.950343#> iter 90 value 5.949904#> iter 100 value 5.949867#> final value 5.949867 #> stopped after 100 iterationsggstats::ggcoef_multinom(
model=mod,
tidy_fun=broom.helpers::tidy_marginal_predictions,
show_p_values=FALSE,
signif_stars=FALSE,
significance=NULL,
vline=FALSE)
#> Error in `dplyr::left_join()`:#> ! Join columns in `x` must be present in the data.#> ✖ Problem with `y.level`.mod|>broom.helpers::tidy_marginal_predictions()
#> #> Term Estimate Std. Error z Pr(>|z|) CI low CI high#> 4.3 0.3333 0 Inf < 2.22e-16 0.3333 0.3333#> 5.1 0.3333 0 Inf < 2.22e-16 0.3333 0.3333#> 5.8 0.3333 0 Inf < 2.22e-16 0.3333 0.3333#> 6.4 0.3333 0 Inf < 2.22e-16 0.3333 0.3333#> 7.9 0.3333 0 Inf < 2.22e-16 0.3333 0.3333#> 2 0.3333 0 Inf < 2.22e-16 0.3333 0.3333#> 2.8 0.3333 0 Inf < 2.22e-16 0.3333 0.3333#> 3 0.3333 0 Inf < 2.22e-16 0.3333 0.3333#> 3.3 0.3333 0 Inf < 2.22e-16 0.3333 0.3333#> 4.4 0.3333 0 Inf < 2.22e-16 0.3333 0.3333#> 1 0.3333 0 Inf < 2.22e-16 0.3333 0.3333#> 1.6 0.3333 0 Inf < 2.22e-16 0.3333 0.3333#> 4.35 0.3333 0 Inf < 2.22e-16 0.3333 0.3333#> 5.1 0.3333 0 Inf < 2.22e-16 0.3333 0.3333#> 6.9 0.3333 0 Inf < 2.22e-16 0.3333 0.3333#> 0.1 0.3333 0 Inf < 2.22e-16 0.3333 0.3333#> 0.3 0.3333 0 Inf < 2.22e-16 0.3333 0.3333#> 1.3 0.3333 0 Inf < 2.22e-16 0.3333 0.3333#> 1.8 0.3333 0 Inf < 2.22e-16 0.3333 0.3333#> 2.5 0.3333 0 Inf < 2.22e-16 0.3333 0.3333#> #> Prediction type: #> Columns: variable, term, type, estimate, std.error, statistic, p.value, conf.low, conf.high
The text was updated successfully, but these errors were encountered:
some adaptation of the code will be required for compatibility with multinomial model.
I will try to work on it next week.
larmarange
changed the title
tidy marginal predictions of multinomial models
tidy marginal predictions of multinomial and ordinal logistic models
Feb 23, 2023
Hi !
I've tried to use
broom.helpers
andggstats
to generate marginal predictions from a multinomial model (usingnnet
package) and graph it (similarly to what is done with logistic regression on this webpage).Any idea what's going on? I don't understand if the problem is located in
broom.helpers
,ggstats
or elsewhere.The text was updated successfully, but these errors were encountered: