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
a suggested code or documentation change, improvement to the code, or feature request
Hi,
I think I think the level argument in the margins_summary() function is not working as intended: Setting the confidence level to a different value than 95 has no effect on the output. It seems the argument is simply ignored. This happens with lm() and lme4::glmer(), and when using either margins_summary() or summary(margins()). Strangely, plot(margins()) works as described in the vignette -- but, contrary to what is written there, it is not possible to specify multiple confidence levels.
Hope I'm not misunderstanding something here! Many thanks in advance!
Example:
## load package
library("margins")
## code goes here
data(mtcars)
mod<- lm(mpg~hp, data=mtcars)
margins_summary(mod) # baseline
margins_summary(mod, level=.9) # same result
margins_summary(mod, level=.99) # same result# just for fun
margins_summary(mod, level=90) # same result
margins_summary(mod, level=99) # same result
margins_summary(mod, level=.01) # same result
margins_summary(mod, level="99") # same result# same here
summary(margins(mod,
level=99))
# These work
plot(margins(mod),
level= c(.9))
plot(margins(mod),
level= c(.999))
Thisproducesan error ("length of 'dimnames' [2] not equal to array extent")
plot(margins(mod),
level= c(.999,.9))
## session info for your system
sessionInfo()
Rversion4.2.2 (2022-10-31)
Platform:x86_64-apple-darwin17.0 (64-bit)
Runningunder:macOSVentura13.3.1Matrixproducts:defaultLAPACK:/Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dyliblocale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8attachedbasepackages:
[1] statsgraphicsgrDevicesutilsdatasetsmethodsbaseotherattachedpackages:
[1] margins_0.3.26loadedviaa namespace (andnotattached):
[1] Rcpp_1.0.10rstudioapi_0.14magrittr_2.0.3hms_1.1.2splines_4.2.2MASS_7.3-58.2
[7] tidyselect_1.2.0xtable_1.8-4lattice_0.20-45R6_2.5.1rlang_1.1.0minqa_1.2.5
[13] fansi_1.0.4dplyr_1.1.0tools_4.2.2grid_4.2.2data.table_1.14.8nlme_3.1-162
[19] utf8_1.2.3cli_3.6.0ellipsis_0.3.2lme4_1.1-31countrycode_1.4.0tibble_3.2.1
[25] lifecycle_1.0.3prediction_0.3.14Matrix_1.5-3nloptr_2.0.3vctrs_0.6.1labelled_2.10.0
[31] glue_1.6.2haven_2.5.1compiler_4.2.2pillar_1.8.1forcats_1.0.0generics_0.1.3
[37] boot_1.3-28.1pkgconfig_2.0.3
The text was updated successfully, but these errors were encountered:
Please specify whether your issue is about:
Hi,
I think I think the
level
argument in themargins_summary()
function is not working as intended: Setting the confidence level to a different value than 95 has no effect on the output. It seems the argument is simply ignored. This happens withlm()
andlme4::glmer()
, and when using eithermargins_summary()
orsummary(margins())
. Strangely,plot(margins())
works as described in the vignette -- but, contrary to what is written there, it is not possible to specify multiple confidence levels.Hope I'm not misunderstanding something here! Many thanks in advance!
Example:
The text was updated successfully, but these errors were encountered: