-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get_coef.gamlss
bug
#933
Comments
remotes::install_github("vincentarelbundock/marginaleffects") Restart your library(gamlss)
library(marginaleffects)
dat <- read.csv("https://vincentarelbundock.github.io/Rdatasets/csv/palmerpenguins/penguins.csv", na.strings = "")
dat <- dat |>
transform(prop = rBE(nrow(dat), mu = 0.5, sigma = 0.2)) |>
na.omit()
mod <- gamlss::gamlss(
prop ~ sex * body_mass_g + year + re(random = list(~ 1 | species, ~ 1 | island)),
family = BE(),
data = dat,
trace = FALSE)
avg_comparisons(mod, what = "mu")
# Warning in vcov.gamlss(model, what = dots$what): Additive terms exists in the mu formula.
# Standard errors for the linear terms maybe are not appropriate
#
# Term Contrast Estimate Std. Error z Pr(>|z|) S 2.5 % 97.5 %
# body_mass_g +1 6.34e-06 5.39e-06 1.18 0.240 2.1 -4.23e-06 1.69e-05
# sex male - female -1.92e-02 3.56e-02 -0.54 0.589 0.8 -8.90e-02 5.06e-02
# year +1 -1.29e-02 3.69e-05 -348.60 <0.001 Inf -1.29e-02 -1.28e-02
#
# Columns: term, contrast, estimate, std.error, statistic, p.value, s.value, conf.low, conf.high
# Type: response |
Here strengejacke/ggeffects#297 (comment) @DHLocke asks:
|
Amazing, thanks so much. sorry for a novice question, what is the appropriate way to combined those then? plot_predictions(mod, what = 'mu', condition = c('body_mass_g', 'sex')) # excellent! great, butWarning message:In vcov.gamlss(model, what = dots$what) :Additive terms exists in the mu formula.Standard errors for the linear terms maybe are not appropriatetry to add predictions togetherpreds_mu <- predictions(mod, what = 'mu') library(tidyverse) ?? |
I'm not a specialist of these models, so I can't tell you if it makes sense to just add them up like this. But if you are just asking how to do it mechanically, then what you are doing seems fine. You probably want to check the |
Reported here first:
strengejacke/ggeffects#297 (comment)
The text was updated successfully, but these errors were encountered: