diff -Nru r-cran-marginaleffects-0.17.0/DESCRIPTION r-cran-marginaleffects-0.18.0/DESCRIPTION --- r-cran-marginaleffects-0.17.0/DESCRIPTION 2023-12-09 17:20:02.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/DESCRIPTION 2024-02-05 12:50:05.000000000 +0000 @@ -1,7 +1,7 @@ Package: marginaleffects Title: Predictions, Comparisons, Slopes, Marginal Means, and Hypothesis Tests -Version: 0.17.0 +Version: 0.18.0 Authors@R: c(person(given = "Vincent", family = "Arel-Bundock", @@ -28,34 +28,35 @@ Encoding: UTF-8 URL: https://marginaleffects.com/ BugReports: https://github.com/vincentarelbundock/marginaleffects/issues -RoxygenNote: 7.2.3.9000 +RoxygenNote: 7.3.0 Depends: R (>= 3.6.0) -Imports: checkmate, data.table, generics, insight (>= 0.19.1), methods, +Imports: checkmate, data.table, generics, insight (>= 0.19.7), methods, rlang, Rcpp (>= 1.0.0) LinkingTo: Rcpp, RcppEigen Suggests: AER, Amelia, afex, aod, bench, betareg, BH, bife, biglm, blme, boot, brglm2, brms, brmsmargins, broom, car, carData, - causaldata, collapse, conflicted, covr, crch, DALEXtra, - DCchoice, dbarts, distributional, dplyr, emmeans, equivalence, - estimatr, fixest, fmeffects, fontquiver, future, fwb, gam, - gamlss, gamlss.dist, geepack, ggdag, ggdist, ggokabeito, - ggplot2, ggrepel, glmmTMB, glmx, haven, here, itsadug, ivreg, - kableExtra, knitr, lme4, lmerTest, logistf, magrittr, margins, - MatchIt, MASS, mclogit, MCMCglmm, missRanger, mgcv, mhurdle, - mice, miceadds, mlogit, mlr3verse, modelbased, modelsummary, - nlme, nnet, numDeriv, optmatch, ordinal, parameters, parsnip, - partykit, patchwork, pkgdown, phylolm, plm, polspline, poorman, - posterior, prediction, pscl, purrr, quantreg, Rchoice, - rcmdcheck, remotes, rmarkdown, rms, robust, robustbase, - robustlmm, rsample, rstanarm, rstantools, rsvg, - sampleSelection, sandwich, scam, spelling, speedglm, survey, - survival, svglite, systemfonts, tibble, tidymodels, tidyr, - tidyverse, tinysnapshot, tinytest, titanic, truncreg, tsModel, - withr, workflows, yaml, xgboost, testthat (>= 3.0.0), altdoc + causaldata, collapse, conflicted, countrycode, covr, crch, + DALEXtra, DCchoice, dbarts, distributional, dplyr, emmeans, + equivalence, estimatr, fixest, fmeffects, fontquiver, future, + fwb, gam, gamlss, gamlss.dist, geepack, ggdag, ggdist, + ggokabeito, ggplot2, ggrepel, glmmTMB, glmx, haven, here, + itsadug, ivreg, kableExtra, knitr, lme4, lmerTest, logistf, + magrittr, margins, MatchIt, MASS, mclogit, MCMCglmm, + missRanger, mgcv, mhurdle, mice, miceadds, mlogit, mlr3verse, + modelbased, modelsummary, nlme, nnet, numDeriv, optmatch, + ordinal, parameters, parsnip, partykit, patchwork, pkgdown, + phylolm, plm, polspline, poorman, posterior, prediction, pscl, + purrr, quantreg, Rchoice, rcmdcheck, remotes, rmarkdown, rms, + robust, robustbase, robustlmm, rsample, rstanarm, rstantools, + rsvg, sampleSelection, sandwich, scam, spelling, speedglm, + survey, survival, svglite, systemfonts, tibble, tidymodels, + tidyr, tidyverse, tinysnapshot, tinytest, titanic, truncreg, + tsModel, withr, workflows, yaml, xgboost, testthat (>= 3.0.0), + altdoc Collate: 'RcppExports.R' 'backtransform.R' 'bootstrap_boot.R' 'bootstrap_fwb.R' 'bootstrap_rsample.R' 'broom.R' 'by.R' 'ci.R' 'comparisons.R' 'complete_levels.R' 'conformal.R' 'datagrid.R' - 'equivalence.R' 'get_averages.R' 'get_coef.R' + 'deprecated.R' 'equivalence.R' 'get_averages.R' 'get_coef.R' 'get_contrast_data.R' 'get_contrast_data_character.R' 'get_contrast_data_factor.R' 'get_contrast_data_logical.R' 'get_contrast_data_numeric.R' 'get_contrasts.R' @@ -64,20 +65,19 @@ 'get_modeldata.R' 'get_predict.R' 'get_se_delta.R' 'get_term_labels.R' 'get_vcov.R' 'github_issue.R' 'hush.R' 'hypotheses.R' 'hypotheses_joint.R' 'imputation.R' - 'inferences.R' 'marginal_means.R' 'mean_or_mode.R' 'methods.R' - 'set_coef.R' 'methods_MASS.R' 'methods_MCMCglmm.R' - 'methods_Rchoice.R' 'methods_afex.R' 'methods_aod.R' - 'methods_betareg.R' 'methods_bife.R' 'methods_biglm.R' - 'methods_nnet.R' 'methods_brglm2.R' 'sanity_model.R' - 'methods_brms.R' 'methods_crch.R' 'methods_dataframe.R' - 'methods_dbarts.R' 'methods_fixest.R' 'methods_gamlss.R' - 'methods_glmmTMB.R' 'methods_glmx.R' - 'methods_inferences_simulation.R' 'methods_lme4.R' - 'methods_mclogit.R' 'methods_mgcv.R' 'methods_mhurdle.R' - 'methods_mlm.R' 'methods_mlogit.R' 'methods_mlr3.R' - 'methods_nlme.R' 'methods_ordinal.R' 'methods_plm.R' - 'methods_pscl.R' 'methods_quantreg.R' 'methods_rms.R' - 'methods_robustlmm.R' 'methods_rstanarm.R' + 'inferences.R' 'mean_or_mode.R' 'methods.R' 'set_coef.R' + 'methods_MASS.R' 'methods_MCMCglmm.R' 'methods_Rchoice.R' + 'methods_afex.R' 'methods_aod.R' 'methods_betareg.R' + 'methods_bife.R' 'methods_biglm.R' 'methods_nnet.R' + 'methods_brglm2.R' 'sanity_model.R' 'methods_brms.R' + 'methods_crch.R' 'methods_dataframe.R' 'methods_dbarts.R' + 'methods_fixest.R' 'methods_gamlss.R' 'methods_glmmTMB.R' + 'methods_glmx.R' 'methods_inferences_simulation.R' + 'methods_lme4.R' 'methods_mclogit.R' 'methods_mgcv.R' + 'methods_mhurdle.R' 'methods_mlm.R' 'methods_mlogit.R' + 'methods_mlr3.R' 'methods_nlme.R' 'methods_ordinal.R' + 'methods_plm.R' 'methods_pscl.R' 'methods_quantreg.R' + 'methods_rms.R' 'methods_robustlmm.R' 'methods_rstanarm.R' 'methods_sampleSelection.R' 'methods_scam.R' 'methods_stats.R' 'methods_survey.R' 'methods_survival.R' 'methods_tidymodels.R' 'methods_tobit1.R' 'modelarchive.R' 'myTryCatch.R' 'package.R' @@ -89,12 +89,12 @@ 'sanitize_newdata.R' 'sanitize_numderiv.R' 'sanitize_type.R' 'sanitize_variables.R' 'sanitize_vcov.R' 'sanity.R' 'sanity_by.R' 'sanity_dots.R' 'settings.R' 'slopes.R' 'sort.R' - 'summary.R' 'tinytest.R' 'type_dictionary.R' - 'unpack_matrix_cols.R' 'utils.R' + 'tinytest.R' 'type_dictionary.R' 'unpack_matrix_cols.R' + 'utils.R' Language: en-US Config/testthat/edition: 3 NeedsCompilation: yes -Packaged: 2023-12-09 16:47:56 UTC; vincent +Packaged: 2024-02-05 02:13:40 UTC; vincent Author: Vincent Arel-Bundock [aut, cre, cph] (), Marcio Augusto Diniz [ctb] (), @@ -102,4 +102,4 @@ Etienne Bacher [ctb] () Maintainer: Vincent Arel-Bundock Repository: CRAN -Date/Publication: 2023-12-09 17:20:02 UTC +Date/Publication: 2024-02-05 12:50:05 UTC diff -Nru r-cran-marginaleffects-0.17.0/MD5 r-cran-marginaleffects-0.18.0/MD5 --- r-cran-marginaleffects-0.17.0/MD5 2023-12-09 17:20:02.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/MD5 2024-02-05 12:50:05.000000000 +0000 @@ -1,21 +1,22 @@ -82964ea375a9b8352360c4e320b97ec0 *DESCRIPTION -edfa21b316d8501dc39a78a2aa2c8530 *NAMESPACE -20b2d5144b2c9e691126437eed69765c *NEWS.md +97da277069772969d2634d781decf7d0 *DESCRIPTION +c8c25b767a658920ebb45c84251300d1 *NAMESPACE +c345ec0e88e8fd27299d7435967a5a7a *NEWS.md bb1da3e78a3f5dd03af88bb04cafb8ca *R/RcppExports.R 113931fe7bbad00cdea15dd91343a2a4 *R/backtransform.R 215bc2e132dee432c55d0fb0329c6788 *R/bootstrap_boot.R 11067a113f30465feac4810c73711484 *R/bootstrap_fwb.R c332d55375cb7bad8b9faff88f61c158 *R/bootstrap_rsample.R -c820548af50163b7e24611163bb52795 *R/broom.R +d0da17fc7cb4cc3e844f93cd7757dd40 *R/broom.R 18ea90260881eafcec66c8c58bd046e7 *R/by.R 51285d2ece185609debc1ad7c0dea3a9 *R/ci.R -fb91bb79569b7d8f5986449a2920477a *R/comparisons.R +00f04d03aa97aa7147a1598e916c38f2 *R/comparisons.R 4b349397e2529b4dda7f5af7fb3bbfb4 *R/complete_levels.R 5298a3c6412e495adaeb55c3cb638d51 *R/conformal.R -5ed7d520dd3520d05a7edd84f745e582 *R/datagrid.R +d2eb2b4516cdc86866f53d980d0c94c1 *R/datagrid.R +ee1c3f7de16d9d1eb96ef40383919fcc *R/deprecated.R 82c48550b6a695bdf71d0f850ee0eb0b *R/equivalence.R -7d28bdd4f23f0a48f6281912077c734c *R/get_averages.R -775c2ef46a59ad8c52af832df1e915aa *R/get_coef.R +3c9e0b8d8defb89dfbfa74bea75b8887 *R/get_averages.R +fa771a0ded49cd91d500c4be32e0f344 *R/get_coef.R 1d832e0ef8a52ee668b8c27e65417195 *R/get_contrast_data.R 8728467cc0e3f3771ffb530e91eca231 *R/get_contrast_data_character.R 8c70fb880586b634206e4a9c86e1ab10 *R/get_contrast_data_factor.R @@ -29,17 +30,16 @@ e548ba7573c9b0c665317bc85dff653d *R/get_model_matrix_attribute.R e3f3d2e3c52bfcbaefe7b7903e8ada60 *R/get_modeldata.R e7213c0f025c868bb0897d60790b6dd9 *R/get_predict.R -373fa1ec9a89f24b8d6fac955931e561 *R/get_se_delta.R +df8f33051612f22d9a8627b87202b5ef *R/get_se_delta.R c1d0b40b25414f1eeb2cbab35d56fd20 *R/get_term_labels.R 1406ee14b1c0f42cae69bc7f23effd1f *R/get_vcov.R 7078102a5eaa8e8d5d49b707411d52a4 *R/github_issue.R ba91a987205e717587704726a59e68a1 *R/hush.R -d62ae166095dfceecbf5a2d704e24c1d *R/hypotheses.R -393d606690c3be1abf07bd1b8d2cc204 *R/hypotheses_joint.R +5094046582b828f0a205472f6faa4187 *R/hypotheses.R +8f1fc5be4fba1aac2bc7c7bf87e0ebff *R/hypotheses_joint.R 1a546877b19ab04ca206d341f0a3c4ab *R/imputation.R 02da1e6e0c0c98fa9f6ddbaf336de121 *R/inferences.R -231f33e977f029c4c92fe7d492625ed6 *R/marginal_means.R -b3dae4e95da82f74aa723edf59823a9e *R/mean_or_mode.R +ca9964357eb3917f6691bccbda59fe69 *R/mean_or_mode.R b16f4dd6e06ae13bf66e18a081640de9 *R/methods.R 45da88d5337089b487cde2bb95734a24 *R/methods_MASS.R ee0d2b56a5cb611f02ce49a581dff154 *R/methods_MCMCglmm.R @@ -52,7 +52,7 @@ 3656e4bac5cd2c76af7d755ccf1c8ed2 *R/methods_brglm2.R 4ce50f350a2e22ad99f565513f834459 *R/methods_brms.R cf983748c9301ed7455894c9ecdfe654 *R/methods_crch.R -8dfb043ec811c35de040a75918ff29c5 *R/methods_dataframe.R +86ac1337e67cb6b405aae13cfbafcef9 *R/methods_dataframe.R 57f8db0a3f536d8d38b1ff8474fca54e *R/methods_dbarts.R 16c6859ad75215a6fae3c401dbc3c383 *R/methods_fixest.R c4e6137c681083ab6363059cc41de8d4 *R/methods_gamlss.R @@ -77,8 +77,8 @@ 6136062cf0dc2d5d144101d3cf96b4fe *R/methods_rstanarm.R 8d4a45cbf9ee1de2174262096407bc2b *R/methods_sampleSelection.R d6a009aa1aadeff7d5f8af72bcea8120 *R/methods_scam.R -5b2e4389e9cfc5b4a3db9975cd49f2eb *R/methods_stats.R -b53d74a18a9ce51bc0757b11a0b645d1 *R/methods_survey.R +d24518f21b90784835bf98d4faeb0e50 *R/methods_stats.R +a0c870faee8cfee4b91e62a9bcb3c961 *R/methods_survey.R 04105804c7393e4870f6ef63c85a0ede *R/methods_survival.R 66cb56aaeb95f4f6de1a6cf8548464e7 *R/methods_tidymodels.R 30eec5e50ebb75eee60314d0e3c75249 *R/methods_tobit1.R @@ -87,58 +87,57 @@ 3df0bda30d2d28df58275caae5ff831c *R/package.R c2e3bc3b6871c223d34897427426b7fe *R/plot.R 86a2bed7ff2587c592c919e6259f72cd *R/plot_build.R -08d2c8c8a83e8a6f85dc6dbc7d79f956 *R/plot_comparisons.R -47780d15650b5eefa53981ffaa8ef695 *R/plot_predictions.R -afbbf3feffe8053634f6b9871ab320af *R/plot_slopes.R +13ca37bab7d8a4fbedcae1472d006585 *R/plot_comparisons.R +30904d661500efd5868bf0ae27a3073a *R/plot_predictions.R +c1ea04a6f966fe1fcd4dd563750f849f *R/plot_slopes.R 4d464795da0e9545fe351881ffad23c1 *R/posterior_draws.R -8e469293c2998969fa5a7078029e8f85 *R/predictions.R -60a8c2510138768941fe2671a6becca1 *R/print.R +84e64e9b23a7de3babe60e2aea5e76fb *R/predictions.R +a7b5d426d9678b34dbfb142889b645e1 *R/print.R f5c51615c1504792626a320c347bd90d *R/recall.R fb6446b4acca895f62e147e2f577edc0 *R/sanitize_comparison.R 8376c26ff6090c9a780f3a5d421e42c7 *R/sanitize_condition.R a3b8b0611f32a8f7f44ce3397b426815 *R/sanitize_conf_level.R afefa9b25eb40cb39cfb1d76d31b03a6 *R/sanitize_hypothesis.R f092223ee4603fe29b5cadcf8a7455cd *R/sanitize_interaction.R -5eadc55ec54dff182278d69964bc23bd *R/sanitize_newdata.R +f97ab88751d1622f884080980769d206 *R/sanitize_newdata.R faa70a06a3428b56c5dd7b773667673d *R/sanitize_numderiv.R fdc6cef5cbf6ff2229e479c4758fa58a *R/sanitize_type.R -e959c2bf9db3d2cfe88b4484a3fc15a4 *R/sanitize_variables.R +bd844ce55ea8189e79ea751fc08b4fd1 *R/sanitize_variables.R e40df5bbcc4d88eb52cd261482c5a8fe *R/sanitize_vcov.R 56a607380a56072ec5b4f91f497b5700 *R/sanity.R 6385876a8a17b4a1e32d65af31e41976 *R/sanity_by.R f9e5c5c4f2e2cdb89a0d8f46c786ff8f *R/sanity_dots.R -5d8f291e2beaa47555a7010bb8f2d16d *R/sanity_model.R -7f016603b71122b2d064773b5d5d9cd1 *R/set_coef.R +1fbaa61302a68e91fb50f094e7c7df55 *R/sanity_model.R +c3468fc7ad0a1e1d7afbd66058c8776f *R/set_coef.R a7ec0ae417f84bd1b9d1ffd9fcb2fb9a *R/settings.R -f36d61ed6249c7d252e51d9818c0d44c *R/slopes.R +1c481d737a365b03dac8ed811f9db15a *R/slopes.R aaef0ac1c9d1ecf3dc5ff56f4d784242 *R/sort.R -e70e14ad8dfe0ce8fcae34bc9410413a *R/summary.R -84219d8e9672d7eff19f5c29084dab3d *R/tinytest.R -504bf395135db9a28048deda9c911504 *R/type_dictionary.R +5aca9f19a0e16d0dbdca9963f750e99b *R/tinytest.R +8e763870c3f878fef14291ee291dba70 *R/type_dictionary.R 8c3288b68106bd3979351a0e10fb2d0a *R/unpack_matrix_cols.R -13efded3fe093e81f9094bd36fc844aa *R/utils.R -79a7ecf514eb5de5abe6e6322d31002b *README.md +273e190b9e9d631f808d36f3749be6d7 *R/utils.R +7210923781c8f70f1a8a151b0da7499a *README.md 7388d57168b866210b551329420431f6 *inst/COPYRIGHTS -ddefcbf8587c2893aeefc68fcf83e6d1 *inst/WORDLIST +94b004e9ab19331880105b90c9e6672a *inst/WORDLIST 6bd8fd8734beaa2b36cc242d2c769f06 *inst/tinytest/_tinysnapshot/df-t.txt 665f4aa0a133e4659b1cc7cd3308da5c *inst/tinytest/_tinysnapshot/df-z.txt 70baf2033461f7eedf3c43f4112fbdce *inst/tinytest/_tinysnapshot/equivalence-avg_comparisons.txt 3496161c86b73a319efd9b75dd20abaf *inst/tinytest/_tinysnapshot/plot_comparisons-2effects.svg 3061991006036fbb57539c9310676522 *inst/tinytest/_tinysnapshot/plot_comparisons-minmax_x.svg 3c2e86f94486c425d13fc3393eff7119 *inst/tinytest/_tinysnapshot/plot_comparisons-rr_titanic.svg -f773a349c34e245632f457c76ef7febc *inst/tinytest/_tinysnapshot/plot_predictions-alpha.svg -e5caa0b8aa35a62418ab22a7ac249940 *inst/tinytest/_tinysnapshot/plot_predictions-gray.svg -3aca8082fd7c33895e37977a7920be6d *inst/tinytest/_tinysnapshot/plot_predictions.svg -0e90b1a3d1711076a673921e22987280 *inst/tinytest/_tinysnapshot/plot_predictions_conf_40.svg -23a8a16f5541f3de713142f45bd9c29a *inst/tinytest/_tinysnapshot/plot_predictions_conf_99.svg +3f441e95c3833c5adb6514b07c160140 *inst/tinytest/_tinysnapshot/plot_predictions-alpha.svg +78a387db8654197070bbb86a98b2affa *inst/tinytest/_tinysnapshot/plot_predictions-gray.svg +4bad8f29017897da83925f0030018f67 *inst/tinytest/_tinysnapshot/plot_predictions.svg +07643558feae9a9be61fbc9423d801c4 *inst/tinytest/_tinysnapshot/plot_predictions_conf_40.svg +32504909fd4c564d4df06642865b3aa6 *inst/tinytest/_tinysnapshot/plot_predictions_conf_99.svg db73a095653b172c2c203274cdadb848 *inst/tinytest/_tinysnapshot/plot_predictions_link.svg d8e91c0fd72f7e00854453d2b426f8b7 *inst/tinytest/_tinysnapshot/plot_predictions_response.svg 216dfa5f254e010800def2222bed8f4b *inst/tinytest/_tinysnapshot/plot_predictions_vs_categorical_x_axis.svg 7ddd54c918aa54b0d144484809f6da5f *inst/tinytest/_tinysnapshot/plot_predictions_vs_continuous_x_axis.svg a7bcf5fa0f18f8c92eb985f0b2c00d3f *inst/tinytest/_tinysnapshot/plot_slopes_categorical.svg -ca68bd50fc1545b20fb5f892d444b4d6 *inst/tinytest/_tinysnapshot/plot_slopes_continuous.svg +c1a4eebfe19862ef30857057b3cd2aa8 *inst/tinytest/_tinysnapshot/plot_slopes_continuous.svg b6a99e8363cba0eaddebff83706e8c0f *inst/tinytest/_tinysnapshot/plot_slopes_factor_facets.svg -039a309a267e52f4aa69dc3da58f85cf *inst/tinytest/_tinysnapshot/plot_slopes_two_conditions.svg +164973877ac9d76afa303c501a497d6b *inst/tinytest/_tinysnapshot/plot_slopes_two_conditions.svg fcd0a95afa8ec894c9390cf15e28de23 *inst/tinytest/_tinysnapshot/print-comparisons_1focal_dataframe.txt bc4169197997b0f43a20437e2d5a9827 *inst/tinytest/_tinysnapshot/print-comparisons_1focal_datagrid.txt 46b061b216c52e98fd1c4d161162e1ec *inst/tinytest/_tinysnapshot/print-comparisons_by.txt @@ -153,125 +152,86 @@ d1a58fa12cf96a61e27830629eb90a8e *inst/tinytest/_tinysnapshot/summary-marginaleffects_conf_level_20.txt 994cd91459cce7c3841782cd787d6aef *inst/tinytest/_tinysnapshot/summary-marginaleffects_conf_level_90.txt a5273604d61aacbc54a4c366f67337d0 *inst/tinytest/_tinysnapshot/summary-marginalmeans.txt -4837a8932721514c79246b56add8c072 *inst/tinytest/helpers.R -4e24c803b94aa155d6e09e153ce24d82 *inst/tinytest/stata/clean.R -6140244c13b2940b75266cee4c251855 *inst/tinytest/stata/databases/MASS_polr_01.csv -0d7d2bfc85d0fc5aebe9fedda3b1db9b *inst/tinytest/stata/databases/Phobia.rds -1aab8998c723923a3c153c67f831a408 *inst/tinytest/stata/databases/betareg_betareg_01.csv -912604b28de013abe078c15d7b1d45a7 *inst/tinytest/stata/databases/ivreg_ivreg_01.csv -42760a164f3d6bd64ee9dc75c641eaa5 *inst/tinytest/stata/databases/lme4_01.csv -d1d6fde98357ace9eb88ff542069aca5 *inst/tinytest/stata/databases/lme4_02.csv -3dcc21dd0c1bea55decfeba53b885a86 *inst/tinytest/stata/databases/quantreg_rq.xls -fd967bf6c7d0fbb3abaf350d39d03d0c *inst/tinytest/stata/databases/stats_glm_01.csv -6e5104ed38802d55b267d1899fcd2f6d *inst/tinytest/stata/databases/stats_lm_01.csv -bed04d9eed0d8fa8eb526e5d214899c2 *inst/tinytest/stata/databases/truncreg_truncreg.xls -1a33fc474b10488b3298b38f4b8dac6f *inst/tinytest/stata/estimate.do -7caefab019b85c9ac2d5edc9ec7248f8 *inst/tinytest/stata/generate.R -c059b0d181f0d8c411306df6f0e5a8bb *inst/tinytest/stata/results/AER_tobit.txt -ca1ede759c3b8cad51e7f89d95a4f4f6 *inst/tinytest/stata/results/AER_tobit_right4.txt -450f5d4960bf322565f9bc5b413e3216 *inst/tinytest/stata/results/MASS_glm_nb.txt -50eb52291c32dfb0794e6c3b43709970 *inst/tinytest/stata/results/MASS_polr_01.txt -1fee6f6a9945a6ff1b9206a6ac47ba4a *inst/tinytest/stata/results/betareg_betareg_01.txt -96360b41900325e84eee04b5e006b849 *inst/tinytest/stata/results/estimatr_iv_robust.txt -c8b3111fcbc0174259126bf5c5c43eda *inst/tinytest/stata/results/estimatr_lm_robust.txt -b978c3b8169bd743b4be1f7f4a75983b *inst/tinytest/stata/results/fixest_feols_01.txt -53688a739095978fd07f6c36fc932459 *inst/tinytest/stata/results/fixest_fepois_01.txt -1fc05c5132694943afa25d6f0a6ce1fc *inst/tinytest/stata/results/ivreg_ivreg_01.txt -213a1abbc6327359a8b1c03b20c6b30a *inst/tinytest/stata/results/lme4_01.txt -c9261e8536b4f700c4a6298604bfca75 *inst/tinytest/stata/results/lme4_02.txt -6af5056572a318732aab5c40c2d3bfa9 *inst/tinytest/stata/results/nnet_multinom_01.txt -01670adb036e0db695063e041974bd5c *inst/tinytest/stata/results/plm_pooling_01.txt -29acb6ce843fc43cd64056f3f31383c0 *inst/tinytest/stata/results/plm_sa_01.txt -c08fc459d48cef04c4d8a321d2a0201a *inst/tinytest/stata/results/pscl_zeroinfl_01.txt -69fb2a3453ede364880e9686996dfb85 *inst/tinytest/stata/results/quantreg_rq_01.txt -fcba4c6329f02c071c664e948c668019 *inst/tinytest/stata/results/stats_glm_01.txt -f5312afcb50593307853daa3a1cc0d43 *inst/tinytest/stata/results/stats_glm_elasticity_dyex.txt -017a1536e9a8bbc801f3c3930d4caf36 *inst/tinytest/stata/results/stats_glm_elasticity_eydx.txt -86579f74776b7fa0bd45376c10712e9d *inst/tinytest/stata/results/stats_glm_elasticity_eyex.txt -66cdd1d62019aba2060f608a8aac3973 *inst/tinytest/stata/results/stats_lm_01.txt -63f1540650ca685209abe77d4ea80fea *inst/tinytest/stata/results/stats_lm_elasticity_dyex.txt -72883e3991cfe89d075e6f88ec36b041 *inst/tinytest/stata/results/stats_lm_elasticity_eydx.txt -9677362afdf1b850a50bcd36dd2a7de0 *inst/tinytest/stata/results/stats_lm_elasticity_eyex.txt -c549e58a908d91af0ae054b29f5764ba *inst/tinytest/stata/results/survival_coxph_01.txt -0ad846d4eeaa841751522db21e95bd3f *inst/tinytest/stata/results/truncreg_truncreg_01.txt -91c8e6c404a5cf79e0276330dc4ed474 *inst/tinytest/stata/stata.rds +a1edb96786dce79877964973befb158b *inst/tinytest/helpers.R 8be50bd18cd3eecb401005d5b071ed79 *inst/tinytest/test-aaa-warn_once.R 70d21198438187b56663852731de44d9 *inst/tinytest/test-analytic.R d41d8cd98f00b204e9800998ecf8427e *inst/tinytest/test-backward.R -1b99cba2a2d29f19a04b39c136231ba6 *inst/tinytest/test-bugfix.R -8fe932c74cdf183d0c5ab3072b8e93a7 *inst/tinytest/test-by.R +4954b959f46fe93410c02a68963e6eb7 *inst/tinytest/test-bugfix.R +22f5d5c4c8354d26d1076682090ce2b0 *inst/tinytest/test-by.R 74d47b6df624a4f184f7eb521158e9b2 *inst/tinytest/test-call.R f74fb4fb756063951d405612290eaf39 *inst/tinytest/test-character.R -9679cb8e3c25fa0f5022e828828b6c9a *inst/tinytest/test-comparisons-interaction.R +6fd369f3e4cab1eea4725323fa80da61 *inst/tinytest/test-comparisons-interaction.R a96b4d17ae04851636ae35c566e14ebe *inst/tinytest/test-comparisons.R ca2b8b79bab2adb01cb0b03e3b79ff2c *inst/tinytest/test-complete_levels.R 2e71185815fe2d303d413e4af5de2ff3 *inst/tinytest/test-conf.level.R -edb1eaaeee6e8b626685581926848294 *inst/tinytest/test-contrast.R +11d6fb8d7ee81837e6da6d695cef041c *inst/tinytest/test-contrast.R 8f63c829e316c97c41201952f7a40b40 *inst/tinytest/test-counterfactual.R dd6b1e07de10900a0c9164b5354a56f6 *inst/tinytest/test-datagrid.R -2d5dcbad4468659c7025cf0227c9a4c0 *inst/tinytest/test-df.R +751b1706e28c704b76b4c6b2ea54b9c4 *inst/tinytest/test-df.R 6a528af82291b784f35bcb3181a257fb *inst/tinytest/test-dots.R -7b964b2791ff2ffde3c5253d77bb6326 *inst/tinytest/test-elasticity.R +d80acfa3ab7626baeb09538bb5003c5c *inst/tinytest/test-elasticity.R bc5cc30bd39ff1be3012df8f14184751 *inst/tinytest/test-eps.R -fdbf003c7384b8c97ac2189521b2b349 *inst/tinytest/test-equivalence.R +e56721df5683790ce5f8e5ac3db23e54 *inst/tinytest/test-equivalence.R 20f478007d59b7f88276a00c46f518ef *inst/tinytest/test-factor.R -9e11eb4f7574224fe5d356db54a17b36 *inst/tinytest/test-gformula.R -9d129a42d73d09c20b791ccdb5ec4586 *inst/tinytest/test-hypotheses.R -339894ef111dee3f0d5eda2092ec2b46 *inst/tinytest/test-hypotheses_joint.R -13d6940c2abb3021cace90e3a82816a1 *inst/tinytest/test-hypothesis.R -cc617677bd350e13ea5af8d86e53fbee *inst/tinytest/test-inferences.R -9eaad9cf5c2444577f03ce1afeddab64 *inst/tinytest/test-interaction.R +db789f0465c6da60da3e939f9fcbb70e *inst/tinytest/test-gformula.R +31a48db3cde62e4b2505268ea0aa93ed *inst/tinytest/test-hypotheses.R +2eee293893fd73cf77bb0bea99349cfc *inst/tinytest/test-hypotheses_joint.R +f35b2438c1b46d353f8deca9bbb61ce9 *inst/tinytest/test-hypothesis.R +18a8aca8dbbe41629c68ee2be7e11b02 *inst/tinytest/test-inferences.R +457718e2bc013060f8c002bbdeddbc71 *inst/tinytest/test-interaction.R +783caaf14c53c717ab7a084a7feed7c8 *inst/tinytest/test-jss.R 836152b88a3ff648a60811a8bd1cc7b3 *inst/tinytest/test-logical.R -67ecd252315fddb65cec33aaaa61a798 *inst/tinytest/test-marginal_means.R +aa33706bf381a8ef15ec49ae8c9d0907 *inst/tinytest/test-marginal_means.R 9c63ceb2ce4a786adc13b0e498118bcc *inst/tinytest/test-marginaleffects.R b6a8970f65bf15bb49903fec0fc67ef8 *inst/tinytest/test-misc.R 5818aad1bdc2e5f56018a70a6fc6d47e *inst/tinytest/test-missing.R b18568acdea841390264d72c7608867f *inst/tinytest/test-nested.R 883043e49186f5cb135161ed73a38af9 *inst/tinytest/test-newdata.R -22fa82f549d43d7f7c158dad4895751a *inst/tinytest/test-p_adjust.R -b6a9e90866488b4c75ab49c0092272fb *inst/tinytest/test-pkg-AER.R -603f7c4cb3df1c9c6d9f316c7ed2abaf *inst/tinytest/test-pkg-Amelia.R +6e454e397435f2de0e44c732b05a6cb1 *inst/tinytest/test-p_adjust.R +51e9906d2dec44460bc23995d335e209 *inst/tinytest/test-pkg-AER.R +aa158a48b98ace2eb10cc230cf4cf251 *inst/tinytest/test-pkg-Amelia.R 6138ee1d09bb0855100c710169d6c46e *inst/tinytest/test-pkg-DCchoice.R -89783075e897b158310dca211adca7f4 *inst/tinytest/test-pkg-MASS.R +8bccbef837858d27b710276636e7ee52 *inst/tinytest/test-pkg-MASS.R 9d5926f4ebda0625843b582596d90683 *inst/tinytest/test-pkg-MCMCglmm.R 445e15bdd8b27ebd0a6ffcb12b72e7f8 *inst/tinytest/test-pkg-MatchIt.R 4e460c0b5345e7ba7efc2a3e1dc2578e *inst/tinytest/test-pkg-Rchoice.R -1c0626ea7b0a503b50e6779827586771 *inst/tinytest/test-pkg-afex.R +f0c2f3f3465c57adb9574ad647b11c0b *inst/tinytest/test-pkg-afex.R 86744219adc4123412b10214987f91af *inst/tinytest/test-pkg-aod.R -646ed676dc61bc4ff5d90faaeaefda37 *inst/tinytest/test-pkg-betareg.R +60587a562af1846eccda43802a00f1a4 *inst/tinytest/test-pkg-betareg.R fda19bc82023fe616d92713d4d9953cf *inst/tinytest/test-pkg-bife.R 5dfad8a17f275247409947d3031785b9 *inst/tinytest/test-pkg-biglm.R 220638872a14554ff03cb8945996d2e9 *inst/tinytest/test-pkg-blme.R 8d59bfc930532ec884d55bc861abadc5 *inst/tinytest/test-pkg-brglm2.R d1d06e6eeefcd4d129ea27a449ae276c *inst/tinytest/test-pkg-brms-average.R -e42705438f221f890d1b1422d50d3a2e *inst/tinytest/test-pkg-brms.R -187068d872195e19d2907b885a0228ae *inst/tinytest/test-pkg-crch.R +9b88c181f400962f2918859c16e18ccb *inst/tinytest/test-pkg-brms.R +027d5c7c943d8a9482cca15753d19e9f *inst/tinytest/test-pkg-crch.R 1bd338b7c16ce6d2ea9a3274c4b27aa4 *inst/tinytest/test-pkg-dbarts.R -fe8a772d2c22d7bb9ad1c1512aef8c77 *inst/tinytest/test-pkg-estimatr.R -b443a99b426031ed00df2f945439a115 *inst/tinytest/test-pkg-fixest.R -4cfa65e8c9af41772d333e649d40e9a7 *inst/tinytest/test-pkg-gam.R -151469cb71beedb4ae321a7520e4d533 *inst/tinytest/test-pkg-gamlss.R +7038878f47f92ed473a2a40f494a75d8 *inst/tinytest/test-pkg-estimatr.R +4cbb55776ec61a02e61fbfad46b6a386 *inst/tinytest/test-pkg-fixest.R +4cf4e795232f89ffce620a4d6d7ba395 *inst/tinytest/test-pkg-gam.R +93b853fa9b008d8631c87b695f6d3252 *inst/tinytest/test-pkg-gamlss.R 35558730f72932df54936f42d52bc363 *inst/tinytest/test-pkg-geepack.R 1d1abeee1bb420b90429139d256d3cc8 *inst/tinytest/test-pkg-ggeffects.R -63ca13d15ace411cfd86bb3740e3fcc3 *inst/tinytest/test-pkg-glmmTMB.R +f9ee3c58d78248c6c07594f5f8dfeef3 *inst/tinytest/test-pkg-glmmTMB.R ee6289b47f26dc809cbdd53a195ce53a *inst/tinytest/test-pkg-glmx.R -9b9e221fe5ce1793d91dae824567ca03 *inst/tinytest/test-pkg-ivreg.R -d6eb44ba9d3045de854864ec53671123 *inst/tinytest/test-pkg-lme4.R -ab11056b02d6e186d46be3be9e15937e *inst/tinytest/test-pkg-lmerTest.R +f31c24f69a7fe0f17469962d3ccec640 *inst/tinytest/test-pkg-ivreg.R +da4bb5b598724625153e9c08d8ab3a74 *inst/tinytest/test-pkg-lme4.R +a8f92ad50d2bcbecf667ff2dc6b771e5 *inst/tinytest/test-pkg-lmerTest.R a11741900594686e1581ba211626d01e *inst/tinytest/test-pkg-logistf.R 878bd7ba0ab6bc569c2779c2b444c97a *inst/tinytest/test-pkg-mclogit.R b21f6eab8c07a07d2518138d2bb76d98 *inst/tinytest/test-pkg-mgcv.R -7d918758b91cd9a4fef6dea003986103 *inst/tinytest/test-pkg-mhurdle.R -b1762cb7ade803fe543a4742374fe594 *inst/tinytest/test-pkg-mice.R +87327ea6782e7492247d1da41209d11a *inst/tinytest/test-pkg-mhurdle.R +617ba94d5d781d45c99f511f3b584f7b *inst/tinytest/test-pkg-mice.R c59995e0a5c45bde16f9fc9bf64358e1 *inst/tinytest/test-pkg-mlogit.R f9331d91288cffb2a977d69c2b0667c3 *inst/tinytest/test-pkg-mlr3verse.R -f3ecfe1a37b7bd386467fa00c807de9d *inst/tinytest/test-pkg-nlme.R -aa714d7d3395f3afa0fd06115089d722 *inst/tinytest/test-pkg-nnet.R -7e5d706a50a86d67f07bc092a8378eac *inst/tinytest/test-pkg-ordinal.R +4c5294f9daf17a5dc7b7281bf43bcb07 *inst/tinytest/test-pkg-mvgam.R +4774d85a3efe66a899908a3b856ca505 *inst/tinytest/test-pkg-nlme.R +a78ce1cbc92668e727aeef4b1ea0eb8f *inst/tinytest/test-pkg-nnet.R +6789a223ee01a8d17363b177bbdee2f3 *inst/tinytest/test-pkg-ordinal.R b8668191afc987af8702e529d5f2d217 *inst/tinytest/test-pkg-phylolm.R -30df7f9f8420627eb0c8a29ae3bd01df *inst/tinytest/test-pkg-plm.R -f2cafa2c21a83d5bdc20620cef9f00c2 *inst/tinytest/test-pkg-pscl.R -8cf968e65685a8006f9f6ed551f12732 *inst/tinytest/test-pkg-quantreg.R +866203636c3090d20ad8d508a1419cad *inst/tinytest/test-pkg-plm.R +c0663d88a138ceb8b096b5dacaba392b *inst/tinytest/test-pkg-pscl.R +4620d09922a53ab34d97f0245dfa9cf1 *inst/tinytest/test-pkg-quantreg.R cb0078d78ce2d5fdb0595013e5349d4a *inst/tinytest/test-pkg-rms.R cb56fe62cb3e212d63b4f4e6441fdabe *inst/tinytest/test-pkg-robust.R 83606a06fec328dad0897ff1627b1f19 *inst/tinytest/test-pkg-robustbase.R @@ -279,72 +239,65 @@ 7575f7c81a4849b1de5c2e3b1fbe1b2d *inst/tinytest/test-pkg-rstanarm.R e0189f89a902b5d0a1fefa9a5d9965b5 *inst/tinytest/test-pkg-sampleSelection.R 8e35d1a6bfe133f36f8f3d47259ffbe5 *inst/tinytest/test-pkg-scam.R -82d382972f2cbed45abfe340de793399 *inst/tinytest/test-pkg-speedglm.R -80ca8d10c74a56fd1419660b9f55c2aa *inst/tinytest/test-pkg-stats.R +8883662bf73592ac5a79273e6f55033a *inst/tinytest/test-pkg-speedglm.R +9fc6a4b64915fff5219d37054ec398a0 *inst/tinytest/test-pkg-stats.R c7aa0ef7a232495b1ee45eaf1e5e5fcf *inst/tinytest/test-pkg-survey.R 48845870c7733eb8c2f3dca1d9ef9d48 *inst/tinytest/test-pkg-survival.R 26918cf6158835d1bcd5a395e69fe3d1 *inst/tinytest/test-pkg-tidymodels.R fa6ceb4441917e70f797bd29811e69ce *inst/tinytest/test-pkg-tobit1.R -f92cf78839d65972efdacfdfc71d6a52 *inst/tinytest/test-pkg-truncreg.R +6daccf1a3b3383b931ffecabe5e56bac *inst/tinytest/test-pkg-truncreg.R 3aa6beb1069a6af68410450b95576f34 *inst/tinytest/test-plot.R -e49721d9ec2530591374c0d7c98c9077 *inst/tinytest/test-plot_comparisons.R -1cb6c09f1266646858378001848eedb3 *inst/tinytest/test-plot_predictions.R -af33f96e6202959b49492f6dce526a14 *inst/tinytest/test-plot_slopes.R -3c27e3428c136c72198f984f3b4d3965 *inst/tinytest/test-predict_type.R -f11b0ea6649369b0a7b703c11d3a3b9a *inst/tinytest/test-predictions.R -aa46e292c5663e4a187541d9c693dc9e *inst/tinytest/test-print.R +4e49d1b296ddc01dc4732e0cdeb2d2bd *inst/tinytest/test-plot_comparisons.R +fb02b27b2a8cb765bda5a0da2eeac746 *inst/tinytest/test-plot_predictions.R +7a73c12cb1ce103c8c04138b5a847b46 *inst/tinytest/test-plot_slopes.R +d1e588f68d1e8ea1f7fb4d239ad469a2 *inst/tinytest/test-predict_type.R +6927afa63c64ed5c3fa5a75f5bd63d52 *inst/tinytest/test-predictions.R +ae2d91bf466f3f02b0ade5729ae603a0 *inst/tinytest/test-print.R 023f0cbc23d3fd0554f886b0219ebbbe *inst/tinytest/test-rank-deficient.R 011e16034a190259adff805631858be2 *inst/tinytest/test-sanity.R 6f1b87d6a204145fc54e8cde88666e00 *inst/tinytest/test-scope.R -d37190c208231b91bce957b1ba51cba0 *inst/tinytest/test-summary.R -23e33db5088e5581551bf982f624a3a9 *inst/tinytest/test-tidy-predictions.R -2439e40009b2fe3ba461466060bf6c12 *inst/tinytest/test-tidy.R -d7b54b4995eab8ae986706153ae5fca6 *inst/tinytest/test-tinytest.R +56f7ae3ce2517c73d735eeb787b99b17 *inst/tinytest/test-tinytest.R 5af10ac52131c198d927d2c2cbbe176f *inst/tinytest/test-transform_post.R -c3caa6d77d4cb81d1b465871ffb283ce *inst/tinytest/test-transform_pre.R +16ef3772a283a93c1bc22e89a6bea2ab *inst/tinytest/test-transform_pre.R c89013e4bee74119d36a6932e384f969 *inst/tinytest/test-typical.R 0e0b94f417fac67621e8b164499f6cdc *inst/tinytest/test-utils.R -b0cf908ef5c52accaa905314b2143463 *inst/tinytest/test-variables.R -0d5eaf6ce6fc5bf10e6a903796cbbbdd *inst/tinytest/test-vcov.R -a536ed144dd8477d2f830b0ae778b559 *inst/tinytest/test-vignettes.R -4bc0d95d57f7dd96285979ec5aca38e6 *inst/tinytest/test-weights.R -df0e2d6812d785b266f37dd2556a5060 *man/comparisons.Rd +786a9d4decbbaf9468be0b7dd77877cd *inst/tinytest/test-variables.R +5d778e061d56f046bf13ca4000156544 *inst/tinytest/test-vcov.R +eea099812df994a30ec5bc3a1accc041 *inst/tinytest/test-weights.R +bcb8957ce587b9f9698eda25063ea844 *man/comparisons.Rd 84668bf4b7fa8fc8e3c6351e1bad4e03 *man/complete_levels.Rd -3d9803a5d0e4bf78e729f4229f98c1ac *man/datagrid.Rd -94e441757387e5984de46bbcd67433f9 *man/deltamethod.Rd -8c36450160278d2cd444e71b256a79de *man/expect_marginal_means.Rd +d50d66d613f3f5842139a322764c8e71 *man/datagrid.Rd +26f5dc2b3a87bba04de66e5d373f7ba9 *man/datagridcf.Rd +88f305fbe39fd64a4f0ab4cbf7e098f0 *man/deltamethod.Rd 615e980f40da029afe1a3eb08d4a4c18 *man/expect_margins.Rd a13ad2214b8d6671c34bb48ddec118be *man/expect_predictions.Rd 215fd0c51fa09ca96f6aa35da934803f *man/expect_slopes.Rd 2b0a7cc5ceb04acdb70d81087f214a8a *man/figures/zoo_banner.png -42ec472a8d985fae03461b57eae4eae7 *man/get_averages.Rd -d0fa2108a51c5377fe23354473d0bfa3 *man/get_coef.Rd -b8db7001bbe501dfa5d581b1fa8c979d *man/get_group_names.Rd +b49853d021ae17fe65c659f9c7dcc0f8 *man/get_averages.Rd +0e76aafdeaeca82ce4d82904a2088a66 *man/get_coef.Rd +564e21c7b44d04c5306b076f8a7b8a0c *man/get_group_names.Rd 990b0c1bafd409348c6d043d309b1a53 *man/get_model_matrix.Rd -940146ecb47aee62571e37efc489b3de *man/get_predict.Rd +6e119b6d99193933700f121b1e822a46 *man/get_predict.Rd 4804d3eb1f99e47e526c464acfb7f8d6 *man/get_varcov_args.Rd -a6ffe33295d70f8176a89b6b27b03da2 *man/get_vcov.Rd -c7e090440b08c431fadc015cb2fbfa4f *man/hypotheses.Rd +0b7a28b271abbd7981c24f2b4fc8fb5f *man/get_vcov.Rd +c17f29041e7dac8e6031c039e4794afb *man/hypotheses.Rd 90fd09055e068cb2f070e3a54fd81d82 *man/inferences.Rd -6fe7aea1e19a1fe2bce472ddb7814c52 *man/marginal_means.Rd -64ff6080c60f7a528742b68ed0e70712 *man/marginaleffects.Rd -6ad14b33bd92c5ebfd2a7a1bb7d17063 *man/marginalmeans.Rd -a023b4a17746d0ac5675fd9db736a8e4 *man/meffects.Rd -35cabda52407f89510e0ca2efaafe12e *man/plot_cap.Rd -f4ca78ee874102afad2a50fdffd5bf5d *man/plot_cco.Rd -5a9101da30e949eea9a66e7439760392 *man/plot_cme.Rd -4cbb09be22a9b05322a3904c4d336d91 *man/plot_comparisons.Rd -d3d8dbe49aae5d538ef65b5b359f3fe9 *man/plot_predictions.Rd -fa15065552d139e9cddd631fed587420 *man/plot_slopes.Rd +d122f353a64d83e5f1537251d5d30710 *man/marginal_means.Rd +37f2c2cd77e30a3bd7e21236f21f5c5a *man/marginaleffects.Rd +74c860b56c8c296d9b2e58da6c139822 *man/marginalmeans.Rd +f5eee91998298d050863f946e8d5573f *man/meffects.Rd +49583df7f6ae6da0cfaef584f73e94e0 *man/plot_comparisons.Rd +5f0fb2b9d5e0d0265cdc9289847a97c7 *man/plot_predictions.Rd +ebd737e48779f19f748572bd6f5fcae9 *man/plot_slopes.Rd 281a145bb93056f6201b86f985857c98 *man/posterior_draws.Rd bb6528442188174f54cb4c0abfbb469b *man/posteriordraws.Rd -0c5df17f7dfb7ad69a60fedaf652ef38 *man/predictions.Rd -9e39ac15e7addf49f685378126c9674e *man/print.marginaleffects.Rd +80b2b7ed09286766563c478faba8d6d8 *man/predictions.Rd +72630997c8164a5318ba112626f86970 *man/print.marginaleffects.Rd 1e18cfe170451992ed72e3a2e6313dee *man/reexports.Rd -368a280b2a7ba83ce668710e1ac85bf4 *man/sanitize_model_specific.Rd +71dc6f0bc51ebe27210caeab55aaea88 *man/sanitize_model_specific.Rd ab9750e5b89a16979ddfd2a232241c06 *man/set_coef.Rd -0d6d8baa40d7bca9fb78f2e92bda53e6 *man/slopes.Rd +87b0c798913c8f7a40f763b4849755f8 *man/slopes.Rd e84fbde88a4134d4d943cd148c5e0a67 *src/RcppExports.cpp 52bfe4eb70930b6c30ac049945bb3d8a *src/eigen.cpp ff2d6bca48b0cc82868ec8a0ad8091c4 *tests/spelling.R -96c55f2e5e1cd5d81b725697e3b66aec *tests/tinytest.R +1816589a93739ed6bb3f576c586b3429 *tests/tinytest.R diff -Nru r-cran-marginaleffects-0.17.0/NAMESPACE r-cran-marginaleffects-0.18.0/NAMESPACE --- r-cran-marginaleffects-0.17.0/NAMESPACE 2023-10-20 20:41:03.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/NAMESPACE 2024-02-05 01:34:54.000000000 +0000 @@ -37,6 +37,11 @@ S3method(get_group_names,multinom) S3method(get_group_names,polr) S3method(get_group_names,svyolr) +S3method(get_mean_or_mode,character) +S3method(get_mean_or_mode,data.frame) +S3method(get_mean_or_mode,default) +S3method(get_mean_or_mode,factor) +S3method(get_mean_or_mode,logical) S3method(get_model_matrix,default) S3method(get_predict,Learner) S3method(get_predict,MCMCglmm) @@ -107,13 +112,14 @@ S3method(print,comparisons) S3method(print,hypotheses) S3method(print,marginaleffects) -S3method(print,marginalmeans) S3method(print,predictions) S3method(print,slopes) S3method(sanitize_model_specific,bart) S3method(sanitize_model_specific,brmsfit) S3method(sanitize_model_specific,inferences_simulation) S3method(sanitize_model_specific,mblogit) +S3method(sanitize_model_specific,svyglm) +S3method(sanitize_model_specific,svyolr) S3method(set_coef,afex_aov) S3method(set_coef,betareg) S3method(set_coef,crch) @@ -145,11 +151,6 @@ S3method(set_coef,svyolr) S3method(set_coef,workflow) S3method(set_coef,zeroinfl) -S3method(summary,comparisons) -S3method(summary,hypotheses) -S3method(summary,marginalmeans) -S3method(summary,predictions) -S3method(summary,slopes) S3method(tidy,comparisons) S3method(tidy,hypotheses) S3method(tidy,marginaleffects_mids) @@ -168,7 +169,6 @@ export(datagrid) export(datagridcf) export(deltamethod) -export(expect_marginal_means) export(expect_margins) export(expect_predictions) export(expect_slopes) @@ -184,9 +184,6 @@ export(marginaleffects) export(marginalmeans) export(meffects) -export(plot_cap) -export(plot_cco) -export(plot_cme) export(plot_comparisons) export(plot_predictions) export(plot_slopes) diff -Nru r-cran-marginaleffects-0.17.0/NEWS.md r-cran-marginaleffects-0.18.0/NEWS.md --- r-cran-marginaleffects-0.17.0/NEWS.md 2023-12-09 15:36:12.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/NEWS.md 2024-02-05 02:12:52.000000000 +0000 @@ -1,5 +1,40 @@ # News +## 0.18.0 + +This release represents a major step towards 1.0.0. Some functions are renamed and now raise deprecation warnings. After 1.0.0, the API will become much more stable, and any change will have to be very deliberate with much lead time and deprecation delays. + +Breaking changes: + +* `tidy()` no longer takes the average of estimates in the original model object. Users who want an aggregate estimate should call the relevant `avg_*()` function, or use the `by` argument explicitly. The previous behavior led to unexpected behavior and increased code complexity a lot. +* `summary()` methods are removed. These have never provided any additional information; they just reprinted the output already available with the standard print method. At least the default `summary()` for data frames (which is now triggered on `marginaleffects` object) provides a different view on the content of the object. +* `plot_cco()`, `plot_cme()`, and `plot_cap()` were renamed in version 0.9.0, one year ago. They are now fully removed from the package. + +New: + +* `datagrid(grid_type = "balanced")` creates a balanced grid with all unique values of categorical predictors. This can be used with `predictions()` to compute marginal means as in the `emmeans` package. +* `mvgam` package support (multivariate generalized additive models) + +Deprecation warnings: + +* `deltamethod()` has been named `hypotheses()` for a while. We now issue a deprecation warning and it will be removed eventually. +* `datagridcf()` will eventually be deprecated and removed from the package. We will raise a warning for at least one year before removing the function. Identical results can be obtained with `datagrid(..., grid_type="counterfactual")` +* `marginal_means()` will eventually be deprecated and removed from the package. We will raise a warning for at least one year before removing the function. Identical results can be obtained using the `predictions()` function and the `grid_type="balanced"` argument of `datagrid()`. Examples are in the marginal means vignette on the website. + +Minor: + +* Better warning messages for unsupported matrix columns, enhancing user experience and troubleshooting. +* Various improvements to documentation. +* Typos +* Repository hosts model objects for easier testing. + +Bug fixes: + +* Error on `hypotheses(joint = "string")` for `comparisons()` objects (no result was returned). Thanks to @BorgeJorge for report #981. +* Enhanced support for multi-equation Bayesian models with `brms` models. Thanks to @winterstat for report #1006. +* Parameter names with spaces could break standard errors. Thanks to @Lefty2021 for report #1005. + + ## 0.17.0 Breaking changes: @@ -24,7 +59,7 @@ * `wts` argument now respected in `avg_slopes()` for binary variables. Thanks to @trose64 for report #961 * Custom functions in the `comparison` argument of `comparisons()` did not supply the correct `x` vector length for bayesian models when the `by` argument is used. Thanks to @Sandhu-SS for report #931. * Add support for two facet variables (through `facet_grid`) when plotting using `condition` -* `comparisons()`: When `variables` is a vector of length two and `newdata` has exactly two columns, there was ambiguity between custom vectors and length two vector of contrasts. But reported by C. Rainey on Twitter. +* `comparisons()`: When `variables` is a vector of length two and `newdata` has exactly two columns, there was ambiguity between custom vectors and length two vector of contrasts. Bug reported by C. Rainey on Twitter. * Superfluous warning with `fixest::fenegbin`. ## 0.16.0 diff -Nru r-cran-marginaleffects-0.17.0/R/broom.R r-cran-marginaleffects-0.18.0/R/broom.R --- r-cran-marginaleffects-0.17.0/R/broom.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/R/broom.R 2023-12-24 03:08:04.000000000 +0000 @@ -8,18 +8,28 @@ generics::glance - #' tidy helper #' #' @noRd #' @export tidy.comparisons <- function(x, ...) { insight::check_if_installed("tibble") - if ("transform_avg" %in% names(list(...))) { - insight::format_error("The `transform_avg` argument is deprecated. Use `transform` instead.") + out <- tibble::as_tibble(x) + if (!"term" %in% names(out)) { + lab <- seq_len(nrow(out)) + if ("group" %in% colnames(out) || is.character(attr(x, "by"))) { + tmp <- c("group", attr(x, "by")) + tmp <- Filter(function(j) j %in% colnames(x), tmp) + if (length(tmp) > 0) { + tmp <- do.call(paste, out[, tmp]) + if (anyDuplicated(tmp)) { + tmp <- paste(seq_len(nrow(out)), tmp) + } + lab <- tmp + } + } + out[["term"]] <- lab } - out <- get_averages(x, ...) - out <- tibble::as_tibble(out) return(out) } @@ -37,46 +47,21 @@ #' @export tidy.predictions <- tidy.comparisons -#' tidy helper -#' -#' @noRd -#' @export -tidy.hypotheses <- function(x, ...) { - insight::check_if_installed("tibble") - if (any(!c("term", "estimate") %in% colnames(x)) || !inherits(x, c("hypotheses", "deltamethod", "data.frame"))) { - insight::format_error("The `tidy()` method only supports `hypotheses` objects produced by the `marginaleffects::hypotheses()` function.") - } - # the object is already in a tidy format. We need this method for - # `modelsummary` and other functions that rely on `tidy()`. - x <- tibble::as_tibble(x) - return(x) -} - #' tidy helper #' #' @noRd #' @export -tidy.marginalmeans <- function(x, ...) { - insight::check_if_installed("insight") - insight::check_if_installed("tibble") - if ("transform_avg" %in% names(list(...))) { - insight::format_error("The `transform_avg` argument is deprecated. Use `transform` instead.") - } - out <- tibble::as_tibble(x) - attr(out, "conf_level") <- attr(x, "conf_level") - return(out) -} +tidy.hypotheses <- tidy.comparisons #' tidy helper #' #' @noRd #' @export -tidy.hypotheses <- function(x, ...) { +tidy.marginalmeans <- function(x, ...) { insight::check_if_installed("tibble") - out <- tibble::as_tibble(x) - return(out) + tibble::as_tibble(x) } @@ -109,16 +94,19 @@ #' @noRd #' @export -glance.marginalmeans <- glance.slopes +glance.predictions <- glance.slopes + #' @noRd #' @export -glance.predictions <- glance.slopes +glance.comparisons <- glance.slopes + #' @noRd #' @export -glance.comparisons <- glance.slopes +glance.hypotheses <- glance.slopes + #' @noRd #' @export -glance.hypotheses <- glance.slopes \ No newline at end of file +glance.marginalmeans <- glance.slopes \ No newline at end of file diff -Nru r-cran-marginaleffects-0.17.0/R/comparisons.R r-cran-marginaleffects-0.18.0/R/comparisons.R --- r-cran-marginaleffects-0.17.0/R/comparisons.R 2023-12-08 15:34:54.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/R/comparisons.R 2024-01-24 03:51:31.000000000 +0000 @@ -105,8 +105,8 @@ #' #' See `?print.marginaleffects` for printing options. #' +#' @examplesIf interactive() || isTRUE(Sys.getenv("R_DOC_BUILD") == "true") #' @examples -#' \dontrun{ #' library(marginaleffects) #' #' # Linear model @@ -206,7 +206,9 @@ #' tmp <- mtcars %>% #' group_by(cyl) %>% #' mutate(hp_sd = sd(hp)) -#' avg_comparisons(mod, variables = list(hp = tmp$hp_sd), by = "cyl") +#' avg_comparisons(mod, +#' variables = list(hp = function(x) data.frame(x, x + tmp$hp_sd)), +#' by = "cyl") #' #' # `by` argument #' mod <- lm(mpg ~ hp * am * vs, data = mtcars) @@ -221,7 +223,6 @@ #' group = c("3", "4", "5"), #' by = c("3,4", "3,4", "5")) #' comparisons(mod, type = "probs", by = by) -#' } #' #' @export comparisons <- function(model, diff -Nru r-cran-marginaleffects-0.17.0/R/datagrid.R r-cran-marginaleffects-0.18.0/R/datagrid.R --- r-cran-marginaleffects-0.17.0/R/datagrid.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/R/datagrid.R 2024-01-23 23:45:08.000000000 +0000 @@ -3,9 +3,6 @@ #' @description #' Generate a data grid of user-specified values for use in the `newdata` argument of the `predictions()`, `comparisons()`, and `slopes()` functions. This is useful to define where in the predictor space we want to evaluate the quantities of interest. Ex: the predicted outcome or slope for a 37 year old college graduate. #' -#' * `datagrid()` generates data frames with combinations of "typical" or user-supplied predictor values. -#' * `datagridcf()` generates "counter-factual" data frames, by replicating the entire dataset once for every combination of predictor values supplied by the user. -#' #' @param ... named arguments with vectors of values or functions for user-specified variables. #' + Functions are applied to the variable in the `model` dataset or `newdata`, and must return a vector of the appropriate type. #' + Character vectors are automatically transformed to factors if necessary. @@ -17,15 +14,25 @@ #' @param FUN_factor the function to be applied to factor variables. #' @param FUN_logical the function to be applied to logical variables. #' @param FUN_integer the function to be applied to integer variables. +#' @param FUN_binary the function to be applied to binary variables. #' @param FUN_numeric the function to be applied to numeric variables. #' @param FUN_other the function to be applied to other variable types. -#' @param grid_type character -#' * "typical": variables whose values are not explicitly specified by the user in `...` are set to their mean or mode, or to the output of the functions supplied to `FUN_type` arguments. +#' @param grid_type character. Determines the functions to apply to each variable. The defaults can be overridden by defining individual variables explicitly in `...`, or by supplying a function to one of the `FUN_*` arguments. +#' * "mean_or_mode": Character, factor, logical, and binary variables are set to their modes. Numeric, integer, and other variables are set to their means. +#' * "balanced": Each unique level of character, factor, logical, and binary variables are preserved. Numeric, integer, and other variables are set to their means. Warning: When there are many variables and many levels per variable, a balanced grid can be very large. In those cases, it is better to use `grid_type="mean_or_mode"` and to specify the unique levels of a subset of named variables explicitly. #' * "counterfactual": the entire dataset is duplicated for each combination of the variable values specified in `...`. Variables not explicitly supplied to `datagrid()` are set to their observed values in the original dataset. #' @details #' If `datagrid` is used in a `predictions()`, `comparisons()`, or `slopes()` call as the #' `newdata` argument, the model is automatically inserted in the `model` argument of `datagrid()` -#' call, and users do not need to specify either the `model` or `newdata` arguments. +#' call, and users do not need to specify either the `model` or `newdata` arguments. The same behavior will occur when the value supplied to `newdata=` is a function call which starts with "datagrid". This is intended to allow users to create convenience shortcuts like: +#' +#' \preformatted{ +#' library(marginaleffects) +#' mod <- lm(mpg ~ am + vs + factor(cyl) + hp, mtcars) +#' datagrid_bal <- function(...) datagrid(..., grid_type = "balanced") +#' predictions(model, newdata = datagrid_bal(cyl = 4)) +#' } +#' #' #' If users supply a model, the data used to fit that model is retrieved using #' the `insight::get_data` function. @@ -67,28 +74,53 @@ model = NULL, newdata = NULL, by = NULL, - FUN_character = get_mode, - # need to be explicit for numeric variables transfered to factor in model formula - FUN_factor = get_mode, - FUN_logical = get_mode, - FUN_numeric = function(x) mean(x, na.rm = TRUE), - FUN_integer = function(x) round(mean(x, na.rm = TRUE)), - FUN_other = function(x) mean(x, na.rm = TRUE), - grid_type = "typical") { + grid_type = "mean_or_mode", + FUN_character = NULL, + FUN_factor = NULL, + FUN_logical = NULL, + FUN_numeric = NULL, + FUN_integer = NULL, + FUN_binary = NULL, + FUN_other = NULL) { dots <- list(...) + # backward compatibility: 20231220 + if (identical(grid_type, "typical")) { + grid_type <- "mean_or_mode" + } + # sanity - checkmate::assert_choice(grid_type, choices = c("typical", "counterfactual")) - checkmate::assert_function(FUN_character) - checkmate::assert_function(FUN_factor) - checkmate::assert_function(FUN_logical) - checkmate::assert_function(FUN_numeric) - checkmate::assert_function(FUN_other) + checkmate::assert_choice(grid_type, choices = c("mean_or_mode", "balanced", "counterfactual")) + checkmate::assert_function(FUN_character, null.ok = TRUE) + checkmate::assert_function(FUN_factor, null.ok = TRUE) + checkmate::assert_function(FUN_logical, null.ok = TRUE) + checkmate::assert_function(FUN_binary, null.ok = TRUE) + checkmate::assert_function(FUN_integer, null.ok = TRUE) + checkmate::assert_function(FUN_numeric, null.ok = TRUE) + checkmate::assert_function(FUN_other, null.ok = TRUE) checkmate::assert_character(by, null.ok = TRUE) checkmate::assert_data_frame(newdata, null.ok = TRUE) - - if (grid_type == "counterfactual") { + + if (grid_type == "mean_or_mode") { + if (is.null(FUN_character)) FUN_character <- get_mode + if (is.null(FUN_logical)) FUN_logical <- get_mode + if (is.null(FUN_factor)) FUN_factor <- get_mode + if (is.null(FUN_binary)) FUN_binary <- get_mode + if (is.null(FUN_numeric)) FUN_numeric <- function(x) mean(x, na.rm = TRUE) + if (is.null(FUN_other)) FUN_other <- function(x) mean(x, na.rm = TRUE) + if (is.null(FUN_integer)) FUN_integer <- function(x) round(mean(x, na.rm = TRUE)) + + } else if (grid_type == "balanced") { + if (is.null(FUN_character)) FUN_character <- unique + if (is.null(FUN_logical)) FUN_logical <- unique + if (is.null(FUN_factor)) FUN_factor <- unique + if (is.null(FUN_binary)) FUN_binary <- unique + if (is.null(FUN_numeric)) FUN_numeric <- function(x) mean(x, na.rm = TRUE) + if (is.null(FUN_other)) FUN_other <- function(x) mean(x, na.rm = TRUE) + if (is.null(FUN_integer)) FUN_integer <- function(x) round(mean(x, na.rm = TRUE)) + + } else if (grid_type == "counterfactual") { if (!is.null(by)) { insight::format_error("The `by` argument is not supported for counterfactual grids.") } @@ -96,10 +128,10 @@ model = model, newdata = newdata) args <- c(dots, args) - out <- do.call("datagridcf", args) + out <- do.call("datagridcf_internal", args) return(out) } - + if (!is.null(by)) { if (is.null(newdata) && is.null(model)) { insight::format_error("One of `newdata` and `model` must not be `NULL`.") @@ -120,6 +152,7 @@ FUN_character = FUN_character, FUN_factor = FUN_factor, FUN_logical = FUN_logical, + FUN_binary = FUN_binary, FUN_numeric = FUN_numeric, FUN_integer = FUN_integer, FUN_other = FUN_other, @@ -140,6 +173,7 @@ FUN_character = FUN_character, FUN_factor = FUN_factor, FUN_logical = FUN_logical, + FUN_binary = FUN_binary, FUN_numeric = FUN_numeric, FUN_integer = FUN_integer, FUN_other = FUN_other) @@ -155,6 +189,7 @@ # need to be explicit for numeric variables transfered to factor in model formula FUN_factor = get_mode, FUN_logical = get_mode, + FUN_binary = get_mode, FUN_numeric = function(x) mean(x, na.rm = TRUE), FUN_integer = function(x) round(mean(x, na.rm = TRUE)), FUN_other = function(x) mean(x, na.rm = TRUE), @@ -188,12 +223,12 @@ for (n in names(dat_automatic)) { if (get_variable_class(dat, n, c("factor", "strata", "cluster")) || n %in% tmp[["cluster"]]) { out[[n]] <- FUN_factor(dat_automatic[[n]]) + } else if (get_variable_class(dat, n, "binary")) { + out[[n]] <- FUN_binary(dat_automatic[[n]]) } else if (get_variable_class(dat, n, "logical")) { out[[n]] <- FUN_logical(dat_automatic[[n]]) } else if (get_variable_class(dat, n, "character")) { out[[n]] <- FUN_character(dat_automatic[[n]]) - } else if (get_variable_class(dat, n, "binary")) { - out[[n]] <- FUN_numeric(dat_automatic[[n]]) } else if (get_variable_class(dat, n, "numeric")) { if (is.integer(dat_automatic[[n]])) { out[[n]] <- FUN_integer(dat_automatic[[n]]) @@ -243,11 +278,8 @@ } -#' Counterfactual data grid -#' @describeIn datagrid Counterfactual data grid -#' @export -#' -datagridcf <- function( + +datagridcf_internal <- function( ..., model = NULL, newdata = NULL) { @@ -255,7 +287,7 @@ dots <- list(...) if (length(dots) == 0) { - insight::format_error("Users must specify variable values in the `datagridcf()` call.") + insight::format_error("Users must specify variable values when `grid_type='counterfactual'") } tmp <- prep_datagrid(..., model = model, newdata = newdata) @@ -419,4 +451,4 @@ "automatic" = variables_automatic, "cluster" = variables_cluster) return(out) -} \ No newline at end of file +} diff -Nru r-cran-marginaleffects-0.17.0/R/deprecated.R r-cran-marginaleffects-0.18.0/R/deprecated.R --- r-cran-marginaleffects-0.17.0/R/deprecated.R 1970-01-01 00:00:00.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/R/deprecated.R 2024-02-05 01:34:54.000000000 +0000 @@ -0,0 +1,455 @@ +#' Deprecated function +#' +#' @keywords internal +#' @export +deltamethod <- function(...) { + .Deprecated("hypotheses()") +} + + +#' Deprecated function +#' +#' @keywords internal +#' @export +marginaleffects <- function(...) { + .Deprecated("slopes()") + slopes(...) +} + + +#' Deprecated function +#' +#' @keywords internal +#' @export +meffects <- marginaleffects + + + +#' Deprecated function +#' +#' @keywords internal +#' @export +datagridcf <- function(...) { + .Deprecated('datagrid(x = 1:2, grid_type = "counterfactual")') + datagridcf_internal(...) +} + + +#' Deprecated function +#' +#' @keywords internal +#' @export +marginal_means <- function(model, + variables = NULL, + newdata = NULL, + vcov = TRUE, + conf_level = 0.95, + type = NULL, + transform = NULL, + cross = FALSE, + hypothesis = NULL, + equivalence = NULL, + p_adjust = NULL, + df = Inf, + wts = "equal", + by = NULL, + numderiv = "fdforward", + ...) { + + .Deprecated(' +predictions(mod, + by = "x", + newdata = datagrid(grid_type = \"balanced\")) +') + + # deprecation and backward compatibility + dots <- list(...) + sanity_equivalence_p_adjust(equivalence, p_adjust) + if ("transform_post" %in% names(dots)) transform <- dots[["transform_post"]] + if ("variables_grid" %in% names(dots)) { + if (!is.null(newdata)) { + insight::format_error("The `variables_grid` argument and has been replaced by `newdata`. These two arguments cannot be used simultaneously.") + } + newdata <- dots[["variables_grid"]] + } + + if (!is.null(equivalence) && !is.null(p_adjust)) { + insight::format_error("The `equivalence` and `p_adjust` arguments cannot be used together.") + } + + numderiv = sanitize_numderiv(numderiv) + + # build call: match.call() doesn't work well in *apply() + call_attr <- c(list( + name = "marginal_means", + model = model, + newdata = newdata, + variables = variables, + type = type, + vcov = vcov, + by = by, + conf_level = conf_level, + transform = transform, + wts = wts, + hypothesis = hypothesis, + equivalence = equivalence, + p_adjust = p_adjust, + df = df), + list(...)) + call_attr <- do.call("call", call_attr) + + # multiple imputation + if (inherits(model, c("mira", "amest"))) { + out <- process_imputation(model, call_attr, marginal_means = TRUE) + return(out) + } + + # if type is NULL, we backtransform if relevant + type_string <- sanitize_type(model = model, type = type, calling_function = "marginal_means") + if (type_string == "invlink(link)") { + if (is.null(hypothesis)) { + type_call <- "link" + } else { + type_call <- "response" + type_string <- "response" + insight::format_warning('The `type="invlink"` argument is not available unless `hypothesis` is `NULL` or a single number. The value of the `type` argument was changed to "response" automatically. To suppress this warning, use `type="response"` explicitly in your function call.') + } + } else { + type_call <- type_string + } + + modeldata <- get_modeldata(model, additional_variables = FALSE, wts = wts) + + checkmate::assert_flag(cross) + transform <- sanitize_transform(transform) + conf_level <- sanitize_conf_level(conf_level, ...) + model <- sanitize_model(model, vcov = vcov, calling_function = "marginalmeans") + + checkmate::assert_choice(wts, choices = c("equal", "cells", "proportional")) + if (wts != "equal" && is.data.frame(newdata)) { + insight::format_error('The `wts` argument must be "equal" when `newdata` is a data frame.') + } + + tmp <- sanitize_hypothesis(hypothesis, ...) + hypothesis <- tmp$hypothesis + hypothesis_null <- tmp$hypothesis_null + + + sanity_dots(model = model, ...) + if (inherits(model, c("brmsfit", "bart"))) { + insight::format_error("This model object type is not yet supported by the `marginal_means` function.") + } + + # fancy vcov processing to allow strings like "HC3" + vcov_false <- isTRUE(vcov == FALSE) + vcov <- get_vcov(model, vcov = vcov, type = type, ...) + + # focal categorical variables + checkmate::assert_character(variables, min.len = 1, null.ok = TRUE) + if (any(variables %in% insight::find_response(model))) { + insight::format_error("The `variables` vector cannot include the response.") + } + if (is.null(variables)) { + variables <- insight::find_predictors(model, flatten = TRUE) + } + idx <- vapply( + variables, + FUN = get_variable_class, + newdata = modeldata, + FUN.VALUE = logical(1), + compare = c("logical", "character", "factor")) + focal <- variables[idx] + if (length(focal) == 0) { + insight::format_error("No categorical predictor was found in the model data or `variables` argument.") + } + + # non-focal categorical variables + checkmate::assert( + checkmate::check_null(newdata), + checkmate::check_character(newdata), + checkmate::check_data_frame(newdata)) + if (is.null(newdata)) { + nonfocal <- insight::find_predictors(model, flatten = TRUE) + nonfocal <- setdiff(nonfocal, focal) + } else if (is.character(newdata)) { + if (!all(newdata %in% colnames(modeldata))) { + insight::format_error("Some of the variables in `newdata` are missing from the data used to fit the model.") + } + nonfocal <- setdiff(newdata, focal) + } else if (is.data.frame(newdata)) { + nonfocal <- colnames(newdata) + } + idx <- vapply( + nonfocal, + FUN = get_variable_class, + newdata = modeldata, + FUN.VALUE = logical(1), + compare = c("logical", "character", "factor")) + nonfocal <- nonfocal[idx] + + # grid + args <- list(model = model) + if (is.data.frame(newdata)) { + for (v in focal) { + args[[v]] <- unique(modeldata[[v]]) + } + newgrid <- do.call(datagridcf, args) + } else { + for (v in c(focal, nonfocal)) { + args[[v]] <- unique(modeldata[[v]]) + } + newgrid <- do.call(datagrid, args) + } + + # by: usual tests + only data frames in `marginal_means()` + # after newgrid + checkmate::assert_data_frame(by, null.ok = TRUE) + sanity_by(by, newgrid) + + # weights + if (identical(wts, "equal")) { + newgrid[["wts"]] <- 1 + + } else if (identical(wts, "proportional")) { + wtsgrid <- copy(data.table(modeldata)[, ..nonfocal]) + idx <- nonfocal + wtsgrid[, N := .N] + wtsgrid[, "wts" := .N / N, by = idx] + # sometimes datagrid() converts to factors when there is a transformation + # in the model formula, so we need to standardize the data + for (v in colnames(newgrid)) { + if (v %in% colnames(wtsgrid) && is.factor(newgrid[[v]])) { + wtsgrid[[v]] <- factor(wtsgrid[[v]], levels = levels(newgrid[[v]])) + } + } + wtsgrid <- unique(wtsgrid) + newgrid <- merge(newgrid, wtsgrid, all.x = TRUE) + newgrid[["wts"]][is.na(newgrid[["wts"]])] <- 0 + + } else if (identical(wts, "cells")) { + # https://stackoverflow.com/questions/66748520/what-is-the-difference-between-weights-cell-and-weights-proportional-in-r-pa + idx <- c(focal, nonfocal) + wtsgrid <- copy(data.table(modeldata)[, ..idx]) + if (length(idx) == 0) { + newgrid[["wts"]] <- 1 + return(newgrid) + } else { + wtsgrid <- data.table(modeldata)[ + , .(wts = .N), by = idx][ + , wts := wts / sum(wts)] + # sometimes datagrid() converts to factors when there is a transformation + # in the model formula, so we need to standardize the data + for (v in colnames(newgrid)) { + if (v %in% colnames(wtsgrid) && is.factor(newgrid[[v]])) { + wtsgrid[[v]] <- factor(wtsgrid[[v]], levels = levels(newgrid[[v]])) + } + } + wtsgrid <- unique(wtsgrid) + newgrid <- merge(newgrid, wtsgrid, all.x = TRUE) + newgrid[["wts"]][is.na(newgrid[["wts"]])] <- 0 + } + } + + # `equivalence` should not be passed to predictions() at this stage + args <- list( + model = model, + newdata = newgrid, + type = type_call, + variables = focal, + cross = cross, + hypothesis = hypothesis, + by = by, + modeldata = modeldata) + args <- c(args, list(...)) + args[["equivalence"]] <- NULL + mm <- do.call(get_marginalmeans, args) + + # we want consistent output, regardless of whether `data.table` is installed/used or not + out <- as.data.frame(mm) + + # standard errors via delta method + if (!vcov_false) { + args <- list( + model, + vcov = vcov, + type = type_call, + FUN = get_se_delta_marginalmeans, + index = NULL, + variables = focal, + newdata = newgrid, + cross = cross, + modeldata = modeldata, + hypothesis = hypothesis, + by = by, + numderiv = numderiv) + args <- c(args, list(...)) + args[["equivalence"]] <- NULL + se <- do.call(get_se_delta, args) + + # get rid of attributes in column + out[["std.error"]] <- as.numeric(se) + J <- attr(se, "jacobian") + } else { + J <- NULL + } + + out <- get_ci( + out, + conf_level = conf_level, + vcov = vcov, + null_hypothesis = hypothesis_null, + df = df, + p_adjust = p_adjust, + model = model, + ...) + + # equivalence tests + out <- equivalence(out, equivalence = equivalence, df = df, ...) + + # after assign draws + if (identical(type_string, "invlink(link)")) { + linv <- tryCatch(insight::link_inverse(model), error = function(e) identity) + out <- backtransform(out, transform = linv) + } + out <- backtransform(out, transform) + + # column order + cols <- c("rowid", "group", colnames(by), "term", "hypothesis", "value", variables, "estimate", "std.error", "statistic", "p.value", "s.value", "conf.low", "conf.high", sort(colnames(out))) + cols <- unique(cols) + cols <- intersect(cols, colnames(out)) + out <- out[, cols, drop = FALSE] + + # attributes + attr(out, "model") <- model + attr(out, "jacobian") <- J + attr(out, "type") <- type_string + attr(out, "model_type") <- class(model)[1] + attr(out, "variables") <- variables + attr(out, "call") <- call_attr + attr(out, "conf_level") <- conf_level + attr(out, "transform_label") <- names(transform)[1] + + if (isTRUE(cross)) { + attr(out, "variables_grid") <- setdiff(nonfocal, variables) + } else { + attr(out, "variables_grid") <- unique(c(nonfocal, variables)) + } + + if (inherits(model, "brmsfit")) { + insight::check_if_installed("brms") + attr(out, "nchains") <- brms::nchains(model) + } + + class(out) <- c("marginalmeans", class(out)) + + return(out) +} + + +get_marginalmeans <- function(model, + newdata, + type, + variables, + cross, + modeldata, + hypothesis = NULL, + by = NULL, + ...) { + + if ("wts" %in% colnames(newdata)) { + wts <- "wts" + } else { + wts <- NULL + } + + # predictions for each cell of all categorical data, but not the response + if (isTRUE(cross) || length(variables) == 1) { + out <- predictions( + model = model, + newdata = newdata, + type = type, + vcov = FALSE, + modeldata = modeldata, + wts = wts, + by = c("group", variables), + ...) + if (length(variables) == 1) { + out$term <- variables + out$value <- out[[variables]] + } + + # predictions for each variable individual, then bind + } else { + pred_list <- draw_list <- list() + for (v in variables) { + tmp <- predictions( + model = model, + newdata = newdata, + type = type, + vcov = FALSE, + modeldata = modeldata, + wts = wts, + by = c("group", v), + ...) + tmp$rowid <- NULL + draw_list[[v]] <- attr(tmp, "posterior_draws") + tmp$term <- v + data.table::setnames(tmp, old = v, new = "value") + pred_list[[v]] <- tmp + } + # try to preserve term-value class, but convert to character if needed to bind + classes <- sapply(pred_list, function(x) class(x$value)[1]) + if (length(unique(classes)) > 1) { + for (i in seq_along(pred_list)) { + pred_list[[i]]$value <- as.character(pred_list[[i]]$value) + } + } + out <- rbindlist(pred_list) + } + + data.table::setDT(out) + + if (isTRUE(checkmate::check_data_frame(by))) { + # warnings for factor vs numeric vs character. merge.data.table usually still works. + bycols <- intersect(colnames(out), colnames(by)) + if (length(bycols) == 0) { + msg <- "There is no common columns in `by` and in the output of `marginal_means()`. Make sure one of the entries in the `variables` argument corresponds to one of the columns in `by`." + insight::format_error(msg) + } + for (b in bycols) { + if (is.factor(out[[b]]) && is.numeric(by[[b]])) { + out[[b]] <- as.numeric(as.character(out[[b]])) + } else if (is.numeric(out[[b]]) && is.factor(by[[b]])) { + by[[b]] <- as.numeric(as.character(by[[b]])) + } else if (is.factor(out[[b]]) && is.character(by[[b]])) { + out[[b]] <- as.character(out[[b]]) + } else if (is.character(out[[b]]) && is.factor(by[[b]])) { + by[[b]] <- as.character(by[[b]]) + } + } + out <- merge(out, by, sort = FALSE) + out <- out[, .(estimate = mean(estimate)), by = "by"] + } + + if (!is.null(hypothesis)) { + out <- get_hypothesis(out, hypothesis, by = by) + } + + return(out) +} + + +#' Deprecated function +#' +#' @keywords internal +#' @export +marginalmeans <- marginal_means + + +#' @noRd +get_averages.marginalmeans <- function(x, by = FALSE, ...) { + if (!isFALSE(by)) { + insight::format_error("The `by` argument is not supported by the `averages()` function for `marginal_means` models.") + } + x +} \ No newline at end of file diff -Nru r-cran-marginaleffects-0.17.0/R/get_averages.R r-cran-marginaleffects-0.18.0/R/get_averages.R --- r-cran-marginaleffects-0.17.0/R/get_averages.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/R/get_averages.R 2024-01-24 04:20:49.000000000 +0000 @@ -33,12 +33,11 @@ #' obtain the Average Marginal Effect and its associated interval. #' #' @keywords internal +#' @examplesIf interactive() || isTRUE(Sys.getenv("R_DOC_BUILD") == "true") #' @examples -#' \dontrun{ #' mod <- lm(mpg ~ factor(gear), data = mtcars) -#' contr <- comparisons(mod, variables = list(gear = "sequential")) -#' tidy(contr) -#' } +#' avg_comparisons(mod, variables = list(gear = "sequential")) +#' get_averages <- function (x, by = TRUE, ...) { xcall <- substitute(x) if (is.call(xcall)) { @@ -152,13 +151,6 @@ -#' @noRd -get_averages.marginalmeans <- function(x, by = FALSE, ...) { - if (!isFALSE(by)) { - insight::format_error("The `by` argument is not supported by the `averages()` function for `marginal_means` models.") - } - x -} #' @noRd diff -Nru r-cran-marginaleffects-0.17.0/R/get_coef.R r-cran-marginaleffects-0.18.0/R/get_coef.R --- r-cran-marginaleffects-0.17.0/R/get_coef.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/R/get_coef.R 2024-02-05 01:34:54.000000000 +0000 @@ -17,6 +17,7 @@ # more general out <- insight::get_parameters(model, component = "all") + out <- stats::setNames(out$Estimate, out$Parameter) return(out) } diff -Nru r-cran-marginaleffects-0.17.0/R/get_se_delta.R r-cran-marginaleffects-0.18.0/R/get_se_delta.R --- r-cran-marginaleffects-0.17.0/R/get_se_delta.R 2023-10-20 20:41:03.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/R/get_se_delta.R 2024-02-05 01:34:54.000000000 +0000 @@ -84,7 +84,8 @@ # input: named vector of coefficients # output: gradient inner <- function(x) { - model_tmp <- set_coef(model, stats::setNames(x, names(coefs)) ,...) + names(x) <- names(coefs) + model_tmp <- set_coef(model, x, ...) # do not pass NULL arguments. Important for `deltam` to allow users to supply FUN without ... args <- c(list(model = model_tmp, hypothesis = hypothesis), list(...)) if (inherits(model, "gamlss")) args[["safe"]] <- FALSE diff -Nru r-cran-marginaleffects-0.17.0/R/hypotheses.R r-cran-marginaleffects-0.18.0/R/hypotheses.R --- r-cran-marginaleffects-0.17.0/R/hypotheses.R 2023-12-08 15:34:54.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/R/hypotheses.R 2024-02-04 18:18:04.000000000 +0000 @@ -16,7 +16,7 @@ #' Warning #3: The tests assume that the `hypothesis` expression is (approximately) normally distributed, which for non-linear functions of the parameters may not be realistic. More reliable confidence intervals can be obtained using the \code{inferences()} function with `method = "boot"`. #' #' @inheritParams comparisons -#' @param model Model object or object generated by the `comparisons()`, `slopes()`, `predictions()`, or `marginal_means()` functions. +#' @param model Model object or object generated by the `comparisons()`, `slopes()`, or `predictions()` functions. #' @param FUN `NULL` or function. #' * `NULL` (default): hypothesis test on a model's coefficients, or on the quantities estimated by one of the `marginaleffects` package functions. #' * Function which accepts a model object and returns a numeric vector or a data.frame with two columns called `term` and `estimate`. This argument can be useful when users want to conduct a hypothesis test on an arbitrary function of quantities held in a model object. See examples below. @@ -435,11 +435,3 @@ -#' `deltamethod()` is an alias to `hypotheses()` -#' -#' This alias is kept for backward compatibility. -#' -#' @inherit marginaleffects -#' @keywords internal -#' @export -deltamethod <- hypotheses diff -Nru r-cran-marginaleffects-0.17.0/R/hypotheses_joint.R r-cran-marginaleffects-0.18.0/R/hypotheses_joint.R --- r-cran-marginaleffects-0.17.0/R/hypotheses_joint.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/R/hypotheses_joint.R 2023-12-24 03:08:04.000000000 +0000 @@ -2,7 +2,16 @@ checkmate::assert_choice(joint_test, c("f", "chisq")) # theta_hat: P x 1 vector of estimated parameters - theta_hat <- stats::coef(object) + if (inherits(object, c("slopes", "comparisons"))) { + nam <- object$term + if ("contrast" %in% names(object)) { + nam <- paste(nam, object$contrast) + } + theta_hat <- stats::setNames(object$estimate, nam) + } else { + theta_hat <- get_coef(object) + } + # index checkmate::assert( diff -Nru r-cran-marginaleffects-0.17.0/R/marginal_means.R r-cran-marginaleffects-0.18.0/R/marginal_means.R --- r-cran-marginaleffects-0.17.0/R/marginal_means.R 2023-12-08 15:34:54.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/R/marginal_means.R 1970-01-01 00:00:00.000000000 +0000 @@ -1,543 +0,0 @@ -#' Marginal Means -#' -#' @description -#' Marginal means are adjusted predictions, averaged across a grid of categorical predictors, -#' holding other numeric predictors at their means. To learn more, read the marginal means vignette, visit the -#' package website, or scroll down this page for a full list of vignettes: -#' -#' * -#' * -#' -#' @param variables Focal variables -#' + Character vector of variable names: compute marginal means for each category of the listed variables. -#' + `NULL`: calculate marginal means for all logical, character, or factor variables in the dataset used to fit `model`. Hint: Set `cross=TRUE` to compute marginal means for combinations of focal variables. -#' @param newdata Grid of predictor values over which we marginalize. -#' + Warning: Please avoid modifying your dataset between fitting the model and calling a `marginaleffects` function. This can sometimes lead to unexpected results. -#' + `NULL` create a grid with all combinations of all categorical predictors in the model. Warning: can be expensive. -#' + Character vector: subset of categorical variables to use when building the balanced grid of predictors. Other variables are held to their mean or mode. -#' + Data frame: A data frame which includes all the predictors in the original model. The full dataset is replicated once for every combination of the focal variables in the `variables` argument, using the `datagridcf()` function. -#' @param type string indicates the type (scale) of the predictions used to -#' compute marginal effects or contrasts. This can differ based on the model -#' type, but will typically be a string such as: "response", "link", "probs", -#' or "zero". When an unsupported string is entered, the model-specific list of -#' acceptable values is returned in an error message. When `type` is `NULL`, the -#' first entry in the error message is used by default. -#' @param wts character value. Weights to use in the averaging. -#' + "equal": each combination of variables in `newdata` gets equal weight. -#' + "cells": each combination of values for the variables in the `newdata` gets a weight proportional to its frequency in the original data. -#' + "proportional": each combination of values for the variables in `newdata` -- except for those in the `variables` argument -- gets a weight proportional to its frequency in the original data. -#' @param cross TRUE or FALSE -#' * `FALSE` (default): Marginal means are computed for each predictor individually. -#' * `TRUE`: Marginal means are computed for each combination of predictors specified in the `variables` argument. -#' @param by Collapse marginal means into categories. Data frame with a `by` column of group labels, and merging columns shared by `newdata` or the data frame produced by calling the same function without the `by` argument. -#' @inheritParams slopes -#' @inheritParams predictions -#' @inheritParams comparisons -#' @details -#' This function begins by calling the `predictions` function to obtain a -#' grid of predictors, and adjusted predictions for each cell. The grid -#' includes all combinations of the categorical variables listed in the -#' `variables` and `newdata` arguments, or all combinations of the -#' categorical variables used to fit the model if `newdata` is `NULL`. -#' In the prediction grid, numeric variables are held at their means. -#' -#' After constructing the grid and filling the grid with adjusted predictions, -#' `marginal_means` computes marginal means for the variables listed in the -#' `variables` argument, by average across all categories in the grid. -#' -#' `marginal_means` can only compute standard errors for linear models, or for -#' predictions on the link scale, that is, with the `type` argument set to -#' "link". -#' -#' The `marginaleffects` website compares the output of this function to the -#' popular `emmeans` package, which provides similar but more advanced -#' functionality: https://marginaleffects.com/ -#' -#' @template deltamethod -#' @template model_specific_arguments -#' @template bayesian -#' @template equivalence -#' @template type -#' @template references -#' -#' @return Data frame of marginal means with one row per variable-value combination. -#' @export -#' @examples -#' library(marginaleffects) -#' -#' # simple marginal means for each level of `cyl` -#' dat <- mtcars -#' dat$carb <- factor(dat$carb) -#' dat$cyl <- factor(dat$cyl) -#' dat$am <- as.logical(dat$am) -#' mod <- lm(mpg ~ carb + cyl + am, dat) -#' -#' marginal_means( -#' mod, -#' variables = "cyl") -#' -#' # collapse levels of cyl by averaging -#' by <- data.frame( -#' cyl = c(4, 6, 8), -#' by = c("4 & 6", "4 & 6", "8")) -#' marginal_means(mod, -#' variables = "cyl", -#' by = by) -#' -#' # pairwise differences between collapsed levels -#' marginal_means(mod, -#' variables = "cyl", -#' by = by, -#' hypothesis = "pairwise") -#' -#' # cross -#' marginal_means(mod, -#' variables = c("cyl", "carb"), -#' cross = TRUE) -#' -#' # collapsed cross -#' by <- expand.grid( -#' cyl = unique(mtcars$cyl), -#' carb = unique(mtcars$carb)) -#' by$by <- ifelse( -#' by$cyl == 4, -#' paste("Control:", by$carb), -#' paste("Treatment:", by$carb)) -#' -#' -#' # Convert numeric variables to categorical before fitting the model -#' dat <- mtcars -#' dat$am <- as.logical(dat$am) -#' dat$carb <- as.factor(dat$carb) -#' mod <- lm(mpg ~ hp + am + carb, data = dat) -#' -#' # Compute and summarize marginal means -#' marginal_means(mod) -#' -#' # Contrast between marginal means (carb2 - carb1), or "is the 1st marginal means equal to the 2nd?" -#' # see the vignette on "Hypothesis Tests and Custom Contrasts" on the `marginaleffects` website. -#' lc <- c(-1, 1, 0, 0, 0, 0) -#' marginal_means(mod, variables = "carb", hypothesis = "b2 = b1") -#' -#' marginal_means(mod, variables = "carb", hypothesis = lc) -#' -#' # Multiple custom contrasts -#' lc <- matrix(c( -#' -2, 1, 1, 0, -1, 1, -#' -1, 1, 0, 0, 0, 0 -#' ), -#' ncol = 2, -#' dimnames = list(NULL, c("A", "B"))) -#' marginal_means(mod, variables = "carb", hypothesis = lc) -#' -marginal_means <- function(model, - variables = NULL, - newdata = NULL, - vcov = TRUE, - conf_level = 0.95, - type = NULL, - transform = NULL, - cross = FALSE, - hypothesis = NULL, - equivalence = NULL, - p_adjust = NULL, - df = Inf, - wts = "equal", - by = NULL, - numderiv = "fdforward", - ...) { - - - # deprecation and backward compatibility - dots <- list(...) - sanity_equivalence_p_adjust(equivalence, p_adjust) - if ("transform_post" %in% names(dots)) transform <- dots[["transform_post"]] - if ("variables_grid" %in% names(dots)) { - if (!is.null(newdata)) { - insight::format_error("The `variables_grid` argument and has been replaced by `newdata`. These two arguments cannot be used simultaneously.") - } - newdata <- dots[["variables_grid"]] - } - - if (!is.null(equivalence) && !is.null(p_adjust)) { - insight::format_error("The `equivalence` and `p_adjust` arguments cannot be used together.") - } - - numderiv = sanitize_numderiv(numderiv) - - # build call: match.call() doesn't work well in *apply() - call_attr <- c(list( - name = "marginal_means", - model = model, - newdata = newdata, - variables = variables, - type = type, - vcov = vcov, - by = by, - conf_level = conf_level, - transform = transform, - wts = wts, - hypothesis = hypothesis, - equivalence = equivalence, - p_adjust = p_adjust, - df = df), - list(...)) - call_attr <- do.call("call", call_attr) - - # multiple imputation - if (inherits(model, c("mira", "amest"))) { - out <- process_imputation(model, call_attr, marginal_means = TRUE) - return(out) - } - - # if type is NULL, we backtransform if relevant - type_string <- sanitize_type(model = model, type = type, calling_function = "marginal_means") - if (type_string == "invlink(link)") { - if (is.null(hypothesis)) { - type_call <- "link" - } else { - type_call <- "response" - type_string <- "response" - insight::format_warning('The `type="invlink"` argument is not available unless `hypothesis` is `NULL` or a single number. The value of the `type` argument was changed to "response" automatically. To suppress this warning, use `type="response"` explicitly in your function call.') - } - } else { - type_call <- type_string - } - - modeldata <- get_modeldata(model, additional_variables = FALSE, wts = wts) - - checkmate::assert_flag(cross) - transform <- sanitize_transform(transform) - conf_level <- sanitize_conf_level(conf_level, ...) - model <- sanitize_model(model, vcov = vcov, calling_function = "marginalmeans") - - checkmate::assert_choice(wts, choices = c("equal", "cells", "proportional")) - if (wts != "equal" && is.data.frame(newdata)) { - insight::format_error('The `wts` argument must be "equal" when `newdata` is a data frame.') - } - - tmp <- sanitize_hypothesis(hypothesis, ...) - hypothesis <- tmp$hypothesis - hypothesis_null <- tmp$hypothesis_null - - - sanity_dots(model = model, ...) - if (inherits(model, c("brmsfit", "bart"))) { - insight::format_error("This model object type is not yet supported by the `marginal_means` function.") - } - - # fancy vcov processing to allow strings like "HC3" - vcov_false <- isTRUE(vcov == FALSE) - vcov <- get_vcov(model, vcov = vcov, type = type, ...) - - # focal categorical variables - checkmate::assert_character(variables, min.len = 1, null.ok = TRUE) - if (any(variables %in% insight::find_response(model))) { - insight::format_error("The `variables` vector cannot include the response.") - } - if (is.null(variables)) { - variables <- insight::find_predictors(model, flatten = TRUE) - } - idx <- vapply( - variables, - FUN = get_variable_class, - newdata = modeldata, - FUN.VALUE = logical(1), - compare = c("logical", "character", "factor")) - focal <- variables[idx] - if (length(focal) == 0) { - insight::format_error("No categorical predictor was found in the model data or `variables` argument.") - } - - # non-focal categorical variables - checkmate::assert( - checkmate::check_null(newdata), - checkmate::check_character(newdata), - checkmate::check_data_frame(newdata)) - if (is.null(newdata)) { - nonfocal <- insight::find_predictors(model, flatten = TRUE) - nonfocal <- setdiff(nonfocal, focal) - } else if (is.character(newdata)) { - if (!all(newdata %in% colnames(modeldata))) { - insight::format_error("Some of the variables in `newdata` are missing from the data used to fit the model.") - } - nonfocal <- setdiff(newdata, focal) - } else if (is.data.frame(newdata)) { - nonfocal <- colnames(newdata) - } - idx <- vapply( - nonfocal, - FUN = get_variable_class, - newdata = modeldata, - FUN.VALUE = logical(1), - compare = c("logical", "character", "factor")) - nonfocal <- nonfocal[idx] - - # grid - args <- list(model = model) - if (is.data.frame(newdata)) { - for (v in focal) { - args[[v]] <- unique(modeldata[[v]]) - } - newgrid <- do.call(datagridcf, args) - } else { - for (v in c(focal, nonfocal)) { - args[[v]] <- unique(modeldata[[v]]) - } - newgrid <- do.call(datagrid, args) - } - - # by: usual tests + only data frames in `marginal_means()` - # after newgrid - checkmate::assert_data_frame(by, null.ok = TRUE) - sanity_by(by, newgrid) - - # weights - if (identical(wts, "equal")) { - newgrid[["wts"]] <- 1 - - } else if (identical(wts, "proportional")) { - wtsgrid <- copy(data.table(modeldata)[, ..nonfocal]) - idx <- nonfocal - wtsgrid[, N := .N] - wtsgrid[, "wts" := .N / N, by = idx] - # sometimes datagrid() converts to factors when there is a transformation - # in the model formula, so we need to standardize the data - for (v in colnames(newgrid)) { - if (v %in% colnames(wtsgrid) && is.factor(newgrid[[v]])) { - wtsgrid[[v]] <- factor(wtsgrid[[v]], levels = levels(newgrid[[v]])) - } - } - wtsgrid <- unique(wtsgrid) - newgrid <- merge(newgrid, wtsgrid, all.x = TRUE) - newgrid[["wts"]][is.na(newgrid[["wts"]])] <- 0 - - } else if (identical(wts, "cells")) { - # https://stackoverflow.com/questions/66748520/what-is-the-difference-between-weights-cell-and-weights-proportional-in-r-pa - idx <- c(focal, nonfocal) - wtsgrid <- copy(data.table(modeldata)[, ..idx]) - if (length(idx) == 0) { - newgrid[["wts"]] <- 1 - return(newgrid) - } else { - wtsgrid <- data.table(modeldata)[ - , .(wts = .N), by = idx][ - , wts := wts / sum(wts)] - # sometimes datagrid() converts to factors when there is a transformation - # in the model formula, so we need to standardize the data - for (v in colnames(newgrid)) { - if (v %in% colnames(wtsgrid) && is.factor(newgrid[[v]])) { - wtsgrid[[v]] <- factor(wtsgrid[[v]], levels = levels(newgrid[[v]])) - } - } - wtsgrid <- unique(wtsgrid) - newgrid <- merge(newgrid, wtsgrid, all.x = TRUE) - newgrid[["wts"]][is.na(newgrid[["wts"]])] <- 0 - } - } - - # `equivalence` should not be passed to predictions() at this stage - args <- list( - model = model, - newdata = newgrid, - type = type_call, - variables = focal, - cross = cross, - hypothesis = hypothesis, - by = by, - modeldata = modeldata) - args <- c(args, list(...)) - args[["equivalence"]] <- NULL - mm <- do.call(get_marginalmeans, args) - - # we want consistent output, regardless of whether `data.table` is installed/used or not - out <- as.data.frame(mm) - - # standard errors via delta method - if (!vcov_false) { - args <- list( - model, - vcov = vcov, - type = type_call, - FUN = get_se_delta_marginalmeans, - index = NULL, - variables = focal, - newdata = newgrid, - cross = cross, - modeldata = modeldata, - hypothesis = hypothesis, - by = by, - numderiv = numderiv) - args <- c(args, list(...)) - args[["equivalence"]] <- NULL - se <- do.call(get_se_delta, args) - - # get rid of attributes in column - out[["std.error"]] <- as.numeric(se) - J <- attr(se, "jacobian") - } else { - J <- NULL - } - - out <- get_ci( - out, - conf_level = conf_level, - vcov = vcov, - null_hypothesis = hypothesis_null, - df = df, - p_adjust = p_adjust, - model = model, - ...) - - # equivalence tests - out <- equivalence(out, equivalence = equivalence, df = df, ...) - - # after assign draws - if (identical(type_string, "invlink(link)")) { - linv <- tryCatch(insight::link_inverse(model), error = function(e) identity) - out <- backtransform(out, transform = linv) - } - out <- backtransform(out, transform) - - # column order - cols <- c("rowid", "group", colnames(by), "term", "hypothesis", "value", variables, "estimate", "std.error", "statistic", "p.value", "s.value", "conf.low", "conf.high", sort(colnames(out))) - cols <- unique(cols) - cols <- intersect(cols, colnames(out)) - out <- out[, cols, drop = FALSE] - - # attributes - attr(out, "model") <- model - attr(out, "jacobian") <- J - attr(out, "type") <- type_string - attr(out, "model_type") <- class(model)[1] - attr(out, "variables") <- variables - attr(out, "call") <- call_attr - attr(out, "conf_level") <- conf_level - attr(out, "transform_label") <- names(transform)[1] - - if (isTRUE(cross)) { - attr(out, "variables_grid") <- setdiff(nonfocal, variables) - } else { - attr(out, "variables_grid") <- unique(c(nonfocal, variables)) - } - - if (inherits(model, "brmsfit")) { - insight::check_if_installed("brms") - attr(out, "nchains") <- brms::nchains(model) - } - - class(out) <- c("marginalmeans", class(out)) - - return(out) -} - - -#' Workhorse function for `marginal_means` -#' -#' Needs to be separate because we also need it in `delta_method` -#' @inheritParams marginalmeans -#' @inheritParams predictions -#' @param ... absorb useless arguments from other get_* workhorse functions -#' @noRd -get_marginalmeans <- function(model, - newdata, - type, - variables, - cross, - modeldata, - hypothesis = NULL, - by = NULL, - ...) { - - if ("wts" %in% colnames(newdata)) { - wts <- "wts" - } else { - wts <- NULL - } - - # predictions for each cell of all categorical data, but not the response - if (isTRUE(cross) || length(variables) == 1) { - out <- predictions( - model = model, - newdata = newdata, - type = type, - vcov = FALSE, - modeldata = modeldata, - wts = wts, - by = c("group", variables), - ...) - if (length(variables) == 1) { - out$term <- variables - out$value <- out[[variables]] - } - - # predictions for each variable individual, then bind - } else { - pred_list <- draw_list <- list() - for (v in variables) { - tmp <- predictions( - model = model, - newdata = newdata, - type = type, - vcov = FALSE, - modeldata = modeldata, - wts = wts, - by = c("group", v), - ...) - tmp$rowid <- NULL - draw_list[[v]] <- attr(tmp, "posterior_draws") - tmp$term <- v - data.table::setnames(tmp, old = v, new = "value") - pred_list[[v]] <- tmp - } - # try to preserve term-value class, but convert to character if needed to bind - classes <- sapply(pred_list, function(x) class(x$value)[1]) - if (length(unique(classes)) > 1) { - for (i in seq_along(pred_list)) { - pred_list[[i]]$value <- as.character(pred_list[[i]]$value) - } - } - out <- rbindlist(pred_list) - } - - data.table::setDT(out) - - if (isTRUE(checkmate::check_data_frame(by))) { - # warnings for factor vs numeric vs character. merge.data.table usually still works. - bycols <- intersect(colnames(out), colnames(by)) - if (length(bycols) == 0) { - msg <- "There is no common columns in `by` and in the output of `marginal_means()`. Make sure one of the entries in the `variables` argument corresponds to one of the columns in `by`." - insight::format_error(msg) - } - for (b in bycols) { - if (is.factor(out[[b]]) && is.numeric(by[[b]])) { - out[[b]] <- as.numeric(as.character(out[[b]])) - } else if (is.numeric(out[[b]]) && is.factor(by[[b]])) { - by[[b]] <- as.numeric(as.character(by[[b]])) - } else if (is.factor(out[[b]]) && is.character(by[[b]])) { - out[[b]] <- as.character(out[[b]]) - } else if (is.character(out[[b]]) && is.factor(by[[b]])) { - by[[b]] <- as.character(by[[b]]) - } - } - out <- merge(out, by, sort = FALSE) - out <- out[, .(estimate = mean(estimate)), by = "by"] - } - - if (!is.null(hypothesis)) { - out <- get_hypothesis(out, hypothesis, by = by) - } - - return(out) -} - - - -#' `marginal_means()` is an alias to `marginal_means()` -#' -#' This alias is kept for backward compatibility and because some users may prefer that name. -#' -#' @inherit marginal_means -#' @keywords internal -#' @export -marginalmeans <- marginal_means \ No newline at end of file diff -Nru r-cran-marginaleffects-0.17.0/R/mean_or_mode.R r-cran-marginaleffects-0.18.0/R/mean_or_mode.R --- r-cran-marginaleffects-0.17.0/R/mean_or_mode.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/R/mean_or_mode.R 2024-01-24 03:03:16.000000000 +0000 @@ -21,22 +21,27 @@ UseMethod("get_mean_or_mode") } +#' @export get_mean_or_mode.default <- function(x) { mean(x) } +#' @export get_mean_or_mode.character <- function(x) { get_mode(x) } +#' @export get_mean_or_mode.factor <- function(x) { get_mode(x) } +#' @export get_mean_or_mode.logical <- function(x) { get_mode(x) } +#' @export get_mean_or_mode.data.frame <- function(x) { out <- list() for (n in names(x)) { diff -Nru r-cran-marginaleffects-0.17.0/R/methods_dataframe.R r-cran-marginaleffects-0.18.0/R/methods_dataframe.R --- r-cran-marginaleffects-0.17.0/R/methods_dataframe.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/R/methods_dataframe.R 2024-02-05 01:34:54.000000000 +0000 @@ -21,7 +21,7 @@ #' @include set_coef.R #' @rdname set_coef #' @export -set_coef.data.frame = function(model, coefs, ...) { +set_coef.data.frame <- function(model, coefs, ...) { model$estimate = coefs return(model) } diff -Nru r-cran-marginaleffects-0.17.0/R/methods_stats.R r-cran-marginaleffects-0.18.0/R/methods_stats.R --- r-cran-marginaleffects-0.17.0/R/methods_stats.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/R/methods_stats.R 2024-02-05 01:34:54.000000000 +0000 @@ -2,8 +2,9 @@ #' @rdname set_coef #' @export set_coef.glm <- function(model, coefs, ...) { - # in glm coefficients are named vector - model[["coefficients"]][names(coefs)] <- coefs + model[["coefficients"]] <- sub_named_vector( + model[["coefficients"]], coefs + ) ## But, there's an edge case!! When `predict(model, se.fit = TRUE)` is called without `newdata`, `predict.lm()` isn't called. ## Instead `model$linear.predictors` is returned directly if `type = "link"` and ## `model$fitted.values` is returned directly if `type = "response"`. @@ -15,8 +16,9 @@ #' @rdname set_coef #' @export set_coef.lm <- function(model, coefs, ...) { - # in lm coefficients are named vector - model[["coefficients"]][names(coefs)] <- coefs + model[["coefficients"]] <- sub_named_vector( + model[["coefficients"]], coefs + ) model } @@ -87,4 +89,4 @@ #' @export get_coef.nls <- function(model, ...) { model$m$getPars() -} \ No newline at end of file +} diff -Nru r-cran-marginaleffects-0.17.0/R/methods_survey.R r-cran-marginaleffects-0.18.0/R/methods_survey.R --- r-cran-marginaleffects-0.17.0/R/methods_survey.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/R/methods_survey.R 2024-02-04 18:18:04.000000000 +0000 @@ -62,4 +62,23 @@ out <- out[out$rowid != -Inf, ] return(out) -} \ No newline at end of file +} + + +#' @include sanity_model.R +#' @rdname sanitize_model_specific +#' @export +sanitize_model_specific.svyolr <- function(model, wts = NULL, ...) { + if (is.null(wts)) { + warning("With models of this class, it is normally good practice to specify weights using the `wts` argument. Otherwise, weights will be ignored in the computation of quantities of interest.", call. = FALSE) + } + return(model) +} + + +#' @include sanity_model.R +#' @rdname sanitize_model_specific +#' @export +sanitize_model_specific.svyglm <- sanitize_model_specific.svyolr + + diff -Nru r-cran-marginaleffects-0.17.0/R/plot_comparisons.R r-cran-marginaleffects-0.18.0/R/plot_comparisons.R --- r-cran-marginaleffects-0.17.0/R/plot_comparisons.R 2023-12-08 18:41:56.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/R/plot_comparisons.R 2024-02-02 23:46:58.000000000 +0000 @@ -5,10 +5,8 @@ #' #' The `by` argument is used to plot marginal comparisons, that is, comparisons made on the original data, but averaged by subgroups. This is analogous to using the `by` argument in the `comparisons()` function. #' -#' The `condition` argument is used to plot conditional comparisons, that is, comparisons made on a user-specified grid. This is analogous to using the `newdata` argument and `datagrid()` function in a `comparisons()` call. +#' The `condition` argument is used to plot conditional comparisons, that is, comparisons made on a user-specified grid. This is analogous to using the `newdata` argument and `datagrid()` function in a `comparisons()` call. All variables whose values are not specified explicitly are treated as usual by `datagrid()`, that is, they are held at their mean or mode (or rounded mean for integers). This includes grouping variables in mixed-effects models, so analysts who fit such models may want to specify the groups of interest using the `condition` argument, or supply model-specific arguments to compute population-level estimates. See details below. #' -#' All unspecified variables are held at their mean or mode. This includes grouping variables in mixed-effects models, so analysts who fit such models may want to specify the groups of interest using the `variables` argument, or supply model-specific arguments to compute population-level estimates. See details below. - #' See the "Plots" vignette and website for tutorials and information on how to customize plots: #' #' * https://marginaleffects.com/vignettes/plot.html @@ -161,14 +159,3 @@ return(p) } - -#' `plot_comparisons()` is an alias to `plot_comparisons()` -#' -#' This alias is kept for backward compatibility. -#' @inherit plot_predictions -#' @keywords internal -#' @export -plot_cco <- function(...) { - insight::format_warning("This function has been renamed to `plot_comparisons()`. The `plot_cco()` alias will be removed in the near future.") - plot_comparisons(...) -} \ No newline at end of file diff -Nru r-cran-marginaleffects-0.17.0/R/plot_predictions.R r-cran-marginaleffects-0.18.0/R/plot_predictions.R --- r-cran-marginaleffects-0.17.0/R/plot_predictions.R 2023-12-08 18:41:56.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/R/plot_predictions.R 2024-02-02 23:46:58.000000000 +0000 @@ -5,9 +5,7 @@ #' #' The `by` argument is used to plot marginal predictions, that is, predictions made on the original data, but averaged by subgroups. This is analogous to using the `by` argument in the `predictions()` function. #' -#' The `condition` argument is used to plot conditional predictions, that is, predictions made on a user-specified grid. This is analogous to using the `newdata` argument and `datagrid()` function in a `predictions()` call. -#' -#' All unspecified variables are held at their mean or mode. This includes grouping variables in mixed-effects models, so analysts who fit such models may want to specify the groups of interest using the `variables` argument, or supply model-specific arguments to compute population-level estimates. See details below. +#' The `condition` argument is used to plot conditional predictions, that is, predictions made on a user-specified grid. This is analogous to using the `newdata` argument and `datagrid()` function in a `predictions()` call. All variables whose values are not specified explicitly are treated as usual by `datagrid()`, that is, they are held at their mean or mode (or rounded mean for integers). This includes grouping variables in mixed-effects models, so analysts who fit such models may want to specify the groups of interest using the `condition` argument, or supply model-specific arguments to compute population-level estimates. See details below. #' #' See the "Plots" vignette and website for tutorials and information on how to customize plots: #' @@ -190,13 +188,3 @@ -#' `plot_predictions()` is an alias to `plot_predictions()` -#' -#' This alias is kept for backward compatibility. -#' @inherit plot_predictions -#' @keywords internal -#' @export -plot_cap <- function(...) { - insight::format_warning("This function has been renamed to `plot_predictions()`. The `plot_cap()` alias will be removed in the near future.") - plot_predictions(...) -} \ No newline at end of file diff -Nru r-cran-marginaleffects-0.17.0/R/plot_slopes.R r-cran-marginaleffects-0.18.0/R/plot_slopes.R --- r-cran-marginaleffects-0.17.0/R/plot_slopes.R 2023-12-08 18:41:56.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/R/plot_slopes.R 2024-02-02 23:46:58.000000000 +0000 @@ -5,9 +5,7 @@ #' #' The `by` argument is used to plot marginal slopes, that is, slopes made on the original data, but averaged by subgroups. This is analogous to using the `by` argument in the `slopes()` function. #' -#' The `condition` argument is used to plot conditional slopes, that is, slopes made on a user-specified grid. This is analogous to using the `newdata` argument and `datagrid()` function in a `slopes()` call. -#' -#' All unspecified variables are held at their mean or mode. This includes grouping variables in mixed-effects models, so analysts who fit such models may want to specify the groups of interest using the `variables` argument, or supply model-specific arguments to compute population-level estimates. See details below. +#' The `condition` argument is used to plot conditional slopes, that is, slopes computed on a user-specified grid. This is analogous to using the `newdata` argument and `datagrid()` function in a `slopes()` call. All variables whose values are not specified explicitly are treated as usual by `datagrid()`, that is, they are held at their mean or mode (or rounded mean for integers). This includes grouping variables in mixed-effects models, so analysts who fit such models may want to specify the groups of interest using the `condition` argument, or supply model-specific arguments to compute population-level estimates. See details below. #' See the "Plots" vignette and website for tutorials and information on how to customize plots: #' @@ -101,14 +99,3 @@ return(out) } - -#' `plot_slopes()` is an alias to `plot_slopes()` -#' -#' This alias is kept for backward compatibility. -#' @inherit plot_predictions -#' @keywords internal -#' @export -plot_cme <- function(...) { - insight::format_warning("This function has been renamed to `plot_slopes()`. The `plot_cme()` alias will be removed in the near future.") - plot_slopes(...) -} \ No newline at end of file diff -Nru r-cran-marginaleffects-0.17.0/R/predictions.R r-cran-marginaleffects-0.18.0/R/predictions.R --- r-cran-marginaleffects-0.17.0/R/predictions.R 2023-12-08 15:34:54.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/R/predictions.R 2024-01-24 02:57:28.000000000 +0000 @@ -79,8 +79,8 @@ #' #' See `?print.marginaleffects` for printing options. #' +#' @examplesIf interactive() || isTRUE(Sys.getenv("R_DOC_BUILD") == "true") #' @examples -#' \dontrun{ #' # Adjusted Prediction for every row of the original dataset #' mod <- lm(mpg ~ hp + factor(cyl), data = mtcars) #' pred <- predictions(mod) @@ -176,7 +176,6 @@ #' by = c("4,6", "4,6", "8"), #' group = as.character(c(4, 6, 8))) #' predictions(mod, newdata = "mean", byfun = sum, by = by) -#' } #' #' @inheritParams slopes #' @inheritParams comparisons @@ -291,14 +290,6 @@ transform_original <- transform transform <- sanitize_transform(transform) - model <- sanitize_model_specific( - model = model, - newdata = newdata, - vcov = vcov, - calling_function = "predictions", - ...) - - conf_level <- sanitize_conf_level(conf_level, ...) newdata <- sanitize_newdata( model = model, diff -Nru r-cran-marginaleffects-0.17.0/R/print.R r-cran-marginaleffects-0.18.0/R/print.R --- r-cran-marginaleffects-0.17.0/R/print.R 2023-10-17 19:09:47.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/R/print.R 2024-02-05 01:34:54.000000000 +0000 @@ -1,13 +1,13 @@ #' Print `marginaleffects` objects #' #' @description -#' This function controls the text which is printed to the console when one of the core `marginalefffects` functions is called and the object is returned: `predictions()`, `comparisons()`, `slopes()`, `marginal_means()`, `hypotheses()`, `avg_predictions()`, `avg_comparisons()`, `avg_slopes()`. +#' This function controls the text which is printed to the console when one of the core `marginalefffects` functions is called and the object is returned: `predictions()`, `comparisons()`, `slopes()`, `hypotheses()`, `avg_predictions()`, `avg_comparisons()`, `avg_slopes()`. #' #' All of those functions return standard data frames. Columns can be extracted by name, `predictions(model)$estimate`, and all the usual data manipulation functions work out-of-the-box: `colnames()`, `head()`, `subset()`, `dplyr::filter()`, `dplyr::arrange()`, etc. #' #' Some of the data columns are not printed by default. You can disable pretty printing and print the full results as a standard data frame using the `style` argument or by applying `as.data.frame()` on the object. See examples below. #' -#' @param x An object produced by one of the [`marginaleffects`] package functions. +#' @param x An object produced by one of the `marginaleffects` package functions. #' @param digits The number of digits to display. #' @param p_eps p values smaller than this number are printed in "<0.001" style. #' @param topn The number of rows to be printed from the beginning and end of tables with more than `nrows` rows. @@ -276,6 +276,3 @@ #' @export print.slopes <- print.marginaleffects -#' @noRd -#' @export -print.marginalmeans <- print.marginaleffects diff -Nru r-cran-marginaleffects-0.17.0/R/sanitize_newdata.R r-cran-marginaleffects-0.18.0/R/sanitize_newdata.R --- r-cran-marginaleffects-0.17.0/R/sanitize_newdata.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/R/sanitize_newdata.R 2023-12-24 03:08:04.000000000 +0000 @@ -1,6 +1,6 @@ sanitize_newdata_call <- function(scall, newdata = NULL, model) { if (rlang::quo_is_call(scall)) { - if (rlang::call_name(scall) %in% c("datagrid", "datagridcf", "typical", "counterfactual")) { + if (grepl("^datagrid", rlang::call_name(scall))) { if (!"model" %in% rlang::call_args_names(scall)) { scall <- rlang::call_modify(scall, model = model) } diff -Nru r-cran-marginaleffects-0.17.0/R/sanitize_variables.R r-cran-marginaleffects-0.18.0/R/sanitize_variables.R --- r-cran-marginaleffects-0.17.0/R/sanitize_variables.R 2023-11-17 14:31:24.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/R/sanitize_variables.R 2024-01-24 02:04:41.000000000 +0000 @@ -29,23 +29,29 @@ # mhurdle names the variables weirdly if (inherits(model, "mhurdle")) { predictors <- insight::find_predictors(model, flatten = TRUE) + predictors <- list(conditional = predictors) } else { predictors <- insight::find_variables(model) } - known <- c("fixed", "conditional", "zero_inflated", "scale", "nonlinear") - if (any(known %in% names(predictors))) { - predictors <- unlist(predictors[known], recursive = TRUE, use.names = FALSE) + + # unsupported models like pytorch + if (length(predictors) == 0 || (length(predictors) == 1 && names(predictors) == "response")) { + dv <- hush(unlist(insight::find_response(model, combine = FALSE), use.names = FALSE)) + predictors <- setdiff(hush(colnames(newdata)), c(dv, "rowid")) + } else { + known <- c("fixed", "conditional", "zero_inflated", "scale", "nonlinear") + if (any(known %in% names(predictors))) { + predictors <- predictors[known] # sometimes triggered by multivariate brms models where we get nested # list: predictors$gear$hp - } else { - predictors <- unlist(predictors, recursive = TRUE, use.names = FALSE) - } - # response is not a predictor, but sometimes we catch it - dv <- hush(unlist(insight::find_response(model, combine = FALSE), use.names = FALSE)) - predictors <- unique(setdiff(predictors, dv)) - if (length(predictors) == 0) { # unsupported by insight (e.g., numpyro) - predictors <- setdiff(hush(colnames(newdata)), c(dv, "rowid")) + } else { + predictors <- unlist(predictors, recursive = TRUE, use.names = FALSE) + predictors <- unique(predictors) + } + # flatten + predictors <- unique(unlist(predictors, recursive = TRUE, use.names = FALSE)) } + } else { predictors <- variables } @@ -101,7 +107,7 @@ mc <- attr(newdata, "newdata_matrix_columns") if (length(mc) > 0 && any(names(predictors) %in% mc)) { predictors <- predictors[!names(predictors) %in% mc] - insight::format_warning("Matrix columns are not supported. Use the `variables` argument to specify valid predictors.") + insight::format_warning("Matrix columns are not supported. Use the `variables` argument to specify valid predictors, or use a function like `drop()` to convert your matrix columns into vectors.") } # missing variables @@ -335,10 +341,16 @@ } } - # can't take the slope of an outcome - dv <- hush(insight::find_response(model)) - if (all(names(predictors) %in% dv)) { - insight::format_error("There are no valid predictor variables. Please make sure your model includes predictors and use the `variables` argument.") + # can't take the slope of an outcome, except in weird brms models (issue #1006) + if (!inherits(model, "brmsfit") || !isTRUE(length(model$formula$forms) > 1)) { + dv <- hush(unlist(insight::find_response(model, combine = FALSE), use.names = FALSE)) + # sometimes insight doesn't work + if (length(dv) > 0) { + predictors <- predictors[setdiff(names(predictors), dv)] + } + } + if (length(predictors) == 0) { + insight::format_error("There is no valid predictor variable. Please make sure your model includes predictors and use the `variables` argument.") } # interaction: get_contrasts() assumes there is only one function when interaction=TRUE diff -Nru r-cran-marginaleffects-0.17.0/R/sanity_model.R r-cran-marginaleffects-0.18.0/R/sanity_model.R --- r-cran-marginaleffects-0.17.0/R/sanity_model.R 2023-11-04 18:30:09.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/R/sanity_model.R 2024-01-24 02:27:13.000000000 +0000 @@ -40,6 +40,7 @@ c("brnb", "negbin", "glm"), c("clogit", "coxph"), "clm", + c("clmm2", "clm2"), "coxph", "crch", "fixest", diff -Nru r-cran-marginaleffects-0.17.0/R/set_coef.R r-cran-marginaleffects-0.18.0/R/set_coef.R --- r-cran-marginaleffects-0.17.0/R/set_coef.R 2023-12-09 15:35:29.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/R/set_coef.R 2024-02-05 01:34:54.000000000 +0000 @@ -23,7 +23,10 @@ set_coef.default <- function(model, coefs, ...) { # in basic model classes coefficients are named vector # in ordinal::clm models, there are sometimes duplicates, so name matching doesn't work - flag <- length(model[["coefficients"]]) == length(coefs) && all(names(model[["coefficients"]]) == names(coefs)) + # sometimes names are backticked, others not Issue #1005 + a <- gsub("`", "", names(coefs)) + b <- gsub("`", "", names(model$coefficients)) + flag <- length(model[["coefficients"]]) == length(coefs) && all(a == b) if (flag) { model[["coefficients"]] <- coefs } else { diff -Nru r-cran-marginaleffects-0.17.0/R/slopes.R r-cran-marginaleffects-0.18.0/R/slopes.R --- r-cran-marginaleffects-0.17.0/R/slopes.R 2023-12-09 16:45:45.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/R/slopes.R 2024-01-24 02:57:28.000000000 +0000 @@ -98,7 +98,7 @@ #' `marginaleffects` website). Available arguments can vary from model to #' model, depending on the range of supported arguments by each modeling #' package. See the "Model-Specific Arguments" section of the -#' `?marginaleffects` documentation for a non-exhaustive list of available +#' `?slopes` documentation for a non-exhaustive list of available #' arguments. #' @inheritParams comparisons #' @@ -128,10 +128,8 @@ #' #' See `?print.marginaleffects` for printing options. #' -#' @examplesIf interactive() +#' @examplesIf interactive() || isTRUE(Sys.getenv("R_DOC_BUILD") == "true") #' @examples -#' \dontrun{ -#' #' # Unit-level (conditional) Marginal Effects #' mod <- glm(am ~ hp * wt, data = mtcars, family = binomial) #' mfx <- slopes(mod) @@ -199,7 +197,6 @@ #' newdata = "mean", #' hypothesis = lc) #' -#' } #' @export slopes <- function(model, newdata = NULL, @@ -304,27 +301,6 @@ -#' `marginaleffects()` is an alias to `slopes()` -#' -#' This alias is kept for backward compatibility and because some users may prefer that name. -#' -#' @inherit marginaleffects -#' @keywords internal -#' @export -marginaleffects <- function(...) { - insight::format_warning("This function has been renamed to `slopes()`. The `marginaleffects()` alias will be removed in the near future.") - slopes(...) -} - - -#' `meffects()` is an alias to `slopes()` -#' -#' This alias is kept for backward compatibility and because some users may prefer that name. -#' @inherit marginaleffects -#' @keywords internal -#' @export -meffects <- marginaleffects - #' Average slopes (aka Average partial derivatives, marginal effects, or trends) #' @describeIn slopes Average slopes diff -Nru r-cran-marginaleffects-0.17.0/R/summary.R r-cran-marginaleffects-0.18.0/R/summary.R --- r-cran-marginaleffects-0.17.0/R/summary.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/R/summary.R 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -#' @noRd -#' @export -summary.slopes <- function(object, ...) { - out <- get_averages(object, ...) - return(out) -} - - -#' @noRd -#' @export -summary.predictions <- summary.slopes - - -#' @noRd -#' @export -summary.comparisons <- summary.slopes - - -#' @noRd -#' @export -summary.marginalmeans <- function(object, ...) { - return(object) -} - - -#' @noRd -#' @export -summary.hypotheses <- summary.marginalmeans \ No newline at end of file diff -Nru r-cran-marginaleffects-0.17.0/R/tinytest.R r-cran-marginaleffects-0.18.0/R/tinytest.R --- r-cran-marginaleffects-0.17.0/R/tinytest.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/R/tinytest.R 2024-02-05 01:34:54.000000000 +0000 @@ -70,57 +70,6 @@ -#' `tinytest` helper -#' -#' @export -#' @keywords internal -expect_marginal_means <- function(object, - se = TRUE, - n_row = NULL) { - - insight::check_if_installed("tinytest") - - diff <- "" - - # class - fail_class <- !isTRUE(checkmate::check_class(object, "marginalmeans")) - if (fail_class) { - msg <- sprintf("Wrong class: `%s`.", class(object)[1]) - diff <- c(diff, msg) - } - - # se - if (isTRUE(se) && !"std.error" %in% colnames(object)) { - msg <- "No standard error." - diff <- c(diff, msg) - fail_se <- TRUE - } else { - fail_se <- FALSE - } - - # rows and cols - if (isTRUE(n_row > nrow(object))) { - msg <- sprintf("Number of rows: %s", nrow(object)) - diff <- c(diff, msg) - fail_row <- TRUE - } else { - fail_row <- FALSE - } - - # diff message - diff <- paste(diff, collapse = "\n") - - # pass/fail - fail <- fail_class || fail_se || fail_row - - # tinytest object - out <- tinytest::tinytest( - result = !fail, - call = sys.call(sys.parent(1)), - diff = diff) - - return(out) -} #' `tinytest` helper diff -Nru r-cran-marginaleffects-0.17.0/R/type_dictionary.R r-cran-marginaleffects-0.18.0/R/type_dictionary.R --- r-cran-marginaleffects-0.17.0/R/type_dictionary.R 2023-11-04 18:30:09.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/R/type_dictionary.R 2024-01-15 23:05:58.000000000 +0000 @@ -113,6 +113,11 @@ mhurdle,Ep mhurdle,p mlogit,response +mvgam,response +mvgam,link +mvgam,expected +mvgam,detection +mvgam,latent_N negbin,invlink(link) negbin,response negbin,link diff -Nru r-cran-marginaleffects-0.17.0/R/utils.R r-cran-marginaleffects-0.18.0/R/utils.R --- r-cran-marginaleffects-0.17.0/R/utils.R 2023-10-25 16:43:38.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/R/utils.R 2024-02-05 01:34:54.000000000 +0000 @@ -125,4 +125,24 @@ isTRUE(checkmate::check_integerish( x, null.ok = TRUE, upper = 1, lower = 0, any.missing = FALSE) ) -} \ No newline at end of file +} + + +sub_named_vector <- function(x, y) { + # issue 1005 + xlab <- gsub("^`|`$", "", names(x)) + ylab <- gsub("^`|`$", "", names(y)) + + idx <- match(ylab, xlab) + if (length(stats::na.omit(idx)) > 0) { + x[stats::na.omit(idx)] <- y[!is.na(idx)] + + } else if (length(y) == length(x)) { + return(y) + + } else { + stop("set_coef() substitution error. Please report on Github with a reproducible example: https://github.com/vincentarelbundock/marginaleffects/issues", call. = FALSE) + } + + return(x) +} diff -Nru r-cran-marginaleffects-0.17.0/README.md r-cran-marginaleffects-0.18.0/README.md --- r-cran-marginaleffects-0.17.0/README.md 2023-12-09 15:43:05.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/README.md 2024-02-03 02:05:24.000000000 +0000 @@ -1,21 +1,29 @@ + ![](man/figures/zoo_banner.png) -Parameter estimates are often hard to interpret substantively, -especially when they are generated by complex models with non-linear -components, interactions, or transformations. Instead of reporting -unintuitive parameters, data analysts would rather focus on simple -quantities of interest, which have straightforward scientific -interpretations. Unfortunately, meaningful estimands—and their standard -errors—are often tedious to compute, and the terminology used to -describe them varies tremendously across fields. - -These problems are compounded by the fact that modeling packages produce -objects with very different structures and which hold different -information. This means that end-users often have to write customized -code to interpret the output of different models. This can lead to -wasted effort, confusion, and mistakes, and it can hinder the -implementation of best practices. +
+ + + +

+ +The parameters of a statistical model can sometimes be difficult to +interpret substantively, especially when that model includes non-linear +components, interactions, or transformations. Analysts who fit such +complex models often seek to transform raw parameter estimates into +quantities that are easier for domain experts and stakeholders to +understand, such as predictions, contrasts, risk differences, ratios, +odds, lift, slopes, and so on. + +Unfortunately, computing these quantities—along with associated standard +errors—can be a tedious and error-prone task. This problem is compounded +by the fact that modeling packages in `R` and `Python` produce objects +with varied structures, which hold different information. This means +that end-users often have to write customized code to interpret the +estimates obtained by fitting Linear, GLM, GAM, Bayesian, Mixed Effects, +and other model types. This can lead to wasted effort, confusion, and +mistakes, and it can hinder the implementation of best practices. ## Marginal Effects Zoo: The Book diff -Nru r-cran-marginaleffects-0.17.0/debian/changelog r-cran-marginaleffects-0.18.0/debian/changelog --- r-cran-marginaleffects-0.17.0/debian/changelog 2024-01-12 15:55:52.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/debian/changelog 2024-02-13 14:02:20.000000000 +0000 @@ -1,3 +1,11 @@ +r-cran-marginaleffects (0.18.0-1) unstable; urgency=medium + + * New upstream version + * dh-update-R to update Build-Depends (routine-update) + Set upstream metadata fields: Repository. + + -- Andreas Tille Tue, 13 Feb 2024 15:02:20 +0100 + r-cran-marginaleffects (0.17.0-2) unstable; urgency=medium * Source-only upload. diff -Nru r-cran-marginaleffects-0.17.0/debian/control r-cran-marginaleffects-0.18.0/debian/control --- r-cran-marginaleffects-0.17.0/debian/control 2024-01-12 15:55:52.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/debian/control 2024-02-13 14:02:20.000000000 +0000 @@ -10,7 +10,7 @@ r-cran-checkmate, r-cran-data.table, r-cran-generics, - r-cran-insight (>= 0.19.1), + r-cran-insight (>= 0.19.7), r-cran-rlang, r-cran-rcpp, r-cran-rcppeigen diff -Nru r-cran-marginaleffects-0.17.0/debian/upstream/metadata r-cran-marginaleffects-0.18.0/debian/upstream/metadata --- r-cran-marginaleffects-0.17.0/debian/upstream/metadata 2024-01-12 15:55:52.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/debian/upstream/metadata 2024-02-13 14:02:20.000000000 +0000 @@ -5,4 +5,5 @@ - Name: conda:conda-forge Entry: r-marginaleffects +Repository: https://github.com/vincentarelbundock/marginaleffects.git Repository-Browse: https://github.com/vincentarelbundock/marginaleffects diff -Nru r-cran-marginaleffects-0.17.0/inst/WORDLIST r-cran-marginaleffects-0.18.0/inst/WORDLIST --- r-cran-marginaleffects-0.17.0/inst/WORDLIST 2023-12-09 15:35:29.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/WORDLIST 2023-12-24 03:08:04.000000000 +0000 @@ -245,6 +245,7 @@ threenum Tibshirani tidiers +timpipeseek TLDR Tomz TOST diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/_tinysnapshot/plot_predictions-alpha.svg r-cran-marginaleffects-0.18.0/inst/tinytest/_tinysnapshot/plot_predictions-alpha.svg --- r-cran-marginaleffects-0.17.0/inst/tinytest/_tinysnapshot/plot_predictions-alpha.svg 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/_tinysnapshot/plot_predictions-alpha.svg 2023-12-24 03:08:04.000000000 +0000 @@ -30,62 +30,62 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + -10 -20 -30 - - - +10 +20 +30 + + + diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/_tinysnapshot/plot_predictions-gray.svg r-cran-marginaleffects-0.18.0/inst/tinytest/_tinysnapshot/plot_predictions-gray.svg --- r-cran-marginaleffects-0.17.0/inst/tinytest/_tinysnapshot/plot_predictions-gray.svg 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/_tinysnapshot/plot_predictions-gray.svg 2023-12-24 03:08:04.000000000 +0000 @@ -30,42 +30,44 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + -0 -10 -20 -30 - - - - +0 +10 +20 +30 +40 + + + + + diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/_tinysnapshot/plot_predictions.svg r-cran-marginaleffects-0.18.0/inst/tinytest/_tinysnapshot/plot_predictions.svg --- r-cran-marginaleffects-0.17.0/inst/tinytest/_tinysnapshot/plot_predictions.svg 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/_tinysnapshot/plot_predictions.svg 2023-12-24 03:08:04.000000000 +0000 @@ -30,42 +30,44 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + -0 -10 -20 -30 - - - - +0 +10 +20 +30 +40 + + + + + diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/_tinysnapshot/plot_predictions_conf_40.svg r-cran-marginaleffects-0.18.0/inst/tinytest/_tinysnapshot/plot_predictions_conf_40.svg --- r-cran-marginaleffects-0.17.0/inst/tinytest/_tinysnapshot/plot_predictions_conf_40.svg 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/_tinysnapshot/plot_predictions_conf_40.svg 2023-12-24 03:08:04.000000000 +0000 @@ -24,37 +24,35 @@ - - + + - - - - - - - - + + + + + + + + -12.5 -15.0 -17.5 -20.0 -22.5 - - - - - - - - -100 -200 -300 -hp +12 +16 +20 +24 + + + + + + + +100 +200 +300 +hp mpg diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/_tinysnapshot/plot_predictions_conf_99.svg r-cran-marginaleffects-0.18.0/inst/tinytest/_tinysnapshot/plot_predictions_conf_99.svg --- r-cran-marginaleffects-0.17.0/inst/tinytest/_tinysnapshot/plot_predictions_conf_99.svg 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/_tinysnapshot/plot_predictions_conf_99.svg 2023-12-24 03:08:04.000000000 +0000 @@ -30,22 +30,24 @@ - - - - - + + + + + -10 -15 -20 -25 - - - - +5 +10 +15 +20 +25 + + + + + diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/_tinysnapshot/plot_slopes_continuous.svg r-cran-marginaleffects-0.18.0/inst/tinytest/_tinysnapshot/plot_slopes_continuous.svg --- r-cran-marginaleffects-0.17.0/inst/tinytest/_tinysnapshot/plot_slopes_continuous.svg 2023-11-06 17:03:37.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/_tinysnapshot/plot_slopes_continuous.svg 2024-01-24 02:04:51.000000000 +0000 @@ -30,24 +30,24 @@ - - - - - + + + + + --0.2 --0.1 -0.0 -0.1 -0.2 - - - - - +-0.2 +-0.1 +0.0 +0.1 +0.2 + + + + + diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/_tinysnapshot/plot_slopes_two_conditions.svg r-cran-marginaleffects-0.18.0/inst/tinytest/_tinysnapshot/plot_slopes_two_conditions.svg --- r-cran-marginaleffects-0.17.0/inst/tinytest/_tinysnapshot/plot_slopes_two_conditions.svg 2023-11-06 17:03:37.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/_tinysnapshot/plot_slopes_two_conditions.svg 2024-01-24 02:04:51.000000000 +0000 @@ -30,31 +30,31 @@ - - - - - - - - - - + + + + + + + + + + --0.15 --0.10 --0.05 -0.00 -0.05 -0.10 - - - - - - +-0.15 +-0.10 +-0.05 +0.00 +0.05 +0.10 + + + + + + diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/helpers.R r-cran-marginaleffects-0.18.0/inst/tinytest/helpers.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/helpers.R 2023-10-20 14:12:01.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/helpers.R 2024-02-05 01:34:54.000000000 +0000 @@ -27,7 +27,7 @@ if (isTRUE(suppressMessages(require("tinytest"))) && packageVersion("tinytest") >= "1.4.0") { tinytest::register_tinytest_extension( "marginaleffects", - c("expect_slopes", "expect_predictions", "expect_margins", "expect_marginal_means")) + c("expect_slopes", "expect_predictions", "expect_margins")) } # common names of datasets, often assigned to global environment diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/clean.R r-cran-marginaleffects-0.18.0/inst/tinytest/stata/clean.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/clean.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/clean.R 1970-01-01 00:00:00.000000000 +0000 @@ -1,185 +0,0 @@ -library(haven) -library(ivreg) -library(betareg) -library(MASS) -library(data.table) -library(readxl) - -results <- list() - -get_stata <- function(name, n) { - sprintf(here::here("inst/tinytest/stata/results/%s.txt"), name) |> - read.table(sep = "\t", skip = 4) |> - setNames(c("term", "dydxstata", "std.errorstata")) |> - head(n) |> - transform(dydxstata = as.numeric(dydxstata), - std.errorstata = as.numeric(std.errorstata)) -} - - -# stats::glm -tmp <- read.table(here::here("inst/tinytest/stata/results/stats_glm_01.txt"), sep = "\t", skip = 4) |> - setNames(c("term", "dydxstata", "std.errorstata")) |> - head(2) -results[["stats_glm_01"]] <- tmp - -# stats::lm -tmp <- read.table(here::here("inst/tinytest/stata/results/stats_lm_01.txt"), sep = "\t", skip = 4) |> - setNames(c("term", "dydxstata", "std.errorstata")) |> - head(2) -results[["stats_lm_01"]] <- tmp - -# survival::coxph -tmp <- read.table(here::here("inst/tinytest/stata/results/survival_coxph_01.txt"), sep = "\t", skip = 4) |> - setNames(c("term", "dydxstata", "std.errorstata")) |> - head(1) -results[["survival_coxph_01"]] <- tmp - -# truncreg::truncreg -tmp <- read.table(here::here("inst/tinytest/stata/results/truncreg_truncreg_01.txt"), sep = "\t", skip = 4) |> - setNames(c("term", "dydxstata", "std.errorstata")) |> - head(2) -results[["truncreg_truncreg_01"]] <- tmp - -# quantreg::rq -tmp <- read.table(here::here("inst/tinytest/stata/results/quantreg_rq_01.txt"), sep = "\t", skip = 4) |> - setNames(c("term", "dydxstata", "std.errorstata")) |> - head(4) -results[["quantreg_rq_01"]] <- tmp - -# pscl::zeroinfl -tmp <- read.table(here::here("inst/tinytest/stata/results/pscl_zeroinfl_01.txt"), sep = "\t", skip = 4) |> - setNames(c("term", "dydxstata", "std.errorstata")) |> - head(3) -results[["pscl_zeroinfl_01"]] <- tmp - -# MASS::polr -tmp <- read.table(here::here("inst/tinytest/stata/results/MASS_polr_01.txt"), sep = "\t", skip = 4) |> - setNames(c("group", "dydxstata_x1", "std.errorstata_x1", "dydxstata_x2", "std.errorstata_x2")) |> - head(3) |> - transform(group = 2:4) |> - data.table() -cols <- names(tmp) -tmp[, (cols) := lapply(.SD, as.numeric)] -tmp <- melt(tmp, id.vars = "group") -tmp[, c("statistic", "term") := tstrsplit(variable, "_")] -tmp[, variable := NULL] -tmp <- dcast(tmp, group + term ~ statistic, value.var = "value") -results[["MASS_polr_01"]] <- tmp - -# nnet::multinom -tmp <- read.table(here::here("inst/tinytest/stata/results/nnet_multinom_01.txt"), sep = "\t", skip = 4) |> - setNames(c("group", "dydxstata_x1", "std.errorstata_x1", "dydxstata_x2", "std.errorstata_x2")) |> - head(3) |> - transform(group = 2:4) |> - data.table() -cols <- names(tmp) -tmp[, (cols) := lapply(.SD, as.numeric)] -tmp <- melt(tmp, id.vars = "group") -tmp[, c("statistic", "term") := tstrsplit(variable, "_")] -tmp[, variable := NULL] -tmp <- dcast(tmp, group + term ~ statistic, value.var = "value") -results[["nnet_multinom_01"]] <- tmp - -# ivreg::ivreg -tmp <- read.table(here::here("inst/tinytest/stata/results/ivreg_ivreg_01.txt"), sep = "\t", skip = 4) |> - setNames(c("term", "dydxstata", "std.errorstata")) |> - head(2) -results[["ivreg_ivreg_01"]] <- tmp - -# betareg::betareg -tmp <- read.table(here::here("inst/tinytest/stata/results/betareg_betareg_01.txt"), sep = "\t", skip = 4) |> - setNames(c("term", "dydxstata", "std.errorstata")) |> - head(1) -results[["betareg_betareg_01"]] <- tmp - -# MASS::glm.nb -tmp <- read.table(here::here("inst/tinytest/stata/results/MASS_glm_nb.txt"), sep = "\t", skip = 4) |> - setNames(c("term", "dydxstata", "std.errorstata")) |> - head(3) -tmp$term <- gsub("\\.cyl", "", tmp$term) -tmp$term[2:3] <- paste0("factor(cyl)", tmp$term)[2:3] -results[["mass_glm_nb"]] <- tmp - -# AER::tobit -tmp <- read.table(here::here("inst/tinytest/stata/results/AER_tobit.txt"), sep = "\t", skip = 4) |> - setNames(c("term", "dydxstata", "std.errorstata")) |> - head(5) -results[["aer_tobit"]] <- tmp - -# AER::tobit (right-censured) -tmp <- read.table(here::here("inst/tinytest/stata/results/AER_tobit_right4.txt"), sep = "\t", skip = 4) |> - setNames(c("term", "dydxstata", "std.errorstata")) |> - head(5) -results[["aer_tobit_right"]] <- tmp - -# estimatr::lm_robust -tmp <- read.table(here::here("inst/tinytest/stata/results/estimatr_lm_robust.txt"), sep = "\t", skip = 4) |> - setNames(c("term", "dydxstata", "std.errorstata")) |> - head(3) -results[["estimatr_lm_robust"]] <- tmp - -# estimatr::iv_robust -tmp <- read.table(here::here("inst/tinytest/stata/results/estimatr_iv_robust.txt"), sep = "\t", skip = 4) |> - setNames(c("term", "dydxstata", "std.errorstata")) |> - head(2) -tmp$std.errorstata <- as.numeric(gsub("\\(|\\)", "", tmp$std.errorstata)) -results[["estimatr_iv_robust"]] <- tmp - - -# fixest::feols -tmp <- read.table(here::here("inst/tinytest/stata/results/fixest_feols_01.txt"), sep = "\t", skip = 4) |> - head(2) |> - setNames(c("term", "dydxstata", "std.errorstata")) -tmp$dydxstata <- as.numeric(tmp$dydxstata) -results[["fixest_feols"]] <- tmp - - -# fixest::fepois -tmp <- read.table(here::here("inst/tinytest/stata/results/fixest_fepois_01.txt"), sep = "\t", skip = 4) |> - head(2) |> - setNames(c("term", "dydxstata", "std.errorstata")) -tmp$dydxstata <- as.numeric(tmp$dydxstata) -results[["fixest_fepois"]] <- tmp - -# plm -tmp <- read.table(here::here("inst/tinytest/stata/results/plm_pooling_01.txt"), sep = "\t", skip = 4) |> - head(2) |> - setNames(c("term", "dydxstata", "std.errorstata")) -tmp$dydxstata <- as.numeric(tmp$dydxstata) -results[["plm_pooling"]] <- tmp - -tmp <- read.table(here::here("inst/tinytest/stata/results/plm_sa_01.txt"), sep = "\t", skip = 4) |> - head(2) |> - setNames(c("term", "dydxstata", "std.errorstata")) -tmp$dydxstata <- as.numeric(tmp$dydxstata) -results[["plm_sa"]] <- tmp - - - -# lme4: -tmp <- read.table(here::here("inst/tinytest/stata/results/lme4_01.txt"), sep = "\t", skip = 4) |> - head(2) |> - setNames(c("term", "dydxstata", "std.errorstata")) -tmp$dydxstata <- as.numeric(tmp$dydxstata) -results[["lme4_lmer"]] <- tmp - -# lme4: -tmp <- read.table(here::here("inst/tinytest/stata/results/lme4_02.txt"), sep = "\t", skip = 4) |> - head(2) |> - setNames(c("term", "dydxstata", "std.errorstata")) -tmp$dydxstata <- as.numeric(tmp$dydxstata) -results[["lme4_glmer"]] <- tmp - -# elasticity -results[["stats_lm_elasticity_eyex"]] <- get_stata("stats_lm_elasticity_eyex", 2) -results[["stats_lm_elasticity_dyex"]] <- get_stata("stats_lm_elasticity_dyex", 2) -results[["stats_lm_elasticity_eydx"]] <- get_stata("stats_lm_elasticity_eydx", 2) - -results[["stats_glm_elasticity_eyex"]] <- get_stata("stats_glm_elasticity_eyex", 2) -results[["stats_glm_elasticity_dyex"]] <- get_stata("stats_glm_elasticity_dyex", 2) -results[["stats_glm_elasticity_eydx"]] <- get_stata("stats_glm_elasticity_eydx", 2) - -# save -saveRDS(results, file = here::here("inst/tinytest/stata/stata.rds")) - diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/databases/MASS_polr_01.csv r-cran-marginaleffects-0.18.0/inst/tinytest/stata/databases/MASS_polr_01.csv --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/databases/MASS_polr_01.csv 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/databases/MASS_polr_01.csv 1970-01-01 00:00:00.000000000 +0000 @@ -1,1001 +0,0 @@ -"","x1","x2","y" -"1",-0.778662882315158,-0.821763765919608,2 -"2",-0.389476395994671,-0.112414630494009,2 -"3",-2.03379832900752,0.203047289574292,1 -"4",-0.98237310428081,-0.899339840984389,2 -"5",0.24789005396548,-0.545537423086653,2 -"6",-2.10386462868389,1.05542625221685,1 -"7",-0.381418049114699,-0.000970332870110479,2 -"8",2.0749198375246,-0.0254832690454242,3 -"9",1.02713840744203,1.16911680038037,3 -"10",0.473014227994331,0.342427306810894,2 -"11",-1.87926319306776,-0.632030392792663,2 -"12",-1.23918902637838,-0.517113494160896,2 -"13",1.16041860179808,0.107674186685467,3 -"14",0.00367129095339639,-1.22038275127464,2 -"15",-0.0954520660716631,-0.205296342831117,2 -"16",1.79555122839724,-1.1885595755051,2 -"17",-1.32213848090178,0.985778720825328,2 -"18",-0.276086413135047,-0.826866396853847,2 -"19",-0.743976509928317,0.47766147577938,2 -"20",-1.07005012512571,-0.895663487899961,2 -"21",-0.349525473522315,-0.494808768622646,2 -"22",0.8055596608276,-0.932930187624113,2 -"23",1.60530166025953,-0.764943064958773,2 -"24",1.44759575420154,-0.230166582786849,2 -"25",-0.128302224183544,0.343336334605884,3 -"26",-0.5389264468092,-2.11542609572049,2 -"27",0.391586049634991,0.557201538623796,2 -"28",0.879217022827969,1.5065654400341,3 -"29",-0.824732092123366,0.398820946466168,2 -"30",0.732876423315893,-1.43937734074074,2 -"31",-0.664914509804808,-0.509766611909026,2 -"32",0.360885549170716,0.253277300460576,2 -"33",1.01193095703027,-0.235897423762985,2 -"34",-0.235916847667766,2.16914282196854,2 -"35",1.35358989309039,-1.10890103556334,2 -"36",-0.26863296454849,-0.504195188563122,2 -"37",1.0198773683856,2.12957324546402,3 -"38",-0.279706499729985,-0.197303641223426,2 -"39",-0.61814627835718,-0.860597034962334,2 -"40",-0.499273059382934,1.56220391705361,2 -"41",-0.153716776819,1.01405993487863,2 -"42",1.22086969447182,0.645895076694223,3 -"43",-0.669570510350228,-1.10252111082235,2 -"44",-1.20966034237399,-0.826544770872034,2 -"45",1.02409665487927,1.25649843978807,3 -"46",0.603955311488397,1.50092032195651,3 -"47",-0.568653469322032,0.000666998465102122,2 -"48",-0.891303116590239,-0.880142524357222,2 -"49",-2.52514569224268,-2.51931341112456,3 -"50",0.589357049230505,-0.00738594164671853,3 -"51",-0.653197720907169,-0.0888515585205597,2 -"52",-0.661202450558244,-0.895437896006437,2 -"53",1.47239097936137,-1.43750709605882,2 -"54",0.555527936163091,-1.01395838644301,2 -"55",-0.404499203788117,0.226887778624378,2 -"56",-0.40325427755792,-0.063151990234333,2 -"57",-0.274613706421661,-0.892119442568123,2 -"58",-0.214753327971505,1.84041577577878,3 -"59",-1.10776353254331,-0.189272283164837,1 -"60",-0.288105760866942,2.16860260167573,3 -"61",-0.128353900270885,0.582000712409743,2 -"62",-0.410252135168874,-1.06582821197148,2 -"63",-1.53549327306741,0.0259828113493124,2 -"64",0.0910665493425969,0.46337556350463,2 -"65",0.999939041073546,0.562161324892267,3 -"66",-0.584198981242738,0.177507218930566,2 -"67",-0.537551851622726,1.271181317378,2 -"68",2.53780305805831,0.145397175880351,3 -"69",0.523437911520408,-0.612678713025022,2 -"70",0.122860178305925,0.338646126512125,2 -"71",-0.145532668438184,-0.282024165942082,2 -"72",-0.0161885005048631,0.543043618857391,3 -"73",1.95260529097045,0.862501583049216,3 -"74",0.236512168023379,-0.275951175693269,2 -"75",-0.19148060596561,-0.447400526033559,2 -"76",0.682746936293101,-0.79189735159117,2 -"77",-0.709136159493205,0.64311922908144,2 -"78",0.296700066170208,-1.87300993609173,2 -"79",0.138082422173348,-0.773620397471361,2 -"80",-0.776498101972313,-1.13856900241836,2 -"81",0.619185644318058,0.881983547903861,3 -"82",1.090561796584,-1.2168666207799,2 -"83",-1.13979505394065,-0.296096907670778,2 -"84",-0.484360085171958,-0.587759576581027,3 -"85",-1.61326266169757,-0.921260572455329,2 -"86",0.57886911502236,1.00849294982214,3 -"87",0.101392523591792,0.282645813175638,2 -"88",-0.239313538467,-0.723269636510722,2 -"89",0.390178689548306,-0.0395830103808312,2 -"90",0.976457026120621,-0.981988163879284,2 -"91",0.179160920551552,0.439172221732656,2 -"92",-1.39694348661244,0.635155366511218,2 -"93",-1.28662271443852,-2.87074888952726,2 -"94",1.88604475381625,-0.538597099163435,2 -"95",-0.356995059940192,1.64320831323608,2 -"96",0.685259697938012,-0.0819985569483218,2 -"97",0.409335335611831,1.37906838637498,3 -"98",1.44144797948714,-0.445865595918116,3 -"99",-0.0286612567452046,-0.488129158432901,3 -"100",-0.43673305217259,0.298525182960541,2 -"101",-0.202030536231507,0.739552586897595,2 -"102",-0.4642161091742,-1.24868057353553,2 -"103",-0.506149886100606,-1.53462773212403,2 -"104",1.52132525123901,-0.511864093619648,2 -"105",0.400900287702186,-0.65620940381304,3 -"106",0.322050953432231,-0.794629120276673,2 -"107",-2.17045728206746,-2.64999939431659,3 -"108",-0.526502063786925,-0.829046744218432,2 -"109",-1.42700632032016,0.840007181675812,1 -"110",0.215813367627617,1.84961332775431,3 -"111",0.617343490333244,-0.230899025682867,2 -"112",0.000215456524867078,0.666448591861969,2 -"113",-3.33051527361684,0.623078882543703,1 -"114",1.76803375536927,0.513387154574217,3 -"115",1.34161389601703,0.0300704604649434,2 -"116",-0.587775364493114,-0.434686714407421,2 -"117",-0.792448885753515,-0.417911555728596,2 -"118",-0.673002643139923,1.65669504263755,2 -"119",-2.00696943552075,0.327667259987275,1 -"120",-1.18923370357108,-1.56993017502034,2 -"121",-0.634576389076701,0.380326774743709,2 -"122",1.17320987144636,-0.0964904189708176,2 -"123",1.62816862385047,-3.04540188444662,1 -"124",-0.107148237356947,-1.16496328141184,2 -"125",2.24328913114731,0.33755914009297,3 -"126",0.433265765636371,1.38518869678797,3 -"127",0.149319609621561,-0.170986386390743,3 -"128",-0.923589673140757,-0.0149456618633856,2 -"129",0.908212938775237,1.05957510696306,3 -"130",-1.01913201320175,0.11689624192241,2 -"131",-0.413162453112035,-0.0157708954031432,2 -"132",-0.644150942537356,0.837618957000217,2 -"133",-0.119113530291335,0.687119436366597,2 -"134",-1.56671274945802,0.739914606394229,1 -"135",0.248797752726242,0.282227744245668,3 -"136",-1.87318208649165,-0.765515372432108,2 -"137",1.02930889584371,0.085498378991871,3 -"138",-1.81377700865334,0.745180694282767,1 -"139",-1.21890414451281,-1.01732601698317,2 -"140",0.101659715322984,1.56232401202031,3 -"141",-1.48252050458786,-1.082544056642,2 -"142",0.520505243380355,-0.581736602657165,2 -"143",0.51965007323974,0.578733374085025,2 -"144",-0.354081952476422,-0.175549788212122,2 -"145",-0.104605577111384,1.10954025427728,3 -"146",-0.217953983879542,0.400917804186556,2 -"147",-1.07586995287838,-0.333523687892511,2 -"148",-1.21141408068435,-1.67567897788754,2 -"149",-0.861479231583593,1.54578180092702,2 -"150",-0.981833037124269,0.348740027225072,2 -"151",1.70253017917675,0.332919929592649,3 -"152",-0.612301413496714,0.553730636544625,2 -"153",0.770904477239149,0.125934463310778,3 -"154",-1.4963834996248,1.16089071520869,2 -"155",0.426173305463845,1.36084227703027,3 -"156",0.506520589609078,-0.749004998877769,2 -"157",-0.402254445861418,-0.121100224638262,2 -"158",-1.52164280824141,0.0857292618623114,2 -"159",0.318632549854711,0.340043795445834,3 -"160",-0.845578215171646,-1.13232075953528,2 -"161",1.42536917512663,-0.358695947541251,2 -"162",0.113438114298031,1.46788787557197,3 -"163",-1.66029276763543,-0.321837878119368,2 -"164",-0.635260026663986,0.218417782119726,2 -"165",0.407892399260653,1.47326859936386,3 -"166",0.393642402410984,0.598713629762105,3 -"167",0.938967821669026,-0.186922061068738,2 -"168",-0.812029379617591,-0.529963044677585,2 -"169",1.47162497824168,-0.551407882670509,2 -"170",2.76398904835723,0.881168764819008,4 -"171",-0.525242416865056,-1.67885854380206,2 -"172",0.623358667982617,1.63808530772157,3 -"173",0.3206507377008,0.246222690802417,3 -"174",0.60264543902644,0.528229593728524,3 -"175",0.864699041599908,-0.280875739143049,2 -"176",-0.250680655993702,0.0018577793857119,2 -"177",0.27561580307981,-1.08193318757053,2 -"178",-0.626474395993982,-1.5585099152408,2 -"179",0.747592561125489,0.109713964555858,2 -"180",1.55617297045723,-0.0533614572357878,3 -"181",2.37559841859215,-1.14136494001348,2 -"182",0.432128866470571,-1.61585526603988,2 -"183",0.251647216249616,1.28578669527186,3 -"184",0.618183189854304,0.860901041458128,3 -"185",-2.98954999873783,0.851668972812747,1 -"186",-0.936377582862676,-0.57767996404706,2 -"187",-0.46643226091757,1.21318701380942,2 -"188",-1.45800854647517,-1.23613063429736,2 -"189",0.858649183062411,-0.417221975976014,2 -"190",0.488378517199767,-0.888739128990458,2 -"191",0.450449596353791,1.04115935830616,2 -"192",1.00503889060621,-0.472940050205381,2 -"193",0.0252720003705792,0.324229315402579,2 -"194",0.927532071690324,0.0145700802115937,3 -"195",1.07692551017613,-2.50214622640895,1 -"196",-0.529475025728339,-0.529621065791162,2 -"197",-0.127071570693339,1.54503631348764,3 -"198",-0.432626228905172,0.397032083998406,2 -"199",0.0717762297506202,0.192350819914209,2 -"200",-2.21048541990544,0.267878899088242,2 -"201",1.45589015709214,-1.11382300522776,2 -"202",-1.33330782601085,0.283455411524231,2 -"203",0.585184780554489,1.55103903163727,3 -"204",0.219826559853572,-1.33820417585332,2 -"205",-1.20162417490982,0.653367207490122,2 -"206",-0.658923457155579,0.653586746056276,3 -"207",-0.283547523495872,-0.158111546321633,2 -"208",-0.506610634681369,-0.0198840038200355,2 -"209",-0.65060671085628,-0.170822519367757,2 -"210",-1.90926103946984,-0.215230509330014,2 -"211",-0.193024413599919,-0.0862979832470208,3 -"212",-0.657789843839456,-0.738263178300426,2 -"213",-0.562508743159869,-1.2350240791275,2 -"214",-0.307606692030078,0.915271446240001,3 -"215",0.797007385204724,-1.33827709567146,2 -"216",-1.26852642934111,-1.43126931709628,2 -"217",1.59003291144473,2.69801779843062,4 -"218",-0.239162324884694,-0.419988732609617,2 -"219",0.306146117040677,-1.90800296816053,2 -"220",-2.82952996381451,0.425141453171131,1 -"221",-0.407890744975198,0.592644788343994,3 -"222",-1.23526673551268,0.00409544482573077,2 -"223",-1.11005342531247,-1.0632733552996,2 -"224",0.555448681049129,-0.576449191732296,2 -"225",-1.01869886310815,0.983181590529458,2 -"226",0.0227813153000504,0.0255682651473158,2 -"227",-1.31326760508005,-0.223558187886129,2 -"228",0.378292394300563,0.700466819144318,3 -"229",0.38766601887839,0.777293021480817,3 -"230",0.362271155549616,0.317398674853668,2 -"231",0.77701820311675,-0.821957965273003,2 -"232",-0.115982600392705,-0.213470785148272,2 -"233",0.528274069891124,-0.164811453050937,2 -"234",-0.70225643471866,1.1087114144447,2 -"235",0.705744123672494,0.462691794540491,3 -"236",0.27324481592634,1.00018385761806,3 -"237",-2.44986908086446,1.05380112711312,1 -"238",0.887982609141164,0.585572812530208,2 -"239",0.756244836306627,0.125261241066786,2 -"240",1.16503427032462,1.18146660525952,3 -"241",-0.801246676891149,0.433344796386658,2 -"242",0.78208633141738,1.15337965432169,3 -"243",-0.229086053782735,1.6780635249057,3 -"244",-0.947411498162179,-0.884964663637748,1 -"245",2.74513187003413,-1.44840095746284,2 -"246",-0.0672180919747193,0.441010101023576,3 -"247",1.61434565324273,-0.0150538399980248,3 -"248",-0.609006692266319,0.558882538949894,3 -"249",0.345255645806633,-0.86588891881631,2 -"250",0.335556608130169,-0.9555916417832,2 -"251",-0.0353568337281219,1.29817117241151,2 -"252",1.69654683325744,-1.62566096434758,2 -"253",-0.592046573526372,1.3482673488017,2 -"254",-2.22450516515894,-0.725858512216694,2 -"255",-0.310175745650351,-1.75822522847988,2 -"256",1.28946620308571,-1.75307054660062,1 -"257",-1.66450447349055,-1.86674249227783,2 -"258",0.866050052401549,1.48970184433685,3 -"259",0.580154148220369,1.49002377489796,3 -"260",-1.15996492372227,0.0760822315199553,2 -"261",-1.4135490212867,0.598501026661244,2 -"262",1.44908972591402,-0.809364572164417,2 -"263",0.550652506096172,-1.30781381831632,2 -"264",-0.000381354593243598,0.0981108376786251,3 -"265",-0.223688531137314,1.52328171887439,2 -"266",0.0864283593319198,-1.22460843169713,2 -"267",2.73046635098785,-0.16731496458152,3 -"268",1.1090271886914,-0.185130490321572,3 -"269",-0.187438237403035,-1.11197634397539,2 -"270",0.864439033227915,-1.38846747503899,2 -"271",0.914180585874431,-1.59261580943547,2 -"272",-0.869367184686422,-2.15997523174827,2 -"273",1.39679342809022,-0.431920952797845,2 -"274",-0.488223949579367,-0.407611274416912,2 -"275",1.2774222801648,0.556615349847067,3 -"276",0.275323899540435,1.24037481993386,3 -"277",-0.439494097949117,-1.65211682470615,3 -"278",0.511242654594633,-0.538319159722425,2 -"279",-0.0133304082289264,-1.15511875212006,2 -"280",-0.496381459586184,-0.584948901366027,2 -"281",-0.943905078093567,-0.282180476884172,2 -"282",-0.360463647678627,0.477566345534474,3 -"283",-0.355892762129758,-0.511713568835265,2 -"284",-1.40935634303394,-2.02490925935563,2 -"285",0.548406405219068,-0.919546733143711,2 -"286",0.664259937761144,-0.562594187625465,2 -"287",1.1484296237298,0.0687151674498556,3 -"288",-0.131982802386373,1.46642693862034,3 -"289",0.529085890054213,0.527161321046996,3 -"290",0.0834730100267859,-1.2379292028033,2 -"291",0.693649991552134,1.47265444442123,3 -"292",-1.52981483923141,-1.37528827095086,2 -"293",-0.257241301267302,0.759706020460509,3 -"294",-0.752695124043647,-0.856157331846675,2 -"295",-0.208211155027271,0.00458964982979717,2 -"296",1.02080762523956,-0.378607327498318,2 -"297",0.512869966250792,1.13711415005677,3 -"298",-1.30137933169705,-1.35857658476835,2 -"299",0.462317981189377,0.839573811344507,3 -"300",1.61723126699447,-0.110299896850166,3 -"301",0.527622026363768,1.93738916178446,3 -"302",-0.989574829378576,-0.212267296712533,2 -"303",-1.79368611715366,0.597953715317227,2 -"304",-0.113139770971905,2.30997083650405,2 -"305",0.139198178579192,-0.216997315502666,2 -"306",-1.43378005468625,0.25617934864418,2 -"307",0.281844984626276,1.17191101415091,3 -"308",0.991804217657327,-0.343110755731505,3 -"309",-1.50217393351827,0.811720558915575,2 -"310",-0.736120709821281,0.961161273674919,2 -"311",1.00273877411346,-0.165073607329177,2 -"312",0.627464414979069,0.382024782926287,3 -"313",-0.648166394819188,1.3793395881144,3 -"314",-1.21832024033578,-0.149021327275232,2 -"315",0.665777482649052,-0.986344356377205,2 -"316",0.949085135970289,0.768480674955537,3 -"317",1.19285015844731,0.166130826457766,3 -"318",0.567487182762954,0.0890155926663752,3 -"319",0.354952158713781,0.990865517569636,3 -"320",-0.563368442916638,-1.48380193773918,2 -"321",0.80748620334544,-0.946009175976642,2 -"322",0.805772221879847,-0.646416736792736,2 -"323",1.01624711966414,0.685110747220849,3 -"324",0.328444099070125,-0.918692608604216,2 -"325",-0.518241711924565,-0.801677230754172,2 -"326",-1.59050950888449,-0.848831910725255,2 -"327",-0.295515062496251,1.9331639520952,3 -"328",-1.00544322857019,-0.430369237740307,2 -"329",-1.20297643877351,1.89825769208662,2 -"330",0.0213018390738087,-1.08369898433487,2 -"331",2.12425195362803,-0.485176807627352,3 -"332",-0.734453028560038,-0.904390659728007,3 -"333",-0.738593585161585,0.597466717213841,2 -"334",0.256704523097346,-0.754359996252216,2 -"335",-1.25387980063062,-0.828941752058956,2 -"336",-0.809645317412326,-1.7423905805246,2 -"337",-0.324254408437198,-1.13399104785774,1 -"338",-0.435726619730485,0.383690605560142,2 -"339",0.668080432308133,-1.43980745725908,2 -"340",-0.210242541851873,-0.779287154412264,2 -"341",-0.413900327301294,2.11343577831819,2 -"342",2.16742820416279,1.0501713794481,3 -"343",-0.0891334340433657,0.292497117095824,2 -"344",0.297396012311165,0.565077225321086,2 -"345",-2.25736526189196,1.61601083574075,1 -"346",0.858432986599026,-0.849927171787254,2 -"347",0.722828983375002,-0.0541732830086925,3 -"348",-0.680158947327035,0.888413355070859,2 -"349",1.39929915548555,1.04068866283977,3 -"350",-0.212957098711349,-0.504594573408255,2 -"351",1.41076416329637,-1.2674229152147,2 -"352",0.516238174049297,0.153627665221627,2 -"353",-1.19752132424905,0.926574145383066,2 -"354",-0.627404438631094,-1.11661350328703,2 -"355",0.204599995100945,-0.184913374845365,2 -"356",-2.2838675275714,1.46505826283152,1 -"357",1.09610855516093,0.69986301133628,3 -"358",0.574492638490543,0.452902337231445,3 -"359",-1.10700924790858,-0.732099622181591,2 -"360",0.0865993129891947,-0.897486909870685,3 -"361",1.08504088814865,0.0676012376286,3 -"362",-0.768341269443185,0.340601679393273,3 -"363",1.57883741538097,-0.458287953093124,2 -"364",2.01630292044563,0.0489755328540765,3 -"365",0.091714671642784,-0.945769904015874,2 -"366",-1.00867099278225,0.108822266679475,2 -"367",-0.403615247558847,0.505310508553114,2 -"368",1.31326998390506,-1.47100662227239,2 -"369",-0.669263457386315,0.538746632221266,2 -"370",0.430326991687063,0.628275915401739,2 -"371",0.0718331420841894,-0.574773288783181,2 -"372",-0.507223032480274,-0.072074057830991,2 -"373",-0.553247741873631,-2.03793771491985,2 -"374",0.663898648246702,0.315569211030175,3 -"375",0.193722562487217,0.32909273924725,2 -"376",0.564418562415695,1.56552222664692,3 -"377",-2.12645652421679,1.43609854322817,1 -"378",0.876169578104667,0.723077168567295,3 -"379",-0.185362714172563,-0.333276770864238,2 -"380",0.135816310759156,0.892431546724513,3 -"381",2.21425744972552,0.118103900511844,3 -"382",-0.991705073030258,0.594021030966335,2 -"383",0.579781273928898,-0.94725060136016,3 -"384",2.35874162540294,-1.63001004945368,2 -"385",-1.42989015626551,0.0883094275762383,1 -"386",-1.25271610463425,1.16562436815775,2 -"387",-0.706233973416408,0.045493495147319,2 -"388",0.634608282180412,-1.54014135951435,2 -"389",1.23547154304423,-0.225740243359048,2 -"390",0.528661817408422,0.498442350895543,3 -"391",0.84442705435786,-0.586499507744158,2 -"392",-0.627652126242939,-0.522419742233868,2 -"393",0.347091613543875,-0.995221686134877,2 -"394",-1.06684415578986,0.645078456529164,2 -"395",0.592268133735176,-0.456105278840379,2 -"396",0.157891396854969,1.13334554097471,3 -"397",-0.356683577162962,-0.243744902734488,2 -"398",0.332617095141721,-0.493906230445285,2 -"399",0.267629012845972,-0.976825602794744,2 -"400",1.12131478232171,-1.33083409815943,2 -"401",1.45705145843815,2.32152580259574,4 -"402",1.73413937134612,1.42974290703878,4 -"403",0.808212952262217,1.08608951408035,3 -"404",0.164032087270602,-0.834886408410295,2 -"405",0.21761567210472,-1.80734389374982,2 -"406",0.880244883694794,-1.24913887802549,2 -"407",0.560578188028527,0.714468591884666,2 -"408",-0.574336653882468,1.88554175850262,2 -"409",-0.985664883665825,1.18397104634821,2 -"410",-0.0932099830289401,-0.0553671319788362,2 -"411",0.57216150020392,-1.14778052475501,2 -"412",-1.09898625648019,0.264449175548062,2 -"413",0.906126591149744,-1.61717353974068,2 -"414",-1.45556176747542,-0.198907639005909,2 -"415",-1.79151547272549,-0.0313254755476226,2 -"416",0.395568377881538,-1.11154208680647,2 -"417",0.822480282092486,0.556584527061073,2 -"418",1.2504063384519,-0.330726571269553,2 -"419",-2.37097017479241,-1.42466881396708,2 -"420",0.662976885250469,2.23936185141829,3 -"421",-0.760187912006092,-0.413186002248303,2 -"422",0.345161790757064,0.126796643141707,2 -"423",-1.23573066460401,-2.33404415888488,2 -"424",-2.10426496295859,-0.50981529742021,2 -"425",-0.374216233214262,0.0414720277488919,2 -"426",-1.96870746946676,0.503193434949282,2 -"427",0.170989519198167,-0.303552046600689,2 -"428",-1.70633865716114,0.171508443586208,2 -"429",-0.257956976269078,-1.83292783175551,2 -"430",-0.472996234133306,0.795467320676614,2 -"431",1.74115720974096,-0.962669979083566,2 -"432",-1.52645905258892,1.46269675277124,2 -"433",-0.197284826989132,-0.19501096446166,2 -"434",0.65672990174925,-0.518034939270991,3 -"435",0.647571552037267,-0.00463418740127366,2 -"436",-0.247570630809423,-0.904071767375255,2 -"437",0.141127704895448,-0.668961008917137,3 -"438",0.396566669217545,-1.00140157502642,2 -"439",-0.772813707551997,0.29970680762646,2 -"440",-0.153873422766281,2.43758067411111,3 -"441",2.26841836394745,0.00890926004800664,3 -"442",-1.80425420095102,1.61299399887491,2 -"443",1.13248571370294,-0.971888527365188,2 -"444",-1.00809617009944,-0.682531333858913,2 -"445",-1.11237889280941,-0.209819213765443,2 -"446",-2.32598106657515,2.0770132713822,1 -"447",-1.46849741710747,0.123576647894908,2 -"448",-0.770069853766748,-1.56111482731484,2 -"449",2.12118489071435,1.13297510791021,3 -"450",-0.407801287691335,-1.76570904615028,2 -"451",-2.05048980184485,-1.83376066365264,2 -"452",-0.0521346364441553,-0.523148824732239,2 -"453",-0.201251589347537,0.56789932298091,3 -"454",-1.40868878621107,1.17763495869735,2 -"455",1.36763748432042,-0.738096041003538,2 -"456",0.0679771985765997,0.207057581193109,3 -"457",0.020725806846714,-0.952020337110541,2 -"458",-0.339506058106594,-1.61626422122446,2 -"459",0.445869809361787,-0.36109322298337,3 -"460",0.0920699352333119,0.32790091988096,2 -"461",1.78024380400676,1.69432748882804,4 -"462",0.129124446014311,-0.100990009644121,2 -"463",-1.59107161061211,0.370403100557718,2 -"464",0.767532493626476,0.793272158833193,3 -"465",-1.16102782735812,0.432442320860876,2 -"466",-0.228618196634798,-1.43962385173374,2 -"467",0.649115123865292,-0.541731955956272,2 -"468",-0.355954658789513,1.03317377748367,2 -"469",-1.94707656599741,0.317094120693319,1 -"470",-1.38876709510521,-1.37049448422864,2 -"471",0.0726947299234645,-1.17088404836164,2 -"472",0.14534271890045,-2.09061812451603,2 -"473",-0.351231564246903,0.672089685079316,2 -"474",0.135691845601405,-0.514264828261834,2 -"475",-0.197966135533904,0.956461118400688,2 -"476",-0.646709757708405,2.64720302310365,2 -"477",0.455847264186397,-0.515744067295105,2 -"478",-0.939386941038692,0.772318221851802,2 -"479",0.68310750522823,0.23104116741239,2 -"480",0.613812717702589,-0.138516227736858,2 -"481",1.04795228902247,1.997037392695,4 -"482",-0.572572658309798,1.32826273543788,2 -"483",-0.052459066636626,1.15869735956154,2 -"484",0.70567122354581,0.596384423501237,2 -"485",-1.02570570283446,0.0927124471782075,2 -"486",0.267215913973285,-0.35909871528411,2 -"487",0.331059707641147,-1.0920584166762,2 -"488",-2.46312929424425,0.123303121903337,1 -"489",0.310622095959927,-0.249175918164244,2 -"490",-1.10133947414506,0.209191742285228,2 -"491",-1.65508797954254,-0.0356865228186643,2 -"492",0.690357979120451,0.255712287241303,2 -"493",0.169653344478785,-1.10446291522989,2 -"494",-2.05504461928005,-0.616965928198265,2 -"495",0.400968162761324,0.327600348934149,2 -"496",0.440354267087702,0.637827836694495,2 -"497",0.93806808858404,0.402259825558317,3 -"498",0.353741201490983,-2.54379288992807,2 -"499",0.859260813932912,1.47532492639916,3 -"500",0.312276028528479,-1.21435618644702,2 -"501",1.26239349524758,0.202520433212229,3 -"502",1.43612371622389,0.0894152218670725,3 -"503",1.62919666896976,0.119621688596362,3 -"504",-0.342014601723723,1.85416857895404,2 -"505",0.426295616162467,-1.1616329575041,2 -"506",0.413856286005835,0.483906024662718,2 -"507",1.39793407044548,-0.197132293570078,3 -"508",-0.373137179690724,-0.996971242763174,2 -"509",1.59038871852067,0.277885369241664,3 -"510",3.05560012823532,-0.0555681821452812,3 -"511",-0.422944801794694,-1.42459110312602,2 -"512",-0.203695522584914,-0.314373387665352,2 -"513",0.433999068449688,-1.43320424864349,1 -"514",0.337304430710627,0.0764948148741274,3 -"515",0.676687321422021,0.0453702786721454,2 -"516",-0.893854535602691,0.932598561037984,2 -"517",-0.0593686378680841,1.86959104818522,3 -"518",-0.658507713787768,-1.07498275909995,3 -"519",-1.28123785036108,-0.193005304984624,2 -"520",-0.147663933551981,-0.726945844329436,2 -"521",-0.302855157373189,0.648255840432392,3 -"522",0.308763504685862,-1.17939624562991,2 -"523",1.04351060614156,0.323011293092442,3 -"524",-0.593304957692859,0.237110560244998,3 -"525",1.38136164532482,-0.275838750923472,3 -"526",0.717232745873662,0.493953205369244,3 -"527",-0.905179427348091,0.425886831416598,2 -"528",0.212187283369523,-1.67720881714288,2 -"529",-1.74036483612467,-2.26635104811488,2 -"530",1.69701946897843,-0.31624987270193,2 -"531",0.686958862417022,-0.222490739736492,2 -"532",1.73831597094449,0.487656648677973,3 -"533",1.3102598741256,-0.0458705799607275,3 -"534",-0.256085527688691,-0.186478084399075,2 -"535",-1.10528948667234,-0.314434775503562,2 -"536",0.41269699339251,1.16189384300136,3 -"537",-1.17558886986598,0.200842942427544,2 -"538",0.662098671141772,1.51738682923441,3 -"539",0.586790962506448,-0.900461335829062,2 -"540",0.661591231920992,0.403857674963118,3 -"541",-0.14084875791113,-1.26404799188301,2 -"542",0.883191219178237,0.743238952757195,3 -"543",0.897042543994944,-0.454856595566193,2 -"544",0.828781863901072,0.532667882737376,3 -"545",-0.262067660837744,-0.945249909690996,1 -"546",0.0578063511468649,-0.531062108654398,2 -"547",0.0243008814556507,-2.11222819075732,2 -"548",-0.574245619267998,0.106703388520439,2 -"549",-1.11368938675092,-1.00313059125545,2 -"550",-0.0601127114462057,-1.08444033541766,2 -"551",1.71026629443157,-0.279386018080383,2 -"552",0.305549534118966,-0.834523217043838,2 -"553",-1.42744021211767,-1.7186388257823,2 -"554",1.81445134592683,-0.336976892828455,2 -"555",-0.487756783697309,0.0952130982072471,2 -"556",0.602295223629145,0.249132422956942,2 -"557",0.755850602345463,-0.159416315428505,2 -"558",0.862575921556095,-0.0102436018013483,3 -"559",-1.70007424710661,0.279765192452063,2 -"560",1.02217744037973,-1.01683887895417,2 -"561",0.386717469202568,-0.776598407627646,2 -"562",1.45017519236196,-1.05567683460375,3 -"563",2.29557296944144,0.0810763396632004,3 -"564",-0.968079810632171,-0.153792228395213,2 -"565",0.659366586531093,-0.220901271813686,2 -"566",-0.713979943572449,-0.214378147206809,2 -"567",0.367456463791077,0.640832268474424,2 -"568",0.0531833556211878,-0.819941138929749,2 -"569",1.84163146771472,0.617369659340786,3 -"570",-1.01582653009321,0.317684717876524,3 -"571",-0.355721583707165,-2.36409256240668,2 -"572",1.21905739078094,0.96373107792981,3 -"573",-1.98293931328204,0.298726864459803,2 -"574",-1.78619947778288,-0.0951390329213102,2 -"575",1.5502486731894,-0.329871621313376,3 -"576",0.103255333055064,1.86591320296114,3 -"577",1.77663148146474,1.11061514865844,3 -"578",-1.15078782484055,0.274946498616231,3 -"579",0.982836606895121,0.0748500285150689,3 -"580",0.14795269896141,-0.718247365791861,2 -"581",1.60738538280655,0.821099483599144,3 -"582",-0.520388380331408,0.619402633294212,2 -"583",-0.00496187469422831,0.0336455095089909,2 -"584",-1.46152428809083,-1.23351038940464,2 -"585",-0.669407249581795,-1.09597442444652,2 -"586",0.800957796014399,-0.807499857906529,2 -"587",-1.64319937363744,-0.537624749405528,2 -"588",1.57841874021401,-2.11641670664995,1 -"589",-0.350312454369682,0.353168877754319,2 -"590",0.611392680913446,2.06563656021762,3 -"591",1.4812254595327,-0.825631014772726,2 -"592",-1.5869578486432,-0.714149679345729,2 -"593",-1.05576245567578,-0.63129464156981,2 -"594",-1.19631146950654,0.241262940100415,2 -"595",0.137503818364021,-0.00723877108477896,2 -"596",-0.37733433690237,2.25778394956145,3 -"597",0.297862243022396,1.27316096845121,3 -"598",0.669726506061738,0.200967177826617,2 -"599",0.42118804446301,-0.708283652014327,2 -"600",-2.25595797078558,-0.043027658844046,2 -"601",-1.54887814428841,-1.30491136559282,2 -"602",-0.94872436483153,0.694803233789366,2 -"603",-0.837446424593806,-2.21545825698281,2 -"604",1.3476389861661,0.901801810608865,3 -"605",0.518488218885538,0.415030957276283,2 -"606",-0.460404387866283,1.35254445043896,2 -"607",-0.574062577372949,1.27782400680122,2 -"608",0.912416041917393,0.42283602201918,2 -"609",1.26396686143064,1.68342036117214,4 -"610",-1.36139776019218,-0.434497587143112,2 -"611",-1.16764148931887,-2.41695725341738,2 -"612",-0.00172018508809658,-0.517517721463917,2 -"613",-0.78103282156489,-1.32888995928337,2 -"614",-0.0585471692000637,0.13117082960268,2 -"615",1.69244528593605,-1.02901587373941,2 -"616",0.661528570057517,0.59640748980066,3 -"617",0.597441889918121,-0.279469611444308,2 -"618",-0.713913216019525,0.649206741752714,2 -"619",-0.206409147887496,-0.112374848154809,2 -"620",1.33651925428898,-0.188662467245284,3 -"621",2.33232846720642,-0.271000863638774,3 -"622",-1.65634074995286,-1.00008862991153,2 -"623",0.0255226465884277,0.606737330219328,2 -"624",-0.203982712715149,0.94306693843977,2 -"625",2.83694295432275,-0.306840886815886,3 -"626",1.13674989864642,0.63436026023182,2 -"627",-0.850331067572843,0.372440071821406,3 -"628",0.866215614337994,0.895703231310655,3 -"629",-1.45416459642389,-0.504120892849785,2 -"630",0.628593992406751,-0.279037613577049,2 -"631",-0.325886416372589,1.4145470392338,2 -"632",-1.30942878697473,1.81937929226531,2 -"633",0.0483476098058967,0.871257224470347,2 -"634",0.57240358864324,-0.863958452918056,2 -"635",0.4834928659008,-0.315368230582718,2 -"636",0.044303651156692,0.266853167583346,2 -"637",1.86036860555908,-0.863358291341998,2 -"638",-0.56466464911017,0.76645218707906,2 -"639",1.94879011997364,-0.399844005845577,2 -"640",-1.57160388517485,-0.611798125775915,2 -"641",0.325749824305948,0.521845805067756,2 -"642",-0.0935997605090974,0.107525553031054,2 -"643",0.872544135663942,1.83154578293297,3 -"644",1.43266846738863,-0.542430452400733,3 -"645",0.198216845867484,0.53613351989094,3 -"646",-1.90860873810729,1.19195761657141,2 -"647",-0.552538121558726,0.200193796003359,2 -"648",-0.483942978321644,-0.393289226696855,2 -"649",-0.286675777048388,-0.387105031679176,2 -"650",0.270189755449151,-0.45601394257268,2 -"651",-1.48405441803662,1.15228124844852,1 -"652",-0.0925916084126851,-0.344721496802792,2 -"653",-0.624597651285322,-0.271315142271292,3 -"654",1.13996709386237,-0.763023744671282,2 -"655",-0.766663024614312,0.302945419061369,2 -"656",-0.869959661611112,-0.915272517781153,2 -"657",-0.108052874044599,0.029465199089871,2 -"658",0.934759282646399,-0.788494839674656,2 -"659",1.32077018937942,-1.49612924354295,2 -"660",0.0738702511879958,0.866229373612298,3 -"661",-1.6208748445883,1.1596325358284,1 -"662",-0.628013223008121,-0.446057752797345,3 -"663",-0.47845452517421,1.77310990524093,2 -"664",0.589688548509235,-1.62257201920331,2 -"665",0.340934083486875,-1.52161097564046,2 -"666",0.576181569150956,0.252000574605259,2 -"667",-1.60419359887055,-0.648761578144092,2 -"668",1.34174797870115,1.82663303028123,4 -"669",0.692780119198355,0.360604154281169,2 -"670",1.41451851573147,-0.088837821968904,2 -"671",-1.38528188226849,-2.07860341026875,2 -"672",-0.444775462340823,0.840886355783806,2 -"673",-1.88263867879803,1.26187066021448,1 -"674",0.55626358966112,0.104711632861857,3 -"675",2.00259918047965,0.881368402858011,3 -"676",0.0208938444201812,0.354932228589358,2 -"677",-0.013554536605561,-0.458487988075648,2 -"678",-0.697955079474553,-2.33721442416169,2 -"679",-0.379156124081866,-0.208699291195645,2 -"680",0.384459466065392,1.06913446070485,2 -"681",2.73858857585052,-0.373033439626453,3 -"682",0.00544559333967241,-0.453426236395124,2 -"683",-0.878210140670026,-0.575382561023387,2 -"684",-0.907921121004535,0.668261066745674,2 -"685",-1.29517822686284,-0.200291691285624,2 -"686",0.143671601749781,-0.834749868444918,2 -"687",-0.911962649437428,1.02102544554161,2 -"688",0.718717400312881,-0.0752213217097831,2 -"689",-0.39508946206033,1.01235090614436,3 -"690",0.480721661622209,1.14222095562862,3 -"691",0.572278535874582,1.64604848896414,3 -"692",0.212915583561228,1.56831510977838,3 -"693",-1.48425896549528,0.263388231687147,2 -"694",-0.476186718295973,-0.204820373995618,3 -"695",-1.61970272088853,-1.37751159750921,3 -"696",-1.72422354262787,-1.37520529835799,2 -"697",0.195557290144131,-0.508767859410625,2 -"698",-2.13042108946384,-0.0439939997539797,1 -"699",-1.47004842331765,1.83519039749203,2 -"700",-0.196823065874698,0.484399167936318,2 -"701",1.611246108035,1.1696301414588,4 -"702",-0.785078316163952,-0.36234210719507,2 -"703",1.01640995927516,-0.46044801942311,2 -"704",0.664141699138114,-0.330411173164975,2 -"705",1.506393934306,1.77158229900391,4 -"706",-1.91245844479511,-0.352000817553817,2 -"707",0.723100146504584,1.58118649524434,3 -"708",-0.354601975757796,0.282379155267718,3 -"709",1.42472044318175,-0.582205248787019,2 -"710",0.959385126262147,0.518755913915588,3 -"711",0.470204892150714,-1.43815446264246,2 -"712",0.855545501894272,-0.80031581736675,2 -"713",0.0494345562992139,-1.0980611073568,2 -"714",-0.76595642181342,1.1159834609898,3 -"715",0.244596936754339,-1.28695864333422,2 -"716",-0.0137545835262385,0.635196890098678,3 -"717",0.148729705771486,-0.4226460817474,2 -"718",-0.116544890857083,-0.935172127884626,3 -"719",1.00194885771187,-0.163310915162857,2 -"720",0.573399854710655,-1.11018144916345,2 -"721",1.05106888809394,1.10318071383029,3 -"722",-0.607372617353057,0.391307381573071,3 -"723",-0.0033791300679578,-2.03301786740132,2 -"724",-0.0681120948388709,1.48836779026561,2 -"725",-0.127501909032217,-1.07018349377449,2 -"726",0.313719667974031,-0.256103439695586,2 -"727",0.141030351795183,-0.97523247526224,2 -"728",-0.409250521304824,-0.44726104163289,2 -"729",0.724898338309844,-0.709943124685737,2 -"730",-0.976191974301124,-0.749036979564225,2 -"731",-1.37852459094363,0.280116066564837,2 -"732",-0.456174385546362,0.837507355134136,2 -"733",0.137417947466113,0.856684492543148,2 -"734",-0.0821599229829143,-0.58824016462148,2 -"735",0.486418286955778,-0.618499817845401,2 -"736",0.14001412226468,-0.189887755978141,2 -"737",-0.0329079709055259,0.528653224749263,2 -"738",0.560051799413555,-1.86153734736827,2 -"739",-0.89708430557682,1.64403492908729,2 -"740",1.04376473415745,-2.33141028073173,1 -"741",-1.02170517268626,1.04145141018306,2 -"742",1.53222167571916,-0.644633888999618,2 -"743",-0.465892357729519,0.263051585854995,2 -"744",0.676101512011969,0.485250756899248,2 -"745",-0.328695258379981,1.66539554681286,2 -"746",0.336411620509025,-0.56434363110008,2 -"747",-1.42336437217898,-0.979543544617163,2 -"748",-0.572853827577909,-0.141400896180547,2 -"749",0.907451021283607,1.46426245861552,3 -"750",0.871451244237605,1.7215989544432,4 -"751",1.25291663210567,-2.57515677372912,1 -"752",-0.217446102739174,1.1472986236969,3 -"753",0.297010500095485,-1.68546155206185,2 -"754",0.44823692188772,-0.45244834120684,2 -"755",-1.23532481503483,1.39777469593924,2 -"756",-0.346497933624256,0.59834245169152,2 -"757",1.46564301534806,0.486553320621174,2 -"758",-0.203552529526414,0.845516527243271,2 -"759",-1.55705690138816,-1.45169466878814,2 -"760",0.0393304199568157,-0.328238790278862,2 -"761",0.833763689718112,-1.21492452869847,2 -"762",0.637904177415278,-1.14346018852961,3 -"763",0.368611054350419,1.37748982250395,3 -"764",-1.00197932291587,2.09000074459351,2 -"765",1.08027793146119,-0.782324681322973,2 -"766",0.796028644627923,-0.231568373206475,2 -"767",-0.745913090171105,-1.97467518642819,2 -"768",2.47345571812327,1.09092747350133,4 -"769",0.279106548836449,0.712118731884942,2 -"770",0.277019315597527,-0.746759342331299,2 -"771",1.16730431078923,-0.34333925646651,3 -"772",0.29482982588556,-0.777127731445244,2 -"773",0.484809568911923,-2.664319535519,1 -"774",-0.0140183107764543,-0.116589745345368,3 -"775",0.166802502951232,-1.78005121421292,2 -"776",0.885956291697468,-1.72164781614837,2 -"777",0.221169329748631,0.19595784188672,2 -"778",-1.13764381390168,0.573425129421667,2 -"779",0.00838561349268831,0.505932889420561,3 -"780",-0.758581955341018,-0.0766804081513039,2 -"781",-0.290659660657329,0.636261018399834,2 -"782",-0.217778356192507,-0.97939770576289,2 -"783",0.497839456274715,-0.155789017115583,3 -"784",-1.8607720457932,0.0338947246052668,2 -"785",0.0134408697833298,3.29876120044358,3 -"786",1.56899455704785,-1.62934515311617,1 -"787",0.651028942338217,-1.06923012064838,2 -"788",1.43973363712772,-0.35520196361563,3 -"789",0.351006830130886,0.635452781251784,3 -"790",0.753802049743564,0.372399372910318,2 -"791",1.35828981426012,0.271527246645388,3 -"792",1.42777135267608,0.569400280521031,3 -"793",1.0646301392967,-1.60836922295487,2 -"794",-0.923445675707155,-0.00414760012025685,2 -"795",0.664420003725144,0.0489565889292447,3 -"796",0.20487850356357,0.594292615065095,2 -"797",0.64424940596102,0.353793466363318,2 -"798",-1.82798703235459,-1.58008675249134,2 -"799",0.999960365327386,-2.21094117158656,1 -"800",0.291960987597538,0.449945682771834,3 -"801",1.78048737379516,-1.16328206323162,2 -"802",-1.0085366243564,1.14170765418922,2 -"803",-1.25682127357229,-0.0828253070507757,2 -"804",-0.66808958735226,-0.45460858748664,2 -"805",1.9649629209436,-0.543650702182644,3 -"806",0.378645504182204,-0.311116774768613,2 -"807",-0.199799695842948,-0.933814460246155,1 -"808",0.681041669479449,1.83868506848057,3 -"809",-0.584910739597662,-0.61451000339161,2 -"810",1.27938158128828,0.196521998348757,3 -"811",0.39480906198216,-0.10044276499293,3 -"812",0.528457189205411,2.05441654330112,3 -"813",-0.101874939034311,0.00355395149146674,2 -"814",0.245184000742171,-0.379309998355836,2 -"815",0.0375600796196692,-0.422059489812202,3 -"816",-1.97697729278522,-1.08542865447718,2 -"817",-0.751155073558556,-0.313622619959154,2 -"818",-0.321923301707331,0.944578058469263,2 -"819",1.83992839936162,0.603413554420052,3 -"820",1.59988432825062,-1.89518766884239,1 -"821",1.03580145341133,-0.660329920639936,2 -"822",-0.914775339877636,1.02120180217403,2 -"823",-0.38960094478535,-0.17054160494051,2 -"824",1.67412708271352,0.506775299359289,3 -"825",-0.428386225231452,-0.368285959920411,2 -"826",0.699531303945007,-0.240724779809204,3 -"827",-0.585415728200367,0.801423344781039,2 -"828",0.333743495648911,-0.150419151489665,2 -"829",-0.580209388399422,0.88205652161633,2 -"830",0.440529550529015,-0.689607139726694,2 -"831",0.0220880920204526,0.604126771728143,2 -"832",1.35546379769105,-0.829238373613371,2 -"833",0.457935330165318,0.681855681178763,3 -"834",0.273198252776944,-0.422177345694823,2 -"835",-0.89190974900482,-0.744345836551257,2 -"836",0.541512982388185,0.306695387968279,2 -"837",-0.389409672141027,1.05258171577851,2 -"838",0.854540661130416,0.561910680584452,2 -"839",-0.0791248312855369,0.219500228666292,2 -"840",1.62237407508983,-0.513394164497109,2 -"841",0.863139157007668,0.864946913967385,3 -"842",0.615369033044237,-1.13182983640843,2 -"843",-0.439605422408609,-0.908498461697273,2 -"844",0.712542051608273,-2.74100324997747,1 -"845",0.679626087740748,1.16376536203817,3 -"846",1.06328878685229,-0.581181746524241,2 -"847",-0.296800280380022,0.107501745425586,2 -"848",0.347910544172021,1.03815364136543,3 -"849",0.107836217306277,1.19730976980802,3 -"850",-0.841394837777399,0.55273219696204,2 -"851",-0.626065231291288,-0.36015202222399,2 -"852",-1.12152774645535,1.11507227597342,2 -"853",1.78030859596195,-1.52565303601814,2 -"854",1.21110546104195,-0.073074221984822,3 -"855",0.517081824867224,-0.00876748154336742,2 -"856",0.277053820700554,0.73356444696547,3 -"857",-0.181757170165,0.275238080199174,2 -"858",-0.480640416051078,1.20182458284579,2 -"859",-0.185141328166873,-1.11536824621347,2 -"860",-0.696310997321937,0.358787519901801,2 -"861",-0.477740490616974,-1.28394180279717,2 -"862",-0.286661347150748,-0.224140265832123,2 -"863",-1.81443578115377,0.5451174936621,2 -"864",1.11947848613579,0.344254221144445,3 -"865",-1.37647136936541,-1.04939611532417,2 -"866",1.23085576123594,-0.0315635119536457,3 -"867",1.78986376768754,0.283657187882573,3 -"868",-0.151850143638071,-1.36057275771299,2 -"869",-1.02195154917629,-1.02681078721759,2 -"870",-2.16849331198394,-2.72552010761634,3 -"871",1.04619695134914,-0.611344679830938,2 -"872",0.615367573680465,0.779451566567553,2 -"873",-1.14320575657984,1.92164137268233,2 -"874",-0.465532049661422,0.486115464699338,2 -"875",-2.11315247006788,-0.167298571756325,1 -"876",0.613110115042833,-0.753843407216961,2 -"877",0.234523673997803,-0.33577146517928,3 -"878",0.642761468998484,0.336247297824452,3 -"879",-0.378377748164569,0.153388380029115,2 -"880",0.30774857758838,-0.420841862892832,2 -"881",-0.244251404122837,1.36294340696902,3 -"882",0.560258421702272,-0.760980658054936,2 -"883",0.638191122845986,-0.476004237431193,2 -"884",0.496493586013738,-0.189412058848928,2 -"885",-0.00667094460110748,-1.00395010567499,2 -"886",1.62291673502245,0.706530090917624,3 -"887",-0.247406918315675,-2.33998325722604,1 -"888",0.736599439190133,-0.231097740720185,2 -"889",-0.938457749076716,0.891376017172157,2 -"890",-0.677819215264912,1.25185885750271,2 -"891",-0.464445766393475,-0.898657123434108,2 -"892",0.468453518802418,-1.75391121215935,1 -"893",-1.32714837691464,-0.616600112469501,2 -"894",0.0438787811022741,0.36746760758669,2 -"895",0.918470372118645,0.774383644622371,3 -"896",-0.147103740378553,1.54228361293328,2 -"897",-0.51881525632591,1.5004020217127,3 -"898",0.297680682952142,-0.721709898049661,2 -"899",-0.894565012073268,-0.969072723137849,3 -"900",0.259522256975565,0.0926767211775757,2 -"901",-1.67408229304129,0.294848724459793,2 -"902",1.00987232912551,-1.9257765322872,1 -"903",-0.574954987826279,0.153438647876134,2 -"904",0.312449253285899,-0.513428233307596,2 -"905",-0.0725053805672113,1.33254706431008,3 -"906",0.48489635115217,-0.660271641010172,2 -"907",2.24219655299806,-1.65416399114415,1 -"908",0.238595607639832,-1.20265979940866,2 -"909",0.295925204022819,-2.59996507867719,2 -"910",0.535589169016755,-1.09006029558183,2 -"911",0.469955772796592,0.972984326070239,3 -"912",0.529146072089825,0.368470261962385,3 -"913",0.22234986396658,0.985506011105209,3 -"914",1.35778961003162,-0.440874279210114,2 -"915",-0.645164198769991,-0.275042672572972,2 -"916",1.58949535689314,-0.515028685049688,2 -"917",0.193760667068258,-0.628093906215966,2 -"918",-1.34861047482725,-1.27538676882531,1 -"919",1.29961495488222,0.168949621675588,3 -"920",2.38001957036285,-2.05068689394562,1 -"921",-1.26545549138196,-0.651084527279601,2 -"922",-0.460202346554631,2.03347835364478,2 -"923",-1.13711389064948,0.20193690888732,2 -"924",0.243117711981482,0.82092409198349,3 -"925",0.845646361868832,0.937593597921916,3 -"926",-0.187759721892899,0.876300658981683,3 -"927",-1.57653577405296,-0.125179883453471,2 -"928",-0.992657208003783,0.810323364248117,2 -"929",-0.479257416711327,-1.772583753883,2 -"930",-0.654786905858442,-0.00144776397245733,2 -"931",0.903297910129634,0.508427120673305,3 -"932",-0.124562417133962,-0.0833589625592377,2 -"933",-0.140084921118523,0.129318142612313,2 -"934",1.34963231887827,2.52997229261579,4 -"935",-0.877349302593479,0.624821856259561,2 -"936",0.74852577892557,1.90520215528525,3 -"937",0.667496883678518,0.282622272955664,3 -"938",1.14012226895058,0.581437916363865,3 -"939",0.39099624937282,0.684944491259834,2 -"940",0.190316216304085,-1.06680532296583,2 -"941",0.201347056008359,-0.625163343129629,2 -"942",-1.12995010084315,0.998081585435669,2 -"943",0.768642090665606,1.48132651467869,3 -"944",-0.462017421772084,-0.292478950758808,2 -"945",0.892552471080123,0.444266453544344,2 -"946",-0.454411239355722,1.36971424949624,2 -"947",1.29764124281327,-0.402077311591257,2 -"948",-0.268732337977947,0.567338416730429,2 -"949",-0.186769283481612,-0.481551060289479,2 -"950",-1.90996245799697,2.52884186916396,1 -"951",-1.72286066655655,-0.462913366870959,2 -"952",-1.30195776452724,-0.903574937519432,2 -"953",-0.838285040458432,-1.54512482199128,2 -"954",-3.35605461058033,-1.36406903912809,2 -"955",0.734555842992035,0.451905584196765,3 -"956",1.23977391322679,0.844070243627766,3 -"957",1.05562456637041,2.55440473193715,4 -"958",-0.352588462728402,-0.259952651104351,2 -"959",-1.09671517559011,1.73802338019808,2 -"960",-1.30450116054182,0.50525709028685,2 -"961",-0.345686988678291,0.556526912877533,2 -"962",0.49614108302063,0.713587842937539,3 -"963",-0.239192764184251,-0.538558698842734,2 -"964",-0.445309912671866,1.84233996014795,3 -"965",0.0888544326645125,0.459202419720294,2 -"966",0.771258081572015,-0.286159620208699,2 -"967",-0.767787730403098,0.537288953802504,2 -"968",-0.546629584232326,-0.166029717063729,2 -"969",0.896668196799084,0.0739944079509917,3 -"970",-0.20057869631381,-1.16814252355766,2 -"971",-0.514982997742738,-0.179053008511304,2 -"972",-1.27330667836535,2.50235589348172,2 -"973",-1.35562676727321,1.46796386180907,2 -"974",-0.678974806388467,1.13434560301537,2 -"975",0.51535445718745,0.265359374619848,2 -"976",0.31726165260558,0.592731393718031,3 -"977",0.406692030523417,-2.12921899804122,2 -"978",0.990913752021094,0.0106715598016732,2 -"979",0.205918620698753,3.12168825012533,3 -"980",1.21385641522395,0.725920584050406,4 -"981",-0.210047862904661,-0.840741044896276,2 -"982",0.699211081866472,1.54444951013521,3 -"983",-1.29420330811734,-0.283691864147048,2 -"984",0.086738285330508,-0.496546564229769,3 -"985",-1.38645931503039,-1.87758105674454,2 -"986",-0.896596077167893,0.852920063220944,2 -"987",1.95633286365741,0.206362334375767,3 -"988",-1.6389111009144,0.21050869768123,2 -"989",-1.41589145135932,0.650320872694805,1 -"990",-0.62853060148301,0.728547583001271,3 -"991",0.967636601917303,-0.559275700610185,2 -"992",-1.35439671655797,0.576003659671985,2 -"993",0.414737948955044,0.176523367018452,2 -"994",-1.34463558145073,-0.779703595548175,2 -"995",0.20191407693169,-0.505715434934774,2 -"996",-0.537124349961687,-0.845945422356641,2 -"997",1.32314626753398,-0.543292808092304,2 -"998",-0.619610416056987,0.242765404843852,3 -"999",0.484140923610859,0.852950371094532,3 -"1000",0.961974778647751,1.34986514143191,3 Binary files /tmp/tmp4nxicoj3/lnf8rby_zA/r-cran-marginaleffects-0.17.0/inst/tinytest/stata/databases/Phobia.rds and /tmp/tmp4nxicoj3/okRarB_yt9/r-cran-marginaleffects-0.18.0/inst/tinytest/stata/databases/Phobia.rds differ diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/databases/betareg_betareg_01.csv r-cran-marginaleffects-0.18.0/inst/tinytest/stata/databases/betareg_betareg_01.csv --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/databases/betareg_betareg_01.csv 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/databases/betareg_betareg_01.csv 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -"","yield","gravity","pressure","temp10","temp","batch" -"1",0.122,50.8,8.6,190,205,1 -"2",0.223,50.8,8.6,190,275,1 -"3",0.347,50.8,8.6,190,345,1 -"4",0.457,50.8,8.6,190,407,1 -"5",0.08,40.8,3.5,210,218,2 -"6",0.131,40.8,3.5,210,273,2 -"7",0.266,40.8,3.5,210,347,2 -"8",0.074,40,6.1,217,212,3 -"9",0.182,40,6.1,217,272,3 -"10",0.304,40,6.1,217,340,3 -"11",0.069,38.4,6.1,220,235,4 -"12",0.152,38.4,6.1,220,300,4 -"13",0.26,38.4,6.1,220,365,4 -"14",0.336,38.4,6.1,220,410,4 -"15",0.144,40.3,4.8,231,307,5 -"16",0.268,40.3,4.8,231,367,5 -"17",0.349,40.3,4.8,231,395,5 -"18",0.1,32.2,5.2,236,267,6 -"19",0.248,32.2,5.2,236,360,6 -"20",0.317,32.2,5.2,236,402,6 -"21",0.028,41.3,1.8,267,235,7 -"22",0.064,41.3,1.8,267,275,7 -"23",0.161,41.3,1.8,267,358,7 -"24",0.278,41.3,1.8,267,416,7 -"25",0.05,38.1,1.2,274,285,8 -"26",0.176,38.1,1.2,274,365,8 -"27",0.321,38.1,1.2,274,444,8 -"28",0.14,32.2,2.4,284,351,9 -"29",0.232,32.2,2.4,284,424,9 -"30",0.085,31.8,0.2,316,365,10 -"31",0.147,31.8,0.2,316,379,10 -"32",0.18,31.8,0.2,316,428,10 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/databases/ivreg_ivreg_01.csv r-cran-marginaleffects-0.18.0/inst/tinytest/stata/databases/ivreg_ivreg_01.csv --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/databases/ivreg_ivreg_01.csv 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/databases/ivreg_ivreg_01.csv 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -"","Q","P","D","F","A" -"1",98.485,100.323,87.4,98,1 -"2",99.187,104.264,97.6,99.1,2 -"3",102.163,103.435,96.7,99.1,3 -"4",101.504,104.506,98.2,98.1,4 -"5",104.24,98.001,99.8,110.8,5 -"6",103.243,99.456,100.5,108.2,6 -"7",103.993,101.066,103.2,105.6,7 -"8",99.9,104.763,107.8,109.8,8 -"9",100.35,96.446,96.6,108.7,9 -"10",102.82,91.228,88.9,100.6,10 -"11",95.435,93.085,75.1,81,11 -"12",92.424,98.801,76.9,68.6,12 -"13",94.535,102.908,84.6,70.9,13 -"14",98.757,98.756,90.6,81.4,14 -"15",105.797,95.119,103.1,102.3,15 -"16",100.225,98.451,105.1,105,16 -"17",103.522,86.498,96.4,110.5,17 -"18",99.929,104.016,104.4,92.5,18 -"19",105.223,105.769,110.7,89.3,19 -"20",106.232,113.49,127.1,93,20 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/databases/lme4_01.csv r-cran-marginaleffects-0.18.0/inst/tinytest/stata/databases/lme4_01.csv --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/databases/lme4_01.csv 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/databases/lme4_01.csv 1970-01-01 00:00:00.000000000 +0000 @@ -1,1001 +0,0 @@ -"","x1","x2","clus","y" -"1",-0.790410589553459,-0.150965401907553,8,-0.332870234566465 -"2",-0.663692768709657,-0.250219659579478,9,-0.170826603693892 -"3",-0.554690577361199,1.04025860675807,4,-2.03944980412356 -"4",-0.726408749984104,0.330755894096358,2,-2.26849340590748 -"5",-0.648805127392731,-0.0962563865462789,5,-0.358851742160896 -"6",0.0566805760203192,-1.30972884785617,6,-1.01043425182714 -"7",-1.96402413399136,1.52301038639087,9,-3.22024999208012 -"8",1.05300867485704,-0.394476931268872,4,-0.694339129184442 -"9",-0.266235678711121,1.54213905247371,4,0.978460276159325 -"10",2.04069607132139,0.902894850070955,1,3.92181174296001 -"11",-0.301123879771433,0.61317985319959,7,0.677264646056445 -"12",-0.287212941121623,0.71399560839863,9,1.0362040907141 -"13",1.71275678269503,0.0923488126592941,9,3.86862378256201 -"14",-1.24320743943394,-1.30099274753698,4,-0.00197477667954848 -"15",0.137063487989253,-0.294699578308429,9,1.0414095105497 -"16",-0.460052510918068,-0.497774084916787,8,-0.0548147027549715 -"17",-0.152702198263284,0.0532180826406295,6,1.57479505253431 -"18",-0.504364098426196,1.21278470933198,9,0.52777655997026 -"19",-2.09115840839816,-0.28218509467697,3,-1.13329321769446 -"20",1.88513032370692,0.75958658937113,10,6.88649417709396 -"21",-1.42846004954197,0.421795114520855,7,-1.09444842187332 -"22",-0.0869791846453932,-1.16691448106177,10,-0.115273398256576 -"23",-0.53099174455521,0.220878552398896,8,-0.710791088613036 -"24",0.60666247806902,-0.412483829378541,4,0.219361686472365 -"25",-0.302109148833589,-0.246735206727923,1,-0.601482331802597 -"26",-0.577632637103732,0.258430392718376,10,0.513667046872616 -"27",-1.05033995676996,0.550380389768402,2,-2.15020344995065 -"28",-0.254406036897671,0.234941177544128,2,-1.45429259880664 -"29",0.980997664683558,-1.74765024273398,9,-2.82606984733565 -"30",2.2162902555,1.12317100767061,3,5.63740943992483 -"31",-0.686017646799295,-0.775872726187174,9,-0.0696294071233008 -"32",1.68385439539341,0.177498892286838,2,3.83302854251956 -"33",1.39268710741485,-0.564680162995564,7,0.786277099538619 -"34",-1.33491564476246,-0.300604903243322,9,-0.269714240271561 -"35",0.626381333881556,0.267019995816745,1,2.30504195047596 -"36",-0.533948337414783,-1.77106066867132,3,-1.28448339772596 -"37",0.115194655877998,0.668213871456393,7,2.6684287718736 -"38",-0.0169126381757959,0.210359075129673,3,2.4466783035477 -"39",2.81113605522396,0.237548439016528,1,3.0574633848793 -"40",-1.01324779769064,1.3073025189451,4,0.565343418755059 -"41",-0.0500887146356507,1.3705359507422,6,1.15374528924703 -"42",-0.239758732479068,1.4739449703302,9,2.02587997384296 -"43",-0.564529012541089,1.92758125335016,8,1.13983836451962 -"44",-0.769488480539428,1.29543804374226,7,0.160364921515489 -"45",-0.220692389575229,0.672721386496987,5,-0.429327145494765 -"46",-1.05662428456187,-0.65254596918445,1,-0.0378154617818646 -"47",-0.561892615902451,-0.585294583114671,3,-0.210630279917498 -"48",-0.48315925170497,-2.36005081977686,3,-0.581136247032538 -"49",-1.3936895846787,0.5927312682527,10,-1.6375194624918 -"50",-0.887920996026162,2.8907200136366,9,-0.688347211078277 -"51",0.240631268178944,0.455982534886577,1,1.07828386117672 -"52",0.534947157148994,-1.0429660516577,6,-0.338295437486463 -"53",0.0860681582880379,0.0529622797650861,5,1.94866738245521 -"54",-0.138470134535445,-0.0161482888890418,10,0.731435500360279 -"55",-1.93962579694482,-1.02264146311924,6,-0.640865057029214 -"56",0.805482397920169,0.470887604091482,1,2.94964119264089 -"57",-0.999380032425905,-2.1710905822442,1,0.0400698675278004 -"58",0.445852056030754,-0.568946987692843,8,1.58807693047404 -"59",-0.145991159966485,-1.92918415535363,8,-2.36576696779347 -"60",2.42501986175962,0.51612277152432,6,3.99852525460206 -"61",-0.344512287455365,0.725317014887948,9,1.27093449204515 -"62",-0.92635989059208,-2.33414941015622,4,-0.416348975756772 -"63",-2.17267742930355,0.301276835166025,5,-2.90280109213883 -"64",-1.53491709305822,-1.30465281188707,4,0.565840852205428 -"65",-0.0644057248587745,2.08803407448856,4,1.82152278816758 -"66",-0.75084692006941,-0.142611619902203,6,-0.21692599122165 -"67",0.701447248338862,1.45556403968079,10,3.36244978831541 -"68",-0.0438132501593959,-0.132152864526903,2,0.947148064463903 -"69",1.08240704540698,-0.963563320019069,3,-0.873774703052508 -"70",-0.391123079991629,-0.712939711875705,2,-0.647996131428949 -"71",0.738291539074588,-1.4360253823394,9,-0.870358599429426 -"72",0.581169915862233,-0.850603005671878,1,-0.532540152571557 -"73",0.707307642836751,0.580362309967708,6,4.33371243188323 -"74",-1.47743570619676,-2.39886239926281,4,-0.144703549824868 -"75",-1.55434474430346,-0.248988719531,1,-1.43236121649695 -"76",0.81832661155825,-0.451719259832938,3,-0.22925247825125 -"77",0.045558814359015,2.32520270628055,5,3.76362049446553 -"78",1.46863395119492,-0.882801012741105,9,0.715791094455181 -"79",1.18169507496517,0.303727343930229,10,1.94422169560031 -"80",-0.47122719229901,-0.929752691710054,7,0.204732410624971 -"81",0.710832041889221,0.157559203391218,7,-0.152158619601135 -"82",0.0756255384259377,-1.40379527933763,8,-0.571662499311747 -"83",0.831157387069709,-0.787217417360022,3,0.985156451381445 -"84",1.02598768920923,-0.429665712071528,7,2.01949378327772 -"85",-0.0338835115900591,0.633656240564408,10,1.4386982582074 -"86",1.98296374263301,0.458500851820245,9,4.2167437581877 -"87",0.514283418954507,-0.811485601168476,9,0.0353028342360013 -"88",0.654726921530954,2.60919309105861,8,6.73793026454339 -"89",0.329676094439788,-0.325516215228983,4,0.566643583320608 -"90",-0.989865423734332,0.925728225792482,3,0.562346390300021 -"91",-0.482772096228271,1.07436544856941,7,0.400160261390137 -"92",-0.597614136595358,-0.448340639642436,8,1.16908719567331 -"93",-0.0757823868249956,0.881308257894292,3,0.690065190009176 -"94",-0.935647810050433,-1.58953390690304,1,-0.860188816963837 -"95",1.53331273121368,-1.0126483095128,7,0.3401764366453 -"96",0.459184784862741,0.231301761319098,7,1.68444456627476 -"97",0.39415172462627,1.16773789340761,1,1.2865364239336 -"98",1.37161542010232,-0.676055328050942,8,0.720797669084112 -"99",-0.971253667540202,-1.05965504294328,3,-0.384259720328324 -"100",-1.24167738754564,0.447671410090313,10,0.125508930704544 -"101",-1.53060720751507,0.507677360004714,3,-1.63504738243358 -"102",-0.14506405316338,1.59620462569086,3,1.71507112006406 -"103",-1.17324820565198,0.812703886585971,1,-0.673729253656615 -"104",-0.267289123657159,1.79581087440499,2,1.89156120615363 -"105",1.13841970471585,1.43094098129825,3,3.75718426995337 -"106",0.806803706714493,0.193970388696462,8,1.25490976648797 -"107",0.672731832337398,1.35471880734226,2,3.63862488216788 -"108",1.79822948423057,-0.588613057505481,4,0.573202099564421 -"109",0.17244681204287,-0.576046944976025,4,1.09147274779326 -"110",0.17012847914997,-0.549457258342574,1,-1.45800314795562 -"111",-0.0419047670950747,-0.603725670718528,9,1.35948670940697 -"112",1.5090294459668,-0.341280026999827,9,2.44072385211264 -"113",0.296198057839079,-0.433488253103482,8,2.72874982679776 -"114",0.899978919847385,-0.300395515374119,7,1.46183344274254 -"115",0.641695203529834,-1.76752581753826,4,-1.6216547725942 -"116",0.0771638072269265,-0.0208488640402935,7,2.10879491820299 -"117",0.585545527888196,-0.671063020775591,2,0.170231811590415 -"118",-0.558544734232512,-0.974555177087394,3,-1.53250552645871 -"119",-0.583286836871201,-0.806152066779541,5,0.246753413230212 -"120",-0.229360152961926,0.187273856522805,3,1.71491116888747 -"121",-1.36021938794163,0.496307002662476,1,-0.19721803329044 -"122",0.966675190266367,0.171996219499372,3,1.79411077148406 -"123",-1.9664494993124,0.819605036547489,6,-3.16761330780069 -"124",0.737910830236467,0.578579852566867,7,1.35426299866777 -"125",-1.44991163098698,1.34516590571536,2,-2.73157555473578 -"126",-0.621685566205868,-0.00370000927427452,9,0.0749766871239353 -"127",0.256265111951753,0.127509131007415,7,-0.253933724389913 -"128",0.0516243896571935,0.575642850092669,9,3.22229217419651 -"129",-0.0165900066821642,-0.0167737355534615,7,0.938727799399306 -"130",1.13492576658179,-0.399051944478121,7,1.68733249754576 -"131",2.3045879380165,-1.70406746175437,5,-2.50157945633018 -"132",0.825354982887342,0.866309020757481,8,1.64624800674454 -"133",-0.707647764338308,-0.0453717087228526,4,-0.635184269013358 -"134",-0.137391629545371,-0.436571227287458,2,-0.405458153120485 -"135",-0.200019382254611,1.23730004377146,8,1.67532707927977 -"136",-0.168917810743356,0.302536825814831,4,0.404951159924439 -"137",0.473092661031129,0.518646703563615,7,3.08565942619264 -"138",-0.985135277488499,-2.76611944799239,9,-1.0500995985658 -"139",1.61712038570211,1.29856246505778,4,6.43688889198672 -"140",3.00132769024499,2.04355800513398,3,10.9562666128992 -"141",-0.938459588437333,-0.0926521142759379,2,-1.0075053817293 -"142",-0.501773491373783,-0.116795047398617,1,0.50107158876529 -"143",0.132542029626275,-0.184445112620182,8,1.51130717137494 -"144",1.114694187974,0.802964223954937,8,4.56190274339411 -"145",-0.301758953038547,-1.68918266092535,4,-3.26890008595293 -"146",-0.124040197652214,0.851517797589273,2,0.477106611893959 -"147",-0.0261526326332553,2.57970438519909,2,2.42972377883275 -"148",0.414033899396764,0.684433879549935,7,2.98494328863761 -"149",0.419822735033769,-0.823533617533555,1,-0.0719362869758797 -"150",0.413534870898201,1.08792780071698,1,1.64516080660167 -"151",1.07613799779614,0.0954367636734899,5,1.91298490826107 -"152",-0.233073068953154,1.44343890072977,4,2.95733062892157 -"153",0.248083553392122,-0.00198636421656589,3,0.336118365591968 -"154",0.484425662123237,-0.341448519443348,9,1.13231836855848 -"155",-0.00176239711840065,0.328851651898956,5,0.471220660086737 -"156",-1.40838830626814,-0.897113981342582,8,-0.538973334611349 -"157",-1.31256455127054,0.376996267876382,2,-1.33904624677087 -"158",-1.36448025401916,0.345229649455532,4,-1.13085867786364 -"159",-1.37163820086569,0.95360037222133,5,-1.49170286791335 -"160",-1.51598633633763,-1.05695665126087,10,1.45459649331195 -"161",0.607050315960516,-0.405314601834126,8,3.17462779522036 -"162",0.75418755269134,0.0158541926921444,10,3.45777594816558 -"163",-0.894924419463906,-0.329479472481996,9,-0.211458189065566 -"164",-0.548135922031151,0.834121710827135,2,-0.662358087210943 -"165",1.18391182829442,-0.923739620908681,1,-3.68453867549899 -"166",-0.210357211521565,0.565965367297612,1,0.677755363702762 -"167",-0.282719743008354,-0.766623234591641,2,-0.404977297208977 -"168",0.433457872326644,-1.86555609876705,6,-1.55317042727935 -"169",1.29552587620421,-1.26044180434918,8,-0.0334413145912428 -"170",-0.126270071561229,2.18446797629339,9,2.03910866743713 -"171",0.950609942724572,-0.0462684019677371,1,0.381550361894502 -"172",-1.61554327981259,-0.319304799102671,3,-1.71064758438756 -"173",0.388337150871323,0.160476412963031,7,1.89669557714593 -"174",-1.13615295125969,1.60330853509101,8,-1.07079674120899 -"175",0.470805390044329,-1.96289142745314,9,-3.92549115847014 -"176",1.2023611202391,0.596334801960439,8,5.14440126730128 -"177",0.404639467950727,-1.86216827273738,4,-1.4100692454187 -"178",1.63125172243431,-0.046189631622089,3,0.530358319560876 -"179",1.58382249163859,1.37934886635683,7,4.63160998278118 -"180",0.783001207709126,-0.098447126817361,7,2.11052828429639 -"181",-0.447087940296047,-0.152711918767259,9,0.753795295766409 -"182",-0.508036656979576,0.142009110023927,6,0.0027639857261281 -"183",-0.488280286735556,-0.244589644073243,7,-0.0724593013384198 -"184",0.431998844374951,-0.534356677356247,1,0.46713580715716 -"185",-1.09868004603684,-0.222726625342324,2,0.221795454588925 -"186",-0.36989555433515,-0.146016961123942,1,1.2250270593876 -"187",-0.395290533635328,1.26323627442775,10,1.81626450317571 -"188",0.357175121028591,-0.292460993528603,5,-0.472368155783104 -"189",-0.419085102150305,-0.0123512836823931,10,1.52658256930876 -"190",0.9629947459147,-1.05471375741502,7,-1.41097036314379 -"191",-1.74923195719838,-1.12171694144964,10,0.377500211070151 -"192",-2.47829412109955,0.0451274228169371,4,-2.13871080163407 -"193",-0.0966495440221017,1.20410941891805,5,0.489616774041856 -"194",1.67567954464353,-0.40692841270766,3,0.905999557588855 -"195",0.677233445123167,1.09576782748215,10,2.53455198153094 -"196",1.35600776811512,-0.308711098697772,8,1.40028929663787 -"197",-0.903755403001467,-0.316784997679524,1,-1.34068479797465 -"198",-1.5046784285669,1.03797652362799,8,-1.72615204809241 -"199",0.798435979097118,-0.459075777177745,3,0.909452314816707 -"200",0.642302180499118,1.01460178382863,9,1.44029930603065 -"201",-0.106287687401667,0.319819683748741,3,0.0630415637656945 -"202",0.337627563186899,1.0290147227791,2,2.46436150448853 -"203",-0.115084240201789,-0.391203890943287,5,-0.459857583356401 -"204",1.26699480151288,-0.461859614914763,4,-0.761290520676863 -"205",0.329659710939462,1.17821825486909,3,3.84154975356566 -"206",0.197257673564043,-0.861356884513232,10,0.446461070138106 -"207",1.7248987014573,-0.180715768930941,2,2.88001812906587 -"208",0.194888791012123,0.780736750439209,2,1.80430568039106 -"209",-1.11925790661155,-0.566307818925312,3,-0.671499816708443 -"210",-0.118933237222106,-0.648734933236535,4,-0.307478746051941 -"211",-2.80755653529945,-0.189979077802648,3,-1.55025611602856 -"212",0.998516233863412,-2.86952125857242,5,-2.90290774269441 -"213",1.44908918442086,-1.06767381644426,1,-0.427489795629846 -"214",0.104172009403875,-2.16627943851609,5,-0.799989142590637 -"215",-0.820822743935183,0.391763513437941,6,0.629821402578738 -"216",-0.857075325842169,-1.06444943287533,6,0.196441730796705 -"217",-1.67440579796565,0.309752407173067,3,-0.69314721752086 -"218",0.822941297354728,0.863721172204371,7,2.30083810006731 -"219",0.723151219633093,-0.690201295435866,3,0.0945867582180616 -"220",-0.837277990221438,-0.190733359732953,2,-1.3241408682559 -"221",-0.13476604737433,0.18832728337809,3,1.44164582026761 -"222",-1.75154181100835,-0.0336231423521714,8,-0.842488435962732 -"223",0.40719624508383,-1.07212603047532,7,-1.88942037061541 -"224",-1.28403650854374,-0.0672554607232296,6,-0.180939504297101 -"225",0.454886999798161,0.15930956095525,4,4.02558366908974 -"226",-0.680868673753008,0.736850243860598,6,0.132041662647138 -"227",0.13562698448001,0.474938449617824,6,0.934830268487884 -"228",-0.34683762259439,1.75817307555963,5,0.534414664976405 -"229",-0.96380766721365,-0.701858252830164,3,0.479885497007104 -"230",-0.591349529442378,-1.64040077929335,4,-1.85045471502744 -"231",-0.338487558689279,0.258531707052844,10,1.86454780801892 -"232",0.947290868243037,-0.281556774323992,2,0.0961237532564669 -"233",-0.343185967310088,2.43843208846243,8,1.20910834660055 -"234",0.317325500775344,-0.544299888228748,8,0.352402558738566 -"235",0.616071500350732,1.03028594381822,5,2.54986315000876 -"236",1.1434512309226,-1.71947816458452,6,-1.99934954105173 -"237",-2.212420644048,1.36402106093015,8,-2.6038952742135 -"238",1.73316016180889,-0.623264129806569,2,-0.25308905496299 -"239",0.297693393503805,0.306535306628559,6,3.7983443477936 -"240",-0.52230507047695,0.857400248917373,1,-0.423314503600566 -"241",-0.215036765291037,-1.66975781730237,3,-1.81227782961972 -"242",-2.02464816413442,-0.475545922885518,3,-0.62314692943815 -"243",-1.26742971868174,0.890992164467494,6,0.369179624635496 -"244",1.18486136158221,-0.80624932227271,8,-0.0826305622702949 -"245",-2.18634987902618,-0.0739166140154057,4,-2.98439307003591 -"246",1.88024190226516,-0.643653961860358,5,2.00042242769368 -"247",-0.151380380005138,-1.00090497480137,7,0.31381130444017 -"248",-0.86058708432885,0.466587972011396,4,0.386185193385279 -"249",-0.0237093682111353,-0.739304361804588,6,-0.119659598778 -"250",-1.1223195671864,0.85823212338282,7,0.382767335491864 -"251",0.401075793976989,1.10450104557699,8,3.92838685857929 -"252",1.61753045415723,-1.04729261999961,7,-2.37533414607489 -"253",-0.895881203271424,3.53493875292775,4,0.0205381036448523 -"254",0.105265879334973,-0.104938124263672,7,0.370823021759729 -"255",0.174737492950122,-1.81696210858607,2,-0.375340036846554 -"256",0.192402649290906,1.11320199484176,5,1.17071077779793 -"257",-0.113932223112345,1.54573391588072,10,1.58898191987708 -"258",-1.43284331538826,-0.838859123856841,10,-1.09874781762994 -"259",-0.108575435691925,-1.66025502141652,5,-1.99841329339162 -"260",2.28551192743975,0.0419696003914103,8,2.77950659173955 -"261",-0.944901591483532,0.922258097602139,2,-1.54218433949837 -"262",0.0535815155296675,-0.760954993816918,5,-0.657319904316828 -"263",-0.528566359197434,-1.24142533147294,2,-1.39897043211256 -"264",1.33667228525511,-0.627190032126096,1,-1.69349555536987 -"265",-0.426374888109958,0.51921303978825,1,0.52707832624089 -"266",-0.622248084639721,-1.24818211479809,6,0.354280607995981 -"267",-2.60903210025356,-0.512068796977404,5,-1.67284623500342 -"268",0.106466547539493,1.82350877916421,6,3.24244618026352 -"269",-0.208675601954797,-0.427447076313647,8,-1.53490531731571 -"270",0.109724726879414,0.179527143667093,7,0.778483686476779 -"271",-1.14787847203687,-0.693712575878517,7,-0.945060933437801 -"272",0.774859084120068,0.574307054517482,5,0.311739572057355 -"273",-1.31382311125749,-0.194593889560995,6,0.901854432997756 -"274",2.04173477401168,-0.175659011375334,7,2.58973775272902 -"275",1.06311183137034,-0.567864497494334,10,0.891036583127614 -"276",1.40096574356547,0.630511040293329,2,3.49009234868498 -"277",0.706386533340629,1.02068964852828,7,5.66137379266514 -"278",-2.17353202158857,-0.885376630336813,2,-0.38119440703917 -"279",1.1932401478031,0.132190481172422,6,3.96586227940433 -"280",-1.0080483737649,0.139056027807122,10,0.278133165670708 -"281",1.81480202934419,0.887400332795185,3,3.01357440138832 -"282",-0.0323186391575523,-0.700065870047588,8,1.42678240390998 -"283",1.44461514537044,-0.214656552189984,6,2.94985697155301 -"284",0.795677776610438,-1.15654623710965,4,-0.500651775224625 -"285",0.0941563224305083,0.991332845371128,10,0.355159832971047 -"286",0.206929248572151,-0.228984646685711,3,1.39841179849948 -"287",-0.172949390460533,-0.244001738541023,6,-0.77186403235348 -"288",0.0827826826346451,-1.9428971564983,7,-2.39529386093793 -"289",-0.801496199091074,-0.104059323824182,3,0.269875791410532 -"290",0.0420153643489999,-2.0986078967928,2,-2.33954867544913 -"291",0.451656885582587,-1.08287820595099,10,-1.06900706135693 -"292",0.857483979975979,-0.489445064334904,10,1.1255589280051 -"293",0.547822250111274,0.714893446675798,10,2.19052524077673 -"294",-0.304339366253562,-0.98437550808159,7,0.018848815691535 -"295",-1.04498950829414,0.89548640080497,10,0.318450583467873 -"296",-0.705901721770098,0.435371767981451,8,-0.134946765177555 -"297",1.47686887629695,-1.08540080396542,5,-0.932008648922888 -"298",-0.449053204705807,0.302404308614354,7,1.88050996892794 -"299",0.429300267395174,0.689488737935942,5,1.08195055083927 -"300",0.31946515651205,1.84317786869172,3,3.27036476859249 -"301",-0.980364526828161,-0.043952649477988,8,-1.97035625071357 -"302",0.450319797281832,1.18078275973494,7,1.77522987208125 -"303",-0.911630939053744,-0.40951456573012,9,-1.7321818496897 -"304",-0.802595903060233,0.308109349614761,10,-0.131564848049332 -"305",0.319195562674405,-0.457394272196383,3,1.53512355258603 -"306",0.400764824890494,0.0282941433719993,2,-0.0123089256641848 -"307",-0.162978261491018,-0.0953374766356575,4,0.595292882702384 -"308",1.12791772878615,-2.34505067063002,7,-4.03213916480606 -"309",0.512259281141971,-0.0504057091004378,10,0.947144049760704 -"310",-1.16453571335088,0.901874018952735,1,-0.310287933775584 -"311",1.27762358127069,-0.585255930680844,1,1.48557550025393 -"312",0.23366456146859,2.03516727091203,5,1.88393357507113 -"313",0.82702544826212,-1.0810206984796,2,0.335417837757315 -"314",0.0684165980042015,-0.96161154156776,10,1.74195459588552 -"315",-1.46039708300525,-0.208638238347639,8,-0.805578810463873 -"316",0.0530261590504353,-1.27727283046369,5,-1.27432720662116 -"317",-1.43519721410408,0.78671036628175,7,-1.19966523924003 -"318",-1.02529080990487,-0.744820670121238,9,0.419385929956571 -"319",0.867011846069349,1.6315733931748,9,3.96913972825257 -"320",0.19702661697209,-1.9701815365696,10,0.547629031542852 -"321",-0.0952554162772768,-0.959377635869341,3,-0.0238606941813129 -"322",-0.41915248970768,1.28869107236091,8,0.0507140831384314 -"323",-1.15307440172776,0.567160232008965,9,-1.16528588741789 -"324",-1.560839503083,-0.1692458441753,7,-1.77219645647811 -"325",-0.996996808085884,-0.226474310480562,10,1.76010224909564 -"326",-0.128216870373664,-0.344587684284862,10,-1.05988581811974 -"327",0.0470871773315598,-0.844221477431953,5,-0.698203030698583 -"328",-0.379461018445854,-0.953539882562631,1,-0.791800070452914 -"329",1.24663002166914,-0.265778488950639,8,2.23852381972844 -"330",0.0636664341235598,-0.187908618108752,5,1.53561559536952 -"331",-2.20914081194941,0.177512284906353,8,-2.84544317776206 -"332",-0.01099591373522,-1.20263000993712,9,0.318801378158289 -"333",2.13511432699127,0.088791439066705,10,3.57488989652478 -"334",0.651077605993681,-0.551905775895946,2,0.112427900744185 -"335",-0.0976445552116384,-1.83532011829733,2,-4.13971801713932 -"336",0.939009159515816,1.43314386501809,8,3.51005129858866 -"337",-1.34273331753977,1.82367790104696,6,-3.04012229214903 -"338",0.589768930880128,0.328416631010823,3,1.33088206306558 -"339",2.45902172350237,-0.589099488805853,2,-0.819787018244272 -"340",-1.16360012674266,-1.21443631427276,2,-0.348720374341858 -"341",0.419767180696443,-0.898199137807758,6,-0.719295217274805 -"342",-0.435801438436616,-0.381301543231994,3,-1.420308252741 -"343",1.21966438037025,-0.4508968540569,7,1.08458404700286 -"344",0.518777714104884,-0.452275545829053,4,1.36940361666832 -"345",0.394336995981637,2.13106591130017,5,4.70444610800405 -"346",0.354890202694769,-1.93739296250866,6,0.435191232325498 -"347",-0.920367562864661,0.767174192057445,7,0.817215394921756 -"348",-1.397601345343,-0.145901376315228,5,-0.582814200664338 -"349",-0.205595373230267,1.24374325363406,3,0.2230009872695 -"350",0.863289315420158,0.19036630823605,3,1.95992968537028 -"351",0.141264394576725,-0.536178948009798,6,0.974041962948582 -"352",0.248359582390288,-0.114237810177161,2,0.00702076614538888 -"353",-1.55662785289322,1.29828787187385,3,-0.843078674954352 -"354",-0.191900409881624,-1.33484816023631,10,-0.918429011658428 -"355",1.78687489479075,0.831831989675659,2,5.67862986283505 -"356",-0.718861098937321,0.977231096783691,2,-0.521032218981983 -"357",0.193338994497178,0.815840284757186,9,2.85802568794215 -"358",0.474760123676341,0.851917368818171,9,3.02626328928057 -"359",1.77375584166577,0.239770815969332,9,4.46139727215487 -"360",1.58766765956542,0.440005922542021,7,3.58749746539764 -"361",2.6182742190198,-0.673267691067838,5,-0.900142031765796 -"362",1.12098044480356,0.410277995205134,1,2.67888641582486 -"363",-0.769384363244538,0.14337683927659,3,-1.2803059625767 -"364",0.140306625427543,-1.11346660475589,5,-0.247664935361318 -"365",-0.720075706202721,0.64217999311305,5,-1.40031754840151 -"366",0.777280469059646,-0.332913538816675,6,0.150070920770154 -"367",-1.35829820561909,1.11933750979269,2,-0.996063386308938 -"368",-2.92108043826217,-1.44383247646621,10,1.02692090078729 -"369",1.85256757676963,-1.3298320264787,4,-0.333534562602283 -"370",1.27829027561304,0.87830633910059,7,4.34534593060705 -"371",-2.253399877886,-1.1547675019661,8,0.839554029966366 -"372",0.507145155896114,-0.967343019975636,4,-0.76108105734889 -"373",-0.25742509844438,-0.369639815972046,4,-0.536880874704867 -"374",0.0258977712131229,2.12343850021148,5,3.73480476262514 -"375",1.29888978703577,-0.497146219353886,3,-0.103306205655625 -"376",0.199291540282164,1.17840649686032,10,1.69321200509847 -"377",-1.42875748951326,1.60270536031021,6,-2.02643300406222 -"378",1.27862277590068,0.453479927351034,9,4.20981150982906 -"379",-0.998402017101443,1.45447540753072,8,1.82875381543906 -"380",0.0105314926181235,-1.42941021248585,10,-1.70089630225115 -"381",-0.95524046900002,2.23387902115049,7,0.901714922368412 -"382",-0.873995598792155,-0.0823846519750923,7,-0.0451440811572234 -"383",-0.926352266687982,2.36619202214586,4,-0.546781517351639 -"384",-0.734536072505761,0.695535918742577,10,0.695649067606868 -"385",0.212581845916153,-0.640679796429588,10,1.35745540335202 -"386",1.40213628584309,-0.2944452050607,3,2.90212673019937 -"387",0.772450758116532,0.379832182784754,4,0.0702238922230931 -"388",-0.137477166188172,-0.544001802303351,8,1.45559313828347 -"389",-0.992689106805864,-0.157618345704882,2,-2.1578245282749 -"390",0.978020358642335,-0.490504925167009,4,-1.25885615256405 -"391",0.834308998245521,0.258014354141243,7,1.85564754715285 -"392",0.444849812777593,0.470796145842234,8,1.64360691662285 -"393",0.614501711407874,1.25142851577622,8,4.44562150316878 -"394",0.559479822092074,-1.35532590915661,2,-0.53905619905823 -"395",-1.20466938154376,-0.130445427258141,4,-0.634060071467547 -"396",-0.652155466377094,0.320953353879298,10,1.73192731821857 -"397",0.673548600037291,0.213819549012356,5,1.75876170003661 -"398",-2.33985994037938,0.0908738164361549,10,-0.28283774071384 -"399",-0.0595379318730286,1.27152282622789,4,0.266414019511998 -"400",-0.335454141608095,1.89987151688072,3,2.16008850038123 -"401",-0.969258715144011,0.936800102338341,4,-2.62207590787533 -"402",-1.41434246290153,-0.885211622716411,9,-1.27042926377794 -"403",1.06095400230733,0.697143687805628,4,3.45137374541679 -"404",-1.46997126134754,0.662151690097737,8,0.690730551555567 -"405",1.6596617023855,-2.25048865160595,6,-4.34299758393027 -"406",0.903798466839724,0.274814485660811,7,1.96434568041825 -"407",-0.0828830517477371,1.2586962352895,2,1.54103037927072 -"408",0.40410244402459,-0.556412144661315,7,0.530818260707018 -"409",-0.932478544673219,0.11509475946718,2,-0.601292102924372 -"410",0.720137114581419,1.00572679131373,3,0.701844872016005 -"411",-0.467890478120358,2.27697353779881,6,-0.585450800663835 -"412",-0.624816759673495,-1.73085831685042,2,-2.42300604642111 -"413",0.740017964255822,-0.105552245638225,10,1.79174080881484 -"414",0.601881055060857,0.0529256442290132,2,1.73228670234425 -"415",-0.92499817396273,-0.384920414137572,2,-1.24874606860672 -"416",0.114502270221369,-1.18355307806499,3,-3.25283039493218 -"417",0.332172510063184,1.21037814762949,3,4.18271106582091 -"418",-0.323325381371048,-0.488946388958889,3,0.404168140793581 -"419",0.48994564373813,0.222449543322399,5,0.359466910451287 -"420",1.18298849745432,-0.094085038612441,9,3.03751496118218 -"421",-0.640411737003543,0.446038182721317,1,1.44218658264772 -"422",0.583626204834528,0.275324575333616,6,1.73884799431685 -"423",-1.55655306655586,-1.07320586665482,3,-1.36562919456714 -"424",0.899691197200321,-0.245118614571408,1,2.15299067376679 -"425",3.07269253179475,1.67697344865159,8,11.1845898196687 -"426",1.24115217693496,-1.20700636043081,1,-1.61518916671737 -"427",-1.92780208061024,1.17063048495246,3,-2.69906172627067 -"428",0.719200264344737,0.102106769585206,10,2.96371423798038 -"429",-1.12737199846834,-1.32932928093097,3,-0.44658250121662 -"430",0.646818842881201,-0.3420483873356,8,0.102183360648629 -"431",0.854160471219255,-1.08473846241323,9,0.14429621945139 -"432",-2.14945778789738,0.819643172172467,4,-3.47954162614812 -"433",0.652918005596596,1.46532064756546,9,3.34421619143322 -"434",0.957956403073011,-0.0597725116087956,5,1.41567527619492 -"435",1.01093493254544,0.334253843074352,9,2.95180211319623 -"436",-0.91665947003678,1.27518761272496,8,1.48269080558145 -"437",0.750362620355156,0.0174920202561711,2,3.09532139941678 -"438",-0.641328705699261,1.25316483641967,5,-0.861268455374722 -"439",-0.0605704945255837,-0.199353647121488,7,0.0941177412885441 -"440",0.513328981857306,0.660113568494631,9,1.95994220714574 -"441",-1.10030893449104,1.10499303827668,1,-1.01197127521379 -"442",0.736104733491362,-0.735531859095107,2,-2.74921941469888 -"443",-0.769743299706853,-0.170123204480972,10,1.03747524362413 -"444",1.50491371429021,0.472093141174659,10,4.5381463547935 -"445",-0.0509640668228861,-0.365244644955105,7,2.63702286444283 -"446",0.174317566024261,-0.183045993459101,1,1.13641010029031 -"447",1.26373069141956,-0.10863011541864,10,0.865859494634302 -"448",0.383712405137647,0.429030348561447,10,1.04062819405667 -"449",-0.932881316063738,-1.2823795214404,3,-1.06305248549802 -"450",0.8586484614012,-0.240583825194158,6,-0.539713724990538 -"451",-0.327804361097876,0.403424055483211,6,-1.95874341066653 -"452",-2.16239277527474,2.21288167085704,5,-4.16858953736398 -"453",2.45302867125884,-1.13854314772085,5,-0.909499257770861 -"454",-1.04944385504077,-1.25341611667907,1,-1.73324169448023 -"455",0.150724686626445,1.18398041314731,3,0.432255080966828 -"456",1.73425677549892,-1.75888946940763,2,-3.51533685267785 -"457",-0.14373227538052,0.842377679840402,5,0.502532320398795 -"458",1.29596914783134,-1.47321400469737,8,-0.710571336059451 -"459",0.464924791209754,-0.0371211096142356,2,1.36444243125672 -"460",1.53883012042831,-0.0555563309084587,6,1.4440175835595 -"461",-0.299955567051079,0.591209942946704,4,1.65549942475119 -"462",-0.725588804554838,-0.233442953569294,6,-1.86596905250345 -"463",-0.589399016618134,-0.865602876653702,5,-0.427387625902957 -"464",-1.10398939156907,-0.697542376325016,5,0.593122188079132 -"465",0.801870897034078,-0.00325702980773412,1,0.331787920805333 -"466",0.870782813497941,-1.12812851114937,2,-0.0669215447307948 -"467",0.926866934625848,-0.0491881617266123,6,2.28268360105327 -"468",-0.155781384855481,0.795151195662447,3,2.22412303206754 -"469",-0.740396412591495,0.410464838936386,9,-1.06609900846657 -"470",1.78158689232864,-0.436229888944656,5,1.41547322725871 -"471",1.67759519230683,0.16677296320104,3,3.71006689988087 -"472",-1.10237982604667,0.0457587594888279,7,-1.63543041045588 -"473",0.0234558813117932,-1.72392647220787,6,-2.05341899572363 -"474",-0.993479469021135,0.811596560692565,1,-0.309918783711195 -"475",-0.67594177989181,1.00471843673221,9,-1.55501669835134 -"476",-0.815000034598078,0.967767834877284,5,1.53203469387024 -"477",0.180165083667623,-0.165324131136473,10,0.936111590495258 -"478",-0.61381654419698,0.387034265051361,8,-1.4171261368187 -"479",1.58567608021303,0.343316851725234,9,2.79761653241154 -"480",1.03105201304408,1.36031343979968,1,4.73892494740075 -"481",-0.208631310716185,-0.388166933623062,7,-0.561681188019412 -"482",0.0511079160004019,0.837030109836721,10,2.01653340526162 -"483",-0.612293773798397,-1.39713520328985,1,-0.684137321411662 -"484",1.49425521232225,0.505814971224438,5,3.54828092297469 -"485",0.573036658356647,-0.640868407032012,6,-0.182265464348374 -"486",0.846912457322832,0.375033787738197,7,2.6891655366007 -"487",0.464617674313307,0.637159682589437,3,2.53879458710899 -"488",-0.186962135654359,1.0380904520486,9,2.07182336717784 -"489",-1.27912364448027,1.58729656730371,5,-2.98084902907781 -"490",0.356782816971308,1.96904693693909,8,2.71889521119387 -"491",-0.0519869654789269,-0.489365670564824,2,-1.24574140712782 -"492",-0.420384632689279,-0.0734707418504713,6,1.6431798604354 -"493",0.0230146292354261,1.17872239921854,4,2.72292349582558 -"494",-0.0369457397373644,0.862487548168288,1,0.0891068642870707 -"495",1.59222916470229,0.879416208665173,9,4.29475123564809 -"496",-1.01346239054992,0.383916929847401,4,1.82703533921965 -"497",-2.43499666887119,2.35280083238037,1,-6.50363212664312 -"498",-0.213379578709029,0.150332645718446,7,0.0867208165288784 -"499",0.637092899930813,0.181837885211068,10,2.0508267417527 -"500",-0.245937193849805,-2.87920555338584,7,-1.57659743929172 -"501",-0.218852458637774,-0.519099983742246,2,-1.02432386717032 -"502",0.732661652955191,-0.276750870535422,1,-0.394073128872811 -"503",-1.53764123279948,1.55643860137761,8,1.05904412102164 -"504",0.0739186807116557,-2.27452371890782,5,-1.3403646322676 -"505",-1.67516363574503,2.26696622873261,8,-2.07129886836643 -"506",0.23683696620648,0.704327940430557,5,2.39424321613977 -"507",0.39767592407557,1.53804412756934,7,3.70396301763732 -"508",-2.20697800260091,-0.433970383881753,9,-0.774408307069219 -"509",-1.27484310475125,0.367065055291779,4,-1.94296001252722 -"510",-0.0931566482147915,0.793064932393719,9,1.95377776414949 -"511",0.756671112291836,2.08088194105568,5,3.34011308577903 -"512",-0.325969940321488,-0.0669724311635377,4,0.459241787199575 -"513",-0.579431316369669,0.721521888140433,9,0.349352304231001 -"514",0.117838333991574,-1.86492278094758,7,0.218126408542405 -"515",0.921395641862148,-0.489217015403184,1,-1.47527745645995 -"516",-0.348377499523028,-1.04575885044947,9,0.407203370956223 -"517",1.26400225199331,1.04862783244851,4,4.24119369997881 -"518",0.326214482335988,0.309941003886118,4,-0.111941862915136 -"519",0.533770417224514,0.864958207096282,8,3.08988593758747 -"520",-0.602235497453743,-0.498245468254581,10,0.836136357221775 -"521",0.704243180149987,0.625583758326091,3,2.40441322853605 -"522",1.78147761849419,-0.42097729183585,3,1.22555156048871 -"523",1.2694301352033,-0.764934404562485,4,-1.22024880949034 -"524",1.57439929044163,-0.306398102680997,4,1.18437875998506 -"525",0.437896915756917,0.242570574031425,9,1.48525451616746 -"526",-0.522900156681556,-0.513843172476974,7,0.509818029709634 -"527",-0.322666544406528,-0.009959683215569,5,0.624487055579212 -"528",0.359410432254288,1.72256781647708,10,3.43671843051789 -"529",-0.275069189813738,-0.485510178335135,3,-1.503381383006 -"530",1.67468258413618,0.478544097365502,5,0.928605953408778 -"531",-1.18634172600164,0.0829675118760933,6,0.400714999316666 -"532",-1.9422540848961,0.240710728582001,4,-0.356876435278573 -"533",-0.048904893712464,0.33704637113382,10,0.128387344959068 -"534",-1.67159480418581,-0.58330706552122,7,-0.600310983331766 -"535",0.513387143899106,0.726953614387777,6,3.85213422295694 -"536",0.867348895417531,-0.35598657850117,3,-0.914779853909725 -"537",1.60442634187679,2.0323222392352,4,7.0889323757918 -"538",-0.0536187310754283,0.363154213230047,10,-1.07961529864701 -"539",-1.15142450083786,1.50260266489068,8,-1.80204073668237 -"540",0.190627907446704,-0.0600945845401795,10,-0.759072885515918 -"541",-0.583968027733994,0.0286361643126915,2,1.85434341063824 -"542",0.177742870172624,-0.00599996146680799,4,0.86782295673262 -"543",-0.699972230707433,0.227090700938575,4,-2.11528675738045 -"544",0.111890095486845,0.74059826560839,8,1.76263668263954 -"545",1.2893177769526,-0.931091406135605,2,-2.4068553572197 -"546",0.932696666977591,0.567481580754502,9,2.49283359637035 -"547",0.178105498904552,-0.415252370163203,8,1.59166421860833 -"548",-0.130357005726291,-0.437317573820017,9,0.496173776135902 -"549",0.0806748981770394,0.463653755752717,7,0.970404942038165 -"550",0.231058652161028,-0.324907762811757,7,1.28357148781825 -"551",0.500336347689187,-0.317790183865709,10,1.07579191553193 -"552",1.77880720989548,-0.550743510502374,7,1.19609445970996 -"553",-0.0308256141471288,0.447114497794092,8,1.39582232645522 -"554",-0.816669539346713,0.19733241507471,1,-0.195985178998471 -"555",1.55832021398461,-0.38736019089349,2,1.77164257812879 -"556",-0.0471533968154212,1.12787460092501,7,2.53107878418241 -"557",0.237025864117805,1.1338249221438,6,2.25592112079327 -"558",1.0740252049981,-0.435190670000221,2,-0.397655008202149 -"559",1.39341873091427,-0.718844085195453,6,-0.382882923184672 -"560",-0.682524621076842,-0.288572805798381,10,0.484262065971125 -"561",-0.643059047656795,-0.823251411547036,9,-0.608587054850592 -"562",-0.607462572717333,-0.486567102353731,5,0.307660857271223 -"563",0.443694602135893,0.889212248110479,7,2.8080637009694 -"564",0.753380586821928,-0.234523727189584,2,1.84815538410492 -"565",0.323781898589519,0.183194350133904,5,2.156419387292 -"566",0.334123360191496,-3.05210210262328,9,-3.06186148516274 -"567",0.980511654584796,-1.89022260196495,10,-1.40496207147672 -"568",0.107866083441283,-1.10893110864467,3,0.104702855142403 -"569",-1.06951749719995,-0.236578453739789,9,-0.744036343084703 -"570",-0.217456414678991,0.311024525796485,3,0.262548713039575 -"571",-0.848085837135494,-0.830392759694509,6,0.320333230985554 -"572",-0.185780064730896,0.499110921744404,6,0.863178935879304 -"573",1.51823142914043,-2.15213755270968,6,-3.53359814327677 -"574",-0.101477972811408,0.254855562204408,3,0.693385881713239 -"575",-0.679373453085887,1.78607192278211,3,-0.0340765861771906 -"576",0.535339132057371,0.553961255931596,10,1.817724424242 -"577",-0.118806959748447,-0.338581755042114,8,-1.08040255453897 -"578",-0.238526009574809,-1.69778633188865,8,-1.53143291178463 -"579",-0.247301431222695,-1.26073001810775,8,0.170755882082324 -"580",0.635349442053773,-0.694848053430024,4,-0.48262691960066 -"581",0.483573246684348,0.0758865760708487,2,-1.33646179992671 -"582",1.82058003201864,-1.36250914738229,8,0.327568816398875 -"583",0.873322073331021,-0.86344781259108,2,-0.538357422261638 -"584",-0.345194779700055,0.124966224843808,1,-2.16134319786266 -"585",1.04581648810909,-0.224081855810589,9,0.946480202430936 -"586",0.544051150234208,-0.559821224055536,7,1.27998818931435 -"587",-0.0717760712356873,-0.701443378548048,4,-0.232167231331458 -"588",1.42647971030537,0.527527183149004,4,1.42289109654088 -"589",0.789009330104327,-0.758189314880267,10,-1.12909428118517 -"590",1.89146095902768,-2.62578533783096,6,-5.26193513350484 -"591",-1.5529559094722,0.998500976243099,7,-0.971162942855545 -"592",0.238746216123586,2.52957452742591,7,3.52994197334375 -"593",-1.44106260378317,-1.74064696912731,8,1.8453898389721 -"594",-1.19502312192384,0.251756790968802,9,0.0274432405052067 -"595",0.879537287235416,1.75122175770071,6,4.42229742952121 -"596",-1.45795898716351,0.259545250940023,6,-1.83046062141603 -"597",0.158776896331673,-0.836357866939906,10,0.456024840627568 -"598",-1.68327401929981,0.460291174163447,4,-1.69402694797324 -"599",-0.992539857369239,0.296497885448131,9,-1.48161596968628 -"600",0.88807236589598,1.05738383031713,7,3.25870888763113 -"601",-0.420461366900833,1.11134879056824,8,1.17443823767061 -"602",-0.394231859678529,0.098920383071145,9,1.48031745993255 -"603",-0.156893611084774,-0.862731317905919,9,0.961661997245691 -"604",-1.4608847634566,-0.0345821086512733,9,0.126401259928294 -"605",-0.662519820148547,-0.00663789314181666,9,-0.213844867516794 -"606",-0.449099334040884,1.73557457232078,1,2.30406167868121 -"607",-0.0133815688284499,0.0206916822637498,6,1.70871761213454 -"608",0.990834708479395,0.578458745323915,2,0.250170832832064 -"609",0.521572455721659,0.155736512493306,5,1.9172489734135 -"610",1.08702493287258,-0.669010051152244,2,0.631842855298897 -"611",0.736117839335163,-0.932897169361554,3,-1.19624259585327 -"612",-2.3800092564246,-0.754624877932312,1,-1.24844432683792 -"613",0.748009557082218,1.25191148810541,1,2.11411239178233 -"614",-2.13315895394711,-0.365165774107845,8,-0.0499267660835699 -"615",0.858803371760547,1.20715637268179,10,4.19591614413766 -"616",-0.663856139749041,1.96187471081704,8,0.951102786657926 -"617",-0.467302990299714,-0.797965836284735,9,0.465309191368469 -"618",-0.182892701044448,-0.0745047650022901,2,-0.650937575517632 -"619",0.788647711381483,-0.375259968434054,3,1.25048764498709 -"620",0.648638746086022,0.950744446660719,10,4.21454662269314 -"621",-2.95306163842278,1.67758776527278,7,-6.36517302667724 -"622",-0.465055020663302,-1.16204981012852,6,0.896822461705098 -"623",0.0308084804227994,0.873502889581583,5,1.66216895558543 -"624",-1.79764400793861,0.218152240082831,10,-1.04022810603711 -"625",-2.60013967678402,-0.529438728531063,2,-2.10191618975713 -"626",3.12330097300664,0.574331825679311,10,4.71992575794003 -"627",0.0789062073828663,1.77461036258302,3,2.49764795977482 -"628",-0.219253518941289,1.55984942966114,6,0.950786881608589 -"629",0.765666615182991,-0.655619113293666,7,-0.703070028076304 -"630",0.80176806269916,-0.244575904483658,7,-0.205575338612286 -"631",-0.300772309053983,0.402977066005844,4,2.24775131119454 -"632",-0.485865341122389,-0.64716956045962,6,1.15538095500858 -"633",-0.369143791905467,-1.14285545323141,8,-0.678558209697983 -"634",-0.494035273373104,0.994576644175343,7,-0.164188526630525 -"635",-0.311969309404549,0.556398344312672,3,-1.73100121532331 -"636",-0.979350255894409,2.13604833834151,9,-0.016751131196961 -"637",1.42707043161389,0.940326689290964,6,3.06270389310058 -"638",0.868684066274818,-0.554689890422177,1,0.622003152009512 -"639",1.69027753189188,-1.8070399599804,3,-1.82223067150391 -"640",-1.0571194730268,-0.586484510913835,4,0.449895212955557 -"641",-0.412316242052033,-0.528480194276049,5,-0.290303108748764 -"642",-0.319913267646854,0.114003821463188,8,0.463137960704632 -"643",0.272018156010278,1.4852504572913,7,0.846296715454697 -"644",-0.073824150486957,-0.223300433862604,3,1.14803684375609 -"645",2.14880297693622,0.368124708294231,3,3.39072856411449 -"646",0.57870136480732,-0.654363776423438,6,0.364328104799687 -"647",0.48017205142783,-0.550547106631623,1,-0.831326581725071 -"648",-1.79586743684718,1.76063222032257,6,-2.17227874585488 -"649",0.580952557210046,0.667071867524959,4,1.3891666724499 -"650",0.490604646699687,0.394480942558055,7,1.65830665094728 -"651",0.946899096771513,-0.345299024288219,10,2.08781906578239 -"652",1.4555715374051,-0.782543103639216,3,-0.0965024253412742 -"653",0.643051604273641,1.18003727368563,10,2.1725696441603 -"654",-0.625022965429234,0.500905366525325,1,-2.05736709471243 -"655",-0.456844410080087,-0.59534350669899,9,-1.29768956329158 -"656",-0.489332408808434,-2.07296082532936,4,-1.89356198190709 -"657",-0.872464266423976,-1.30502459549031,7,1.05209713810819 -"658",-1.96584216528442,-1.50776721911365,9,0.707155531552169 -"659",1.12452327839693,-0.379060276243821,6,0.818147538444779 -"660",0.75671971325483,-1.52407910110561,2,-3.0345759689342 -"661",-1.91177540144821,-0.104749225314196,10,-2.04243560779538 -"662",-1.58071865491277,1.49514871103282,4,-2.59849167707253 -"663",1.98247788436283,-1.66804752019859,3,-3.76751248948526 -"664",0.795133742352847,-0.592507469904655,7,-1.12964843243414 -"665",0.518440585223802,-1.48635906150149,3,-1.35492815020018 -"666",0.0298162055712407,-0.409857676616788,2,-0.750308892127223 -"667",-1.69211665121594,-0.216513988900842,6,-1.58269872488741 -"668",0.5704897835533,0.0775240211601549,6,0.904228104297594 -"669",-0.83401880888348,1.68912859291121,4,-0.55934453575535 -"670",-1.29654239991355,-0.236504208442715,6,-1.65291638751101 -"671",-1.67929633697761,-0.0235433515843216,4,1.81019625440103 -"672",2.05439602987019,0.747480051971743,9,4.61285136320732 -"673",1.20179084161739,-1.2230570411344,2,-1.99761677584761 -"674",1.60929933688306,0.620356830321087,4,2.64436758026264 -"675",-1.41323819505194,0.768218339134518,9,-2.08596584814998 -"676",0.508084001497708,-2.86706943087487,8,-2.86256035315163 -"677",1.0701890519498,-0.766525646805454,9,1.94819851936958 -"678",1.13603715441907,-1.09083497682638,4,-1.18873851885705 -"679",-0.635974658710736,0.945726578649916,2,-1.14303846424646 -"680",0.432664782951436,0.850815147445757,8,2.67905357418393 -"681",-0.76412279379015,-0.495126556132692,6,0.354648220887663 -"682",1.70604023031451,-0.599533132026257,10,0.643213727624193 -"683",0.370008671507595,0.663476647303373,7,0.504234821834861 -"684",-1.22602276531819,2.24501127471663,1,-1.14447528837117 -"685",-0.489645827257693,1.49524346549038,7,1.99471627300233 -"686",-1.15074311314119,1.61129753120215,6,-1.43540612316268 -"687",0.549214697035858,-0.287450309707048,5,0.45655558306636 -"688",0.355137082838783,-0.0794683196145487,5,1.80548680535357 -"689",0.196345643200513,-2.50427017052647,8,-1.86193507896709 -"690",-1.39939241944941,1.48301808687032,4,-1.53208724798394 -"691",1.84827246542306,-0.809405875931713,7,-0.833716382551997 -"692",-0.508027141166185,-0.131013502882697,4,0.172265925858406 -"693",-0.250973534174279,0.832512159140702,10,0.812481200374845 -"694",0.183214158135121,-0.0539843795110513,4,1.7824740121672 -"695",0.662296203177901,0.260799654899216,8,1.76293445047578 -"696",0.286682247520716,-0.60049191215547,9,1.21093732194565 -"697",2.04059826759937,0.97968030170058,8,6.58406844006794 -"698",-0.210941290784178,1.96067333428261,3,1.67292609674326 -"699",0.123026575227179,0.0357173890810875,6,-1.8917676898425 -"700",0.457263745818632,1.32195310321604,6,1.94419387756988 -"701",1.45471912942658,-0.904547637790686,7,-0.583213152884497 -"702",0.306496220451413,1.4900587744507,6,2.17007130964781 -"703",0.131243118171996,0.196024465785562,3,0.405549743795837 -"704",1.00067314497927,0.348596831794176,3,1.6263909693794 -"705",0.15218484175558,0.570533392513745,1,1.03713370923853 -"706",2.31427066958454,-0.238868201313994,10,2.57458929982718 -"707",-0.040340585808108,-0.752919349420964,8,0.694497317814719 -"708",-0.950113816442612,1.83927615362147,4,0.285368158926096 -"709",0.75359300005161,0.136418173908133,1,0.400446489402543 -"710",1.31094043846563,-1.13027740552139,2,-0.17737846391646 -"711",1.3150029850319,-0.760953259574814,1,-2.45903206534779 -"712",-1.09488916802881,-0.198519896770327,8,0.663437749408251 -"713",-0.735759155621999,1.45542069623699,7,-0.190885250695426 -"714",-0.559939186460176,-0.0253824721791507,10,-0.432143618801665 -"715",1.242373840153,-0.663671702780165,4,-0.585762977447149 -"716",-0.786921509994017,-0.313717960737493,8,-0.527196956212894 -"717",-0.173344417071297,-0.956984454917467,2,-1.1112120811154 -"718",-0.349319874872649,-0.504717847494268,10,0.180956184938656 -"719",0.122943323033807,0.993211842942488,6,-1.87588423315053 -"720",-0.20210954376181,1.12376249736023,10,4.0257209757733 -"721",1.48927725605979,-0.360634336035539,2,-0.257197958246244 -"722",0.533600386495528,0.561473562742215,8,2.05032116510929 -"723",-0.849406714228057,-0.562842288569624,4,0.599218028401193 -"724",-0.505658327243415,1.66883787378954,6,0.210649120449835 -"725",1.12577237891355,0.982224387634513,8,4.50097628829095 -"726",1.77278307002065,-0.520221987197476,10,1.49506545411667 -"727",-0.10810867553692,-0.612936882149877,10,-1.193885684352 -"728",-1.28140789592503,1.37446353902954,10,0.089135993500314 -"729",1.14446725689517,0.554058265526332,6,3.87158495670679 -"730",0.0736005123935247,0.00175634642870892,6,2.86254363173459 -"731",0.695981027329113,0.300162660149785,7,1.36837277624468 -"732",2.12178723087112,-0.119172488236702,7,1.71321676919635 -"733",-0.39765358655482,0.376190271745471,1,-0.0937853997952604 -"734",-0.54509546141103,-1.79552745919685,8,-0.84509343565674 -"735",0.762000496492378,0.952602576669018,5,1.68061819658147 -"736",-0.541404963497832,0.713819653079573,3,0.717891576185417 -"737",0.497945844176756,0.729029212857816,8,3.78132463613939 -"738",-0.843607398937628,0.0184711595966609,4,0.099847017577588 -"739",0.752697084863413,-0.664655817771323,7,0.567797576792761 -"740",1.26025721964749,-1.18487591090651,9,-1.05510898818436 -"741",-0.8767738737325,1.67203687182479,6,0.484617277680686 -"742",-0.235702910187037,1.70031600494701,6,-0.453053981946627 -"743",0.821474733212109,1.1616598811626,4,3.42380701038033 -"744",-0.722598207952184,0.041120163959091,8,-0.154286233560577 -"745",0.116750777406029,0.00685448468244668,10,0.792473230101751 -"746",-0.376495880058315,-1.54729512231831,7,-1.06552110190022 -"747",1.02617890733717,-1.81167188376705,9,-1.9369313785136 -"748",0.43391946057213,-0.96557503793081,6,-1.28112807515298 -"749",-0.552500293944259,-0.857837863089704,2,0.382619744657761 -"750",0.372735877463658,0.761904790717735,4,2.59663247816519 -"751",-0.820448904346129,-0.279839671550308,2,-1.31187723376992 -"752",-1.29371593507858,1.32556498271754,4,-1.05798112046923 -"753",-0.219494427776434,1.16578971947806,9,1.88464824450765 -"754",-0.415574020112378,1.14980052616707,10,0.999741674065041 -"755",1.18277432545376,0.773998559403173,3,1.84295172058319 -"756",-0.657864569219646,1.23650329000025,5,-0.437931577987662 -"757",0.980642520315888,0.715336813675987,2,2.25678530526854 -"758",-1.10573302580209,-0.300834086611743,9,1.08066798014816 -"759",-0.629575174790453,1.48411417104801,8,2.0018779022662 -"760",-0.409639261475177,0.511758871951387,4,0.67427660209287 -"761",0.0157131237691488,-1.63022188574128,4,-1.93701447519248 -"762",-0.690543517774968,0.974473986024391,5,0.790156892383819 -"763",-0.668995214351474,-0.076380762809997,6,1.42320147328547 -"764",-0.75874761246895,0.114250336751603,3,0.750094963794066 -"765",-0.204228988586943,-0.17795127451797,2,-1.09899256479198 -"766",2.65243962375225,0.136670710319837,5,3.57530827913113 -"767",0.0413946149465712,-1.00804217694122,7,1.61449663322989 -"768",-1.36505497754747,-1.36219159930547,1,-0.642298846583056 -"769",-0.160928790735525,-0.158278804470283,8,1.87274796855844 -"770",-0.115344334643688,-1.98402425168841,3,-2.13034411730488 -"771",-0.223448886112572,-0.430252776227089,1,0.078703368817321 -"772",0.272081131659615,0.419217365742762,5,1.27914967548094 -"773",-0.525144431507194,-0.815329298635589,9,0.917588901141745 -"774",-0.267606207113875,-1.42786893085888,1,-0.600128868175449 -"775",-0.454081020971706,-0.699897639657887,8,-1.30976652510783 -"776",-1.49932045674515,-0.622130913069884,4,-0.749339678356121 -"777",0.789886181412796,-2.14372052050554,2,-3.31908674326367 -"778",-2.27138844804494,0.0795983559765215,8,-0.699803358102836 -"779",3.35667948325458,0.868019324230711,5,7.92817880000425 -"780",0.651483899628308,-0.801103945638158,1,-2.13537535585953 -"781",-0.743870623978481,2.02685931242912,4,0.449342927323386 -"782",1.59084778867392,1.88004392765941,7,7.75865722479173 -"783",-0.831270009462309,-0.396121302496651,5,0.967709038827997 -"784",0.0122589542832629,-0.667730137799061,4,-0.48050810016485 -"785",-0.200591198546626,0.0465735681517102,4,1.18606189289848 -"786",-0.446507581852501,0.627203275492398,3,2.66847690756843 -"787",0.536659246317039,0.171187301212153,1,-0.577519625100582 -"788",1.16957752764235,1.82004834055944,8,4.85072414773543 -"789",1.75784276832699,-0.815010402965882,2,1.53457193567068 -"790",2.04778709865602,1.23936600315493,6,8.11438718553487 -"791",0.483109018347505,-0.407998502160079,8,0.0339144221281549 -"792",1.40319697636016,1.0336569187184,1,4.3280857553015 -"793",2.4293202424917,-0.231955718182691,3,2.02219722741231 -"794",-0.887594188247915,0.820398392123712,4,1.49221939733403 -"795",-0.369780662828941,0.270486823244494,8,0.579004134708692 -"796",1.45390452679811,-0.663975946917227,6,0.902205670641522 -"797",1.27710633232549,-1.33818799457201,3,-1.23590970633646 -"798",0.187729407661738,-0.278895239082723,9,1.75810768654199 -"799",-0.5494222966839,0.334085682314204,6,0.53678853347342 -"800",0.257628036385218,0.806314469980518,10,1.05740578320939 -"801",-0.832905115892041,0.0937285487564789,3,-0.969880816055851 -"802",0.923411182123377,-1.45714941024105,6,-2.44886318449178 -"803",-1.09020205166632,0.383128161156827,3,-1.58547830893952 -"804",2.27547725961033,-1.74404567544604,1,-2.83968839896033 -"805",-0.418610503972877,1.22335815658037,1,2.31284629745389 -"806",0.561256996648435,-0.128818913549865,2,1.12100599106822 -"807",-0.0222545339230154,0.81971307962313,5,3.35292204787703 -"808",-0.494875529056334,0.995872339963837,5,-0.187576704465786 -"809",-0.084985325672898,-0.0656905950687024,4,-1.60199575068127 -"810",0.0191326709647231,-1.11127998195019,8,0.165454405880625 -"811",-0.553945977464511,0.192851072209154,3,-0.0106009906955073 -"812",1.08444933198755,-0.945714618016551,9,0.285208887485482 -"813",-0.177005520776396,-0.335530189523645,1,-1.40117067267559 -"814",-0.0922144436558575,-0.73027283692699,6,-0.257496325957287 -"815",-0.939945468005501,0.195381121154348,8,-0.527714671786827 -"816",-0.0534435866895473,0.208752023976571,10,1.49051504917884 -"817",-0.123492158344636,1.25341432890359,8,2.25427096251491 -"818",1.89997856572953,0.245798229815066,1,3.46126443376855 -"819",0.43939864109772,-1.66308276401729,3,-1.01583926321759 -"820",0.0450711611944747,-0.302475180563874,5,0.857483624081266 -"821",0.606271170237262,0.412296608474569,9,0.715670984893742 -"822",-0.160034802942267,-0.933488085862277,1,-1.67318405739151 -"823",1.60066165234813,0.443257733680721,3,3.48806524171491 -"824",0.430847520417043,0.305598518301066,9,1.84918612485542 -"825",0.305792091150659,0.545730825629394,4,2.2985569484947 -"826",0.0116706698642407,-0.258032586565834,9,1.29395298243351 -"827",-1.18041128838668,-1.91989291255429,8,0.769378957125679 -"828",-0.195403828608392,-0.932433473511318,9,-0.685355797748082 -"829",-0.358449279796069,0.997316191860725,4,-0.496893382441182 -"830",-0.756494056596141,-1.41670140118782,1,-2.56932242264027 -"831",-1.12942887283142,0.172819702593646,8,0.753003705688085 -"832",0.373294645941092,0.156872422819445,3,0.438235308022884 -"833",-0.519190994614289,-0.359025127311882,6,0.101508045836306 -"834",0.537002589397939,-0.702450210416242,1,-0.752931060932697 -"835",-1.737454792007,-1.08052500052906,8,0.756950523670922 -"836",0.546532779394126,0.471508238593225,10,2.2850675567526 -"837",-0.583950145729058,0.719047685472126,10,0.865977230881019 -"838",-0.430459239129651,-0.761866949728267,10,-0.549888893143839 -"839",0.13988928853306,-0.526970863079122,10,0.6671692864853 -"840",0.658055122652299,-0.737357455730962,2,0.68068606581344 -"841",1.14123322657883,-1.37899579230833,10,-0.979298282705539 -"842",0.838142603996954,2.25094582964432,8,5.23581509392519 -"843",0.239103159502406,0.992281547098316,10,-0.23487486761532 -"844",-1.05512101099509,-0.255964361197854,6,-2.16284761982243 -"845",-0.506329898857498,-0.70469880375679,1,-0.0988368179968667 -"846",0.802489370714155,1.06417630796397,5,2.3118682305961 -"847",-0.0742565486574319,-1.80737406779241,10,-0.366793927241808 -"848",-0.796797553051649,-0.640587246091973,5,0.906801880508395 -"849",0.717767602347703,0.0477279546340753,5,0.250877799460086 -"850",0.283887726855073,-1.63478958806475,4,-0.833036054747528 -"851",0.386674679172011,0.0711545757903873,2,0.811624989040689 -"852",-1.44790686740046,0.0871747324008533,8,-0.280998481099246 -"853",-0.764725819287118,0.376913509210123,7,0.350333126739881 -"854",-0.384742206156438,0.58444269117872,8,0.131968215591721 -"855",0.396905247634373,-0.062401790386284,6,-0.832895482317727 -"856",0.00414202303691555,2.3424011556004,9,3.03665680701719 -"857",0.438873688677981,0.324314444975131,7,1.09972689619855 -"858",-1.38495277559284,-0.259769272088355,5,-0.781591166606637 -"859",0.285145790694597,0.223108118452554,3,0.633730715771383 -"860",-0.295691328008107,0.443877259017966,5,0.639574799472992 -"861",1.5182851094871,0.933959683728968,3,3.91000484263771 -"862",-1.60757692002266,0.466405464467682,7,0.26565215368092 -"863",-0.786893794303,0.699361918002147,2,-0.288083623789436 -"864",0.464449312284059,-1.24740299424961,8,-1.74768242020947 -"865",0.777366961839497,-0.626493267124501,2,0.0213713636179993 -"866",-1.52307106170112,0.656260260013508,6,-1.63257157425048 -"867",0.0526077891156051,-0.273285596581132,10,1.32547290964328 -"868",-0.493172849466993,-1.25466933360265,3,-1.40168009382656 -"869",-1.90429674067742,0.020082645756765,4,-3.15112415798538 -"870",0.967855764966475,-0.263564434444205,6,2.20753045147058 -"871",1.06545715477881,2.12633771790074,1,5.68810391849193 -"872",0.967152552229005,-0.2290704506678,4,1.44047972759997 -"873",-0.404831224376307,-1.84961696807581,5,-1.79515301251222 -"874",1.52029132059422,-0.000250148357193684,7,0.915744338781518 -"875",-1.05160073997693,-1.94977930878866,6,0.829476637096843 -"876",0.154710631719933,0.0422008676665303,3,-0.339083831455474 -"877",0.5567794578267,-0.84458416398221,8,-1.7328341455173 -"878",-1.34757335468243,0.027999927720351,9,0.122107966558639 -"879",-0.222692264961485,-0.69210949604488,3,0.188821843541458 -"880",0.576940715290811,0.0872978610936892,7,1.80882265884645 -"881",-0.96743090076875,-0.0989270734011281,7,1.03605653740487 -"882",0.687649056671889,0.936605028264657,2,3.11702629741193 -"883",0.159415247428681,-1.36915155236015,9,0.20144602635809 -"884",-1.41595546038461,0.498248292657794,7,-0.361788994948091 -"885",0.129389938710518,-1.11052832179175,8,-0.179179037572266 -"886",1.65764513571986,1.08350279027688,10,4.01823526241254 -"887",-0.422292893440196,0.108111827462467,10,1.57698815936273 -"888",1.22848456055253,-0.972637882684218,6,-1.80146840498423 -"889",-0.5931875136088,-1.54701031269511,2,0.117859202258786 -"890",0.039017103795865,1.68808180813912,2,2.71590700141599 -"891",-0.673115181089906,1.81265716782971,7,1.80134808312952 -"892",0.0598645456234742,-0.321367741410098,9,-0.461464661149402 -"893",-0.222235466990645,1.07740322395581,5,1.25725215991373 -"894",0.333632779935966,0.648420145735952,3,1.95811575744234 -"895",0.814781680475153,-0.195541131375694,4,0.193677953065517 -"896",0.199090634331752,-0.291258753375675,3,0.407807675615578 -"897",0.0257633100469536,0.291818296614797,2,1.15358029880289 -"898",0.104775884968271,-0.629865460872433,3,0.778610498551166 -"899",-0.596569072540145,-1.34235324917449,3,-2.2748599385393 -"900",-0.532353514309713,0.868782714337629,7,1.76810281376534 -"901",1.52257648778355,0.0311690879401173,9,2.90695779803406 -"902",-0.554005053625839,0.53407280408259,5,-1.35442429303608 -"903",-0.203788966847497,2.27944796273761,9,1.97630173050415 -"904",-1.38241366061851,-0.961890341386246,10,-0.725928555709043 -"905",0.290876633467756,1.13072967833787,2,1.68910804081475 -"906",1.17565552857526,0.063628546758796,9,1.37447714419666 -"907",-0.811556277489342,-1.44435766578959,1,-1.54242737568676 -"908",0.204334415851277,-0.908861236204802,7,-1.41433349340699 -"909",2.66671707069615,0.649716630993249,4,4.79555276912492 -"910",-1.25403956133452,-1.62676215875146,5,-1.12510556537878 -"911",0.0708062313999753,1.52900144947937,4,3.12486763625259 -"912",-1.00007763364368,1.14397471487394,9,0.741532264711136 -"913",0.593511632089577,2.54842033383486,6,4.78743252829673 -"914",-0.391570061471954,-1.18173543693251,2,-2.25647939761445 -"915",0.492043409231117,-0.523635763127414,8,-0.791423540713246 -"916",-0.162075749422906,-0.803915137575018,9,-0.532728541836254 -"917",-1.32596504129879,0.184592831102351,3,-2.98072164047869 -"918",-0.0737031665405331,0.836972866770033,3,1.7254250653806 -"919",0.590221368804112,-1.82799559536703,9,-2.3454128625742 -"920",0.684696986036317,1.00686269894808,1,1.90548773735849 -"921",0.652369796177224,0.0298511728376632,8,1.25367549916389 -"922",0.872512023136244,0.674558714405564,5,4.12233811891994 -"923",-0.490169919133814,-0.985287720968784,8,0.139778496979513 -"924",-0.862375042723717,-0.0150164926695906,2,-0.676270622179383 -"925",0.901166508106872,-0.884421078674736,3,-0.631554147783584 -"926",-1.04054906805276,1.16536939083888,1,0.65511537393702 -"927",0.850381744347908,-1.10972395482426,5,-0.30644908046351 -"928",0.109150888736977,0.234536296697146,1,0.519852086346541 -"929",0.283007036345736,1.1361486151073,2,4.60315226775896 -"930",0.391548762705751,0.00473985119254152,1,2.12310907837721 -"931",0.209635804715791,-0.790618868727908,3,1.16975877631093 -"932",0.934738389189324,0.163054409617923,1,3.03328849315012 -"933",-0.24050523691886,0.125767252409785,7,2.99083381412696 -"934",2.60669801272368,0.482456959279399,3,4.35983843900744 -"935",-0.625044219343813,1.89748350380105,10,0.992692492041071 -"936",-1.67712683619763,-2.15165580391038,5,1.75195596304941 -"937",-0.136819237224344,1.12000992122803,2,1.32017022281832 -"938",-1.42847066858601,1.72943865046034,9,-2.18706299351303 -"939",-2.46512468210772,-1.26271313207466,7,-1.55371115216735 -"940",0.0471242080888588,1.78143679045158,4,3.4689943307471 -"941",-1.1260040491327,0.0749944475026987,3,-0.252519670585218 -"942",-0.410560038408604,0.515030553761151,8,0.397852960197581 -"943",-1.1683340832745,-1.25526355842938,7,-0.733476755010847 -"944",0.109832581288636,-0.286702890149887,10,-0.220242264964885 -"945",0.607427232907138,-0.298937933089676,10,0.346329371951452 -"946",-0.70334619284908,-0.327726815832906,3,-0.984067759343403 -"947",0.0236388800288751,0.979813282845685,5,1.82383870929651 -"948",-0.0540087599057964,-0.718007553980901,4,-0.588247185697606 -"949",0.417534091201704,0.122748160640571,2,0.787472099538204 -"950",1.91361056478969,0.404513825557039,10,5.35150880723713 -"951",-0.512806178149278,-0.406950256259198,3,-1.14825612604529 -"952",0.00658932156959316,0.0514071793426577,1,-0.210031098540053 -"953",0.187765626355029,-0.91880168379205,6,-0.469567719047657 -"954",1.28310845418643,-0.633882556751661,3,-1.11909368148924 -"955",-0.0789628620976275,2.09529673244311,7,2.30046368304789 -"956",0.10082163573614,0.862374243233178,3,1.96779330402992 -"957",0.118124501583438,0.712285767193534,4,0.144798147754498 -"958",-0.733234593574929,-0.775497916334815,5,-1.34791643640825 -"959",0.88870460696219,-0.339945988521473,3,1.92189382016942 -"960",-0.998862158137544,1.86272509654738,4,-1.43286403691859 -"961",1.27232541044919,0.413760089211227,5,2.45801824490692 -"962",-1.60412678346614,0.0674441287177039,5,0.158710889385644 -"963",-1.27143793388917,-1.44018202158898,5,-0.491141452688654 -"964",0.50691658745604,-0.378538587295816,9,-0.128497009328281 -"965",0.279951837367131,-0.508251791477907,4,-1.14644023419184 -"966",0.04661173879292,-1.86894559470505,6,-0.412591742298187 -"967",0.528636740544763,-1.28472848270357,4,-2.10644235749026 -"968",0.606768694290711,-1.52637571403387,8,-1.81559925695155 -"969",1.42056087055482,0.659236178405258,7,3.34741213122443 -"970",0.746770299490112,-0.600172920567861,1,-0.32766289189597 -"971",0.733777738283545,0.296581280252945,3,-0.100314958942628 -"972",-1.1902317392004,-0.381314875671679,10,0.253573508723109 -"973",2.1500584942509,-0.41017353242387,6,-0.191556976328681 -"974",0.00736717621273843,-0.0197096394504448,7,1.88225322446121 -"975",-0.364068453378832,0.711924399286571,1,-0.145023664404411 -"976",0.566606644100632,0.779858165777806,10,4.10359587702819 -"977",0.818221158447681,-1.43468952581007,1,-2.51021223661164 -"978",0.926411703100423,0.274959611590665,7,1.57279187405333 -"979",-0.41801268626191,0.867265669783786,10,-0.588155638029218 -"980",-0.35615811319988,0.737521338186114,6,2.47589090214135 -"981",-0.485980859849582,0.307913146017261,9,1.69822470856195 -"982",0.34165384983757,-1.13205126627537,1,-0.430586814727139 -"983",0.743837530359935,-0.121185278662291,7,0.599303017079953 -"984",0.309886912602096,-0.231014834241575,7,2.69075841292973 -"985",-0.306922901557269,1.40324873196536,1,1.99435376022094 -"986",-0.0015681358462435,-1.36797623464474,2,-0.760896247218017 -"987",0.5922061487634,0.538228044981857,3,1.69264933266601 -"988",0.31710556655374,-2.18335837292269,6,-1.65566858447494 -"989",1.24322589323681,-0.343586133455924,2,0.234432683633644 -"990",2.67637938499405,-0.0686167781013007,4,3.73855959006986 -"991",0.644918618429641,1.90204717330859,10,4.42169332824963 -"992",1.04050088827249,-0.212030042206318,5,2.7779734752507 -"993",-0.689780670614222,-1.25287554013682,2,-0.638269906310125 -"994",-2.5863280313187,-1.18206283008414,9,-0.151736736154889 -"995",-0.449566070538844,0.996945943331482,8,0.883127606433831 -"996",-1.04495523827839,-0.196609900511298,9,0.43576621347413 -"997",0.776655004594877,-0.653620014467421,1,0.356948170591395 -"998",0.5717855483886,1.44064298517909,8,4.63873519739181 -"999",-1.2907715438442,0.239855754124007,10,-0.244723179558281 -"1000",-1.36491974183267,0.682461729045966,2,-0.104137598972925 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/databases/lme4_02.csv r-cran-marginaleffects-0.18.0/inst/tinytest/stata/databases/lme4_02.csv --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/databases/lme4_02.csv 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/databases/lme4_02.csv 1970-01-01 00:00:00.000000000 +0000 @@ -1,1001 +0,0 @@ -"","x1","x2","clus","y" -"1",-0.778662882315158,-0.821763765919608,4,1 -"2",-0.389476395994671,-0.112414630494009,1,1 -"3",-2.03379832900752,0.203047289574292,9,0 -"4",-0.98237310428081,-0.899339840984389,8,0 -"5",0.24789005396548,-0.545537423086653,7,1 -"6",-2.10386462868389,1.05542625221685,5,0 -"7",-0.381418049114699,-0.000970332870110479,5,1 -"8",2.0749198375246,-0.0254832690454242,2,1 -"9",1.02713840744203,1.16911680038037,10,1 -"10",0.473014227994331,0.342427306810894,3,0 -"11",-1.87926319306776,-0.632030392792663,1,0 -"12",-1.23918902637838,-0.517113494160896,8,1 -"13",1.16041860179808,0.107674186685467,2,1 -"14",0.00367129095339639,-1.22038275127464,9,0 -"15",-0.0954520660716631,-0.205296342831117,2,1 -"16",1.79555122839724,-1.1885595755051,1,0 -"17",-1.32213848090178,0.985778720825328,6,0 -"18",-0.276086413135047,-0.826866396853847,5,1 -"19",-0.743976509928317,0.47766147577938,8,1 -"20",-1.07005012512571,-0.895663487899961,2,0 -"21",-0.349525473522315,-0.494808768622646,7,0 -"22",0.8055596608276,-0.932930187624113,2,1 -"23",1.60530166025953,-0.764943064958773,9,1 -"24",1.44759575420154,-0.230166582786849,2,1 -"25",-0.128302224183544,0.343336334605884,3,1 -"26",-0.5389264468092,-2.11542609572049,1,0 -"27",0.391586049634991,0.557201538623796,2,1 -"28",0.879217022827969,1.5065654400341,2,1 -"29",-0.824732092123366,0.398820946466168,10,0 -"30",0.732876423315893,-1.43937734074074,7,0 -"31",-0.664914509804808,-0.509766611909026,9,1 -"32",0.360885549170716,0.253277300460576,6,1 -"33",1.01193095703027,-0.235897423762985,6,1 -"34",-0.235916847667766,2.16914282196854,5,1 -"35",1.35358989309039,-1.10890103556334,9,1 -"36",-0.26863296454849,-0.504195188563122,2,1 -"37",1.0198773683856,2.12957324546402,6,1 -"38",-0.279706499729985,-0.197303641223426,2,1 -"39",-0.61814627835718,-0.860597034962334,9,1 -"40",-0.499273059382934,1.56220391705361,6,1 -"41",-0.153716776819,1.01405993487863,8,1 -"42",1.22086969447182,0.645895076694223,10,1 -"43",-0.669570510350228,-1.10252111082235,6,1 -"44",-1.20966034237399,-0.826544770872034,5,0 -"45",1.02409665487927,1.25649843978807,1,1 -"46",0.603955311488397,1.50092032195651,6,1 -"47",-0.568653469322032,0.000666998465102122,1,0 -"48",-0.891303116590239,-0.880142524357222,8,1 -"49",-2.52514569224268,-2.51931341112456,4,0 -"50",0.589357049230505,-0.00738594164671853,2,0 -"51",-0.653197720907169,-0.0888515585205597,5,1 -"52",-0.661202450558244,-0.895437896006437,7,0 -"53",1.47239097936137,-1.43750709605882,2,0 -"54",0.555527936163091,-1.01395838644301,3,0 -"55",-0.404499203788117,0.226887778624378,5,1 -"56",-0.40325427755792,-0.063151990234333,10,0 -"57",-0.274613706421661,-0.892119442568123,5,0 -"58",-0.214753327971505,1.84041577577878,8,1 -"59",-1.10776353254331,-0.189272283164837,7,0 -"60",-0.288105760866942,2.16860260167573,9,0 -"61",-0.128353900270885,0.582000712409743,2,1 -"62",-0.410252135168874,-1.06582821197148,3,1 -"63",-1.53549327306741,0.0259828113493124,7,0 -"64",0.0910665493425969,0.46337556350463,2,1 -"65",0.999939041073546,0.562161324892267,7,1 -"66",-0.584198981242738,0.177507218930566,7,1 -"67",-0.537551851622726,1.271181317378,4,1 -"68",2.53780305805831,0.145397175880351,5,1 -"69",0.523437911520408,-0.612678713025022,3,1 -"70",0.122860178305925,0.338646126512125,7,1 -"71",-0.145532668438184,-0.282024165942082,5,0 -"72",-0.0161885005048631,0.543043618857391,5,0 -"73",1.95260529097045,0.862501583049216,6,1 -"74",0.236512168023379,-0.275951175693269,8,1 -"75",-0.19148060596561,-0.447400526033559,4,0 -"76",0.682746936293101,-0.79189735159117,6,1 -"77",-0.709136159493205,0.64311922908144,1,0 -"78",0.296700066170208,-1.87300993609173,7,0 -"79",0.138082422173348,-0.773620397471361,7,1 -"80",-0.776498101972313,-1.13856900241836,9,1 -"81",0.619185644318058,0.881983547903861,7,1 -"82",1.090561796584,-1.2168666207799,9,1 -"83",-1.13979505394065,-0.296096907670778,1,1 -"84",-0.484360085171958,-0.587759576581027,7,0 -"85",-1.61326266169757,-0.921260572455329,3,1 -"86",0.57886911502236,1.00849294982214,2,1 -"87",0.101392523591792,0.282645813175638,8,1 -"88",-0.239313538467,-0.723269636510722,2,0 -"89",0.390178689548306,-0.0395830103808312,2,1 -"90",0.976457026120621,-0.981988163879284,4,1 -"91",0.179160920551552,0.439172221732656,9,1 -"92",-1.39694348661244,0.635155366511218,1,1 -"93",-1.28662271443852,-2.87074888952726,8,0 -"94",1.88604475381625,-0.538597099163435,5,1 -"95",-0.356995059940192,1.64320831323608,3,1 -"96",0.685259697938012,-0.0819985569483218,4,1 -"97",0.409335335611831,1.37906838637498,9,1 -"98",1.44144797948714,-0.445865595918116,6,1 -"99",-0.0286612567452046,-0.488129158432901,6,1 -"100",-0.43673305217259,0.298525182960541,5,1 -"101",-0.202030536231507,0.739552586897595,4,1 -"102",-0.4642161091742,-1.24868057353553,5,1 -"103",-0.506149886100606,-1.53462773212403,6,1 -"104",1.52132525123901,-0.511864093619648,5,0 -"105",0.400900287702186,-0.65620940381304,8,0 -"106",0.322050953432231,-0.794629120276673,10,0 -"107",-2.17045728206746,-2.64999939431659,9,1 -"108",-0.526502063786925,-0.829046744218432,10,0 -"109",-1.42700632032016,0.840007181675812,1,0 -"110",0.215813367627617,1.84961332775431,3,1 -"111",0.617343490333244,-0.230899025682867,7,1 -"112",0.000215456524867078,0.666448591861969,1,0 -"113",-3.33051527361684,0.623078882543703,9,0 -"114",1.76803375536927,0.513387154574217,4,1 -"115",1.34161389601703,0.0300704604649434,8,1 -"116",-0.587775364493114,-0.434686714407421,10,1 -"117",-0.792448885753515,-0.417911555728596,1,0 -"118",-0.673002643139923,1.65669504263755,8,1 -"119",-2.00696943552075,0.327667259987275,2,0 -"120",-1.18923370357108,-1.56993017502034,5,1 -"121",-0.634576389076701,0.380326774743709,2,0 -"122",1.17320987144636,-0.0964904189708176,5,1 -"123",1.62816862385047,-3.04540188444662,5,0 -"124",-0.107148237356947,-1.16496328141184,7,0 -"125",2.24328913114731,0.33755914009297,9,1 -"126",0.433265765636371,1.38518869678797,5,1 -"127",0.149319609621561,-0.170986386390743,5,0 -"128",-0.923589673140757,-0.0149456618633856,1,0 -"129",0.908212938775237,1.05957510696306,3,1 -"130",-1.01913201320175,0.11689624192241,9,1 -"131",-0.413162453112035,-0.0157708954031432,6,0 -"132",-0.644150942537356,0.837618957000217,2,1 -"133",-0.119113530291335,0.687119436366597,10,1 -"134",-1.56671274945802,0.739914606394229,6,0 -"135",0.248797752726242,0.282227744245668,1,1 -"136",-1.87318208649165,-0.765515372432108,10,1 -"137",1.02930889584371,0.085498378991871,7,1 -"138",-1.81377700865334,0.745180694282767,5,0 -"139",-1.21890414451281,-1.01732601698317,5,0 -"140",0.101659715322984,1.56232401202031,4,1 -"141",-1.48252050458786,-1.082544056642,6,0 -"142",0.520505243380355,-0.581736602657165,2,0 -"143",0.51965007323974,0.578733374085025,1,1 -"144",-0.354081952476422,-0.175549788212122,10,0 -"145",-0.104605577111384,1.10954025427728,7,1 -"146",-0.217953983879542,0.400917804186556,10,0 -"147",-1.07586995287838,-0.333523687892511,8,1 -"148",-1.21141408068435,-1.67567897788754,10,1 -"149",-0.861479231583593,1.54578180092702,4,0 -"150",-0.981833037124269,0.348740027225072,9,0 -"151",1.70253017917675,0.332919929592649,7,1 -"152",-0.612301413496714,0.553730636544625,2,1 -"153",0.770904477239149,0.125934463310778,3,1 -"154",-1.4963834996248,1.16089071520869,2,1 -"155",0.426173305463845,1.36084227703027,7,1 -"156",0.506520589609078,-0.749004998877769,1,0 -"157",-0.402254445861418,-0.121100224638262,8,0 -"158",-1.52164280824141,0.0857292618623114,5,1 -"159",0.318632549854711,0.340043795445834,2,1 -"160",-0.845578215171646,-1.13232075953528,1,1 -"161",1.42536917512663,-0.358695947541251,4,1 -"162",0.113438114298031,1.46788787557197,9,1 -"163",-1.66029276763543,-0.321837878119368,10,0 -"164",-0.635260026663986,0.218417782119726,1,1 -"165",0.407892399260653,1.47326859936386,9,1 -"166",0.393642402410984,0.598713629762105,10,1 -"167",0.938967821669026,-0.186922061068738,6,0 -"168",-0.812029379617591,-0.529963044677585,8,0 -"169",1.47162497824168,-0.551407882670509,3,1 -"170",2.76398904835723,0.881168764819008,4,1 -"171",-0.525242416865056,-1.67885854380206,5,0 -"172",0.623358667982617,1.63808530772157,5,1 -"173",0.3206507377008,0.246222690802417,4,0 -"174",0.60264543902644,0.528229593728524,8,1 -"175",0.864699041599908,-0.280875739143049,6,1 -"176",-0.250680655993702,0.0018577793857119,9,1 -"177",0.27561580307981,-1.08193318757053,3,0 -"178",-0.626474395993982,-1.5585099152408,2,0 -"179",0.747592561125489,0.109713964555858,8,1 -"180",1.55617297045723,-0.0533614572357878,9,1 -"181",2.37559841859215,-1.14136494001348,2,1 -"182",0.432128866470571,-1.61585526603988,8,0 -"183",0.251647216249616,1.28578669527186,3,1 -"184",0.618183189854304,0.860901041458128,2,0 -"185",-2.98954999873783,0.851668972812747,4,0 -"186",-0.936377582862676,-0.57767996404706,5,0 -"187",-0.46643226091757,1.21318701380942,10,1 -"188",-1.45800854647517,-1.23613063429736,9,0 -"189",0.858649183062411,-0.417221975976014,8,1 -"190",0.488378517199767,-0.888739128990458,1,1 -"191",0.450449596353791,1.04115935830616,3,1 -"192",1.00503889060621,-0.472940050205381,9,1 -"193",0.0252720003705792,0.324229315402579,7,1 -"194",0.927532071690324,0.0145700802115937,8,1 -"195",1.07692551017613,-2.50214622640895,9,0 -"196",-0.529475025728339,-0.529621065791162,9,0 -"197",-0.127071570693339,1.54503631348764,6,1 -"198",-0.432626228905172,0.397032083998406,6,0 -"199",0.0717762297506202,0.192350819914209,10,1 -"200",-2.21048541990544,0.267878899088242,10,1 -"201",1.45589015709214,-1.11382300522776,2,0 -"202",-1.33330782601085,0.283455411524231,5,0 -"203",0.585184780554489,1.55103903163727,8,1 -"204",0.219826559853572,-1.33820417585332,6,0 -"205",-1.20162417490982,0.653367207490122,2,0 -"206",-0.658923457155579,0.653586746056276,5,0 -"207",-0.283547523495872,-0.158111546321633,4,1 -"208",-0.506610634681369,-0.0198840038200355,6,1 -"209",-0.65060671085628,-0.170822519367757,7,1 -"210",-1.90926103946984,-0.215230509330014,10,0 -"211",-0.193024413599919,-0.0862979832470208,5,1 -"212",-0.657789843839456,-0.738263178300426,1,0 -"213",-0.562508743159869,-1.2350240791275,5,1 -"214",-0.307606692030078,0.915271446240001,9,1 -"215",0.797007385204724,-1.33827709567146,3,0 -"216",-1.26852642934111,-1.43126931709628,1,0 -"217",1.59003291144473,2.69801779843062,1,1 -"218",-0.239162324884694,-0.419988732609617,2,0 -"219",0.306146117040677,-1.90800296816053,4,0 -"220",-2.82952996381451,0.425141453171131,9,0 -"221",-0.407890744975198,0.592644788343994,6,0 -"222",-1.23526673551268,0.00409544482573077,7,1 -"223",-1.11005342531247,-1.0632733552996,1,0 -"224",0.555448681049129,-0.576449191732296,5,1 -"225",-1.01869886310815,0.983181590529458,7,0 -"226",0.0227813153000504,0.0255682651473158,5,1 -"227",-1.31326760508005,-0.223558187886129,4,0 -"228",0.378292394300563,0.700466819144318,2,1 -"229",0.38766601887839,0.777293021480817,4,1 -"230",0.362271155549616,0.317398674853668,6,1 -"231",0.77701820311675,-0.821957965273003,7,1 -"232",-0.115982600392705,-0.213470785148272,4,0 -"233",0.528274069891124,-0.164811453050937,1,1 -"234",-0.70225643471866,1.1087114144447,4,0 -"235",0.705744123672494,0.462691794540491,3,1 -"236",0.27324481592634,1.00018385761806,4,1 -"237",-2.44986908086446,1.05380112711312,8,0 -"238",0.887982609141164,0.585572812530208,7,1 -"239",0.756244836306627,0.125261241066786,8,0 -"240",1.16503427032462,1.18146660525952,7,1 -"241",-0.801246676891149,0.433344796386658,8,0 -"242",0.78208633141738,1.15337965432169,6,1 -"243",-0.229086053782735,1.6780635249057,4,1 -"244",-0.947411498162179,-0.884964663637748,1,0 -"245",2.74513187003413,-1.44840095746284,1,0 -"246",-0.0672180919747193,0.441010101023576,2,0 -"247",1.61434565324273,-0.0150538399980248,6,1 -"248",-0.609006692266319,0.558882538949894,7,1 -"249",0.345255645806633,-0.86588891881631,1,1 -"250",0.335556608130169,-0.9555916417832,10,0 -"251",-0.0353568337281219,1.29817117241151,7,1 -"252",1.69654683325744,-1.62566096434758,6,0 -"253",-0.592046573526372,1.3482673488017,1,1 -"254",-2.22450516515894,-0.725858512216694,8,1 -"255",-0.310175745650351,-1.75822522847988,8,0 -"256",1.28946620308571,-1.75307054660062,9,0 -"257",-1.66450447349055,-1.86674249227783,4,0 -"258",0.866050052401549,1.48970184433685,7,1 -"259",0.580154148220369,1.49002377489796,8,1 -"260",-1.15996492372227,0.0760822315199553,2,0 -"261",-1.4135490212867,0.598501026661244,8,0 -"262",1.44908972591402,-0.809364572164417,10,1 -"263",0.550652506096172,-1.30781381831632,1,0 -"264",-0.000381354593243598,0.0981108376786251,6,1 -"265",-0.223688531137314,1.52328171887439,7,1 -"266",0.0864283593319198,-1.22460843169713,7,0 -"267",2.73046635098785,-0.16731496458152,9,1 -"268",1.1090271886914,-0.185130490321572,5,1 -"269",-0.187438237403035,-1.11197634397539,2,0 -"270",0.864439033227915,-1.38846747503899,5,0 -"271",0.914180585874431,-1.59261580943547,7,1 -"272",-0.869367184686422,-2.15997523174827,2,0 -"273",1.39679342809022,-0.431920952797845,3,0 -"274",-0.488223949579367,-0.407611274416912,4,0 -"275",1.2774222801648,0.556615349847067,2,1 -"276",0.275323899540435,1.24037481993386,9,1 -"277",-0.439494097949117,-1.65211682470615,2,1 -"278",0.511242654594633,-0.538319159722425,1,1 -"279",-0.0133304082289264,-1.15511875212006,5,1 -"280",-0.496381459586184,-0.584948901366027,8,0 -"281",-0.943905078093567,-0.282180476884172,5,1 -"282",-0.360463647678627,0.477566345534474,3,1 -"283",-0.355892762129758,-0.511713568835265,3,0 -"284",-1.40935634303394,-2.02490925935563,2,1 -"285",0.548406405219068,-0.919546733143711,9,0 -"286",0.664259937761144,-0.562594187625465,10,1 -"287",1.1484296237298,0.0687151674498556,10,1 -"288",-0.131982802386373,1.46642693862034,2,0 -"289",0.529085890054213,0.527161321046996,8,1 -"290",0.0834730100267859,-1.2379292028033,5,0 -"291",0.693649991552134,1.47265444442123,3,1 -"292",-1.52981483923141,-1.37528827095086,5,1 -"293",-0.257241301267302,0.759706020460509,7,0 -"294",-0.752695124043647,-0.856157331846675,2,1 -"295",-0.208211155027271,0.00458964982979717,5,1 -"296",1.02080762523956,-0.378607327498318,3,0 -"297",0.512869966250792,1.13711415005677,7,1 -"298",-1.30137933169705,-1.35857658476835,4,0 -"299",0.462317981189377,0.839573811344507,3,1 -"300",1.61723126699447,-0.110299896850166,2,1 -"301",0.527622026363768,1.93738916178446,2,1 -"302",-0.989574829378576,-0.212267296712533,7,0 -"303",-1.79368611715366,0.597953715317227,4,1 -"304",-0.113139770971905,2.30997083650405,8,1 -"305",0.139198178579192,-0.216997315502666,8,1 -"306",-1.43378005468625,0.25617934864418,7,1 -"307",0.281844984626276,1.17191101415091,5,1 -"308",0.991804217657327,-0.343110755731505,3,1 -"309",-1.50217393351827,0.811720558915575,9,0 -"310",-0.736120709821281,0.961161273674919,5,0 -"311",1.00273877411346,-0.165073607329177,5,1 -"312",0.627464414979069,0.382024782926287,9,1 -"313",-0.648166394819188,1.3793395881144,7,1 -"314",-1.21832024033578,-0.149021327275232,7,1 -"315",0.665777482649052,-0.986344356377205,2,0 -"316",0.949085135970289,0.768480674955537,1,1 -"317",1.19285015844731,0.166130826457766,2,1 -"318",0.567487182762954,0.0890155926663752,10,1 -"319",0.354952158713781,0.990865517569636,2,1 -"320",-0.563368442916638,-1.48380193773918,6,1 -"321",0.80748620334544,-0.946009175976642,9,1 -"322",0.805772221879847,-0.646416736792736,7,1 -"323",1.01624711966414,0.685110747220849,7,1 -"324",0.328444099070125,-0.918692608604216,4,0 -"325",-0.518241711924565,-0.801677230754172,5,0 -"326",-1.59050950888449,-0.848831910725255,9,0 -"327",-0.295515062496251,1.9331639520952,1,1 -"328",-1.00544322857019,-0.430369237740307,4,1 -"329",-1.20297643877351,1.89825769208662,2,0 -"330",0.0213018390738087,-1.08369898433487,10,0 -"331",2.12425195362803,-0.485176807627352,7,1 -"332",-0.734453028560038,-0.904390659728007,3,0 -"333",-0.738593585161585,0.597466717213841,8,0 -"334",0.256704523097346,-0.754359996252216,7,0 -"335",-1.25387980063062,-0.828941752058956,4,1 -"336",-0.809645317412326,-1.7423905805246,3,0 -"337",-0.324254408437198,-1.13399104785774,7,0 -"338",-0.435726619730485,0.383690605560142,2,0 -"339",0.668080432308133,-1.43980745725908,7,0 -"340",-0.210242541851873,-0.779287154412264,9,0 -"341",-0.413900327301294,2.11343577831819,8,1 -"342",2.16742820416279,1.0501713794481,1,1 -"343",-0.0891334340433657,0.292497117095824,7,1 -"344",0.297396012311165,0.565077225321086,6,1 -"345",-2.25736526189196,1.61601083574075,6,0 -"346",0.858432986599026,-0.849927171787254,1,0 -"347",0.722828983375002,-0.0541732830086925,8,1 -"348",-0.680158947327035,0.888413355070859,4,1 -"349",1.39929915548555,1.04068866283977,4,1 -"350",-0.212957098711349,-0.504594573408255,8,0 -"351",1.41076416329637,-1.2674229152147,4,0 -"352",0.516238174049297,0.153627665221627,5,1 -"353",-1.19752132424905,0.926574145383066,6,1 -"354",-0.627404438631094,-1.11661350328703,5,0 -"355",0.204599995100945,-0.184913374845365,3,0 -"356",-2.2838675275714,1.46505826283152,9,0 -"357",1.09610855516093,0.69986301133628,9,1 -"358",0.574492638490543,0.452902337231445,2,1 -"359",-1.10700924790858,-0.732099622181591,6,0 -"360",0.0865993129891947,-0.897486909870685,10,0 -"361",1.08504088814865,0.0676012376286,5,1 -"362",-0.768341269443185,0.340601679393273,3,0 -"363",1.57883741538097,-0.458287953093124,5,1 -"364",2.01630292044563,0.0489755328540765,7,1 -"365",0.091714671642784,-0.945769904015874,9,0 -"366",-1.00867099278225,0.108822266679475,6,0 -"367",-0.403615247558847,0.505310508553114,5,1 -"368",1.31326998390506,-1.47100662227239,5,0 -"369",-0.669263457386315,0.538746632221266,2,0 -"370",0.430326991687063,0.628275915401739,2,1 -"371",0.0718331420841894,-0.574773288783181,8,0 -"372",-0.507223032480274,-0.072074057830991,6,0 -"373",-0.553247741873631,-2.03793771491985,8,0 -"374",0.663898648246702,0.315569211030175,8,1 -"375",0.193722562487217,0.32909273924725,2,1 -"376",0.564418562415695,1.56552222664692,8,1 -"377",-2.12645652421679,1.43609854322817,10,0 -"378",0.876169578104667,0.723077168567295,6,1 -"379",-0.185362714172563,-0.333276770864238,5,0 -"380",0.135816310759156,0.892431546724513,8,1 -"381",2.21425744972552,0.118103900511844,3,1 -"382",-0.991705073030258,0.594021030966335,8,0 -"383",0.579781273928898,-0.94725060136016,5,0 -"384",2.35874162540294,-1.63001004945368,6,0 -"385",-1.42989015626551,0.0883094275762383,1,0 -"386",-1.25271610463425,1.16562436815775,8,0 -"387",-0.706233973416408,0.045493495147319,3,1 -"388",0.634608282180412,-1.54014135951435,3,1 -"389",1.23547154304423,-0.225740243359048,8,1 -"390",0.528661817408422,0.498442350895543,4,1 -"391",0.84442705435786,-0.586499507744158,1,0 -"392",-0.627652126242939,-0.522419742233868,4,0 -"393",0.347091613543875,-0.995221686134877,7,0 -"394",-1.06684415578986,0.645078456529164,3,1 -"395",0.592268133735176,-0.456105278840379,1,1 -"396",0.157891396854969,1.13334554097471,4,1 -"397",-0.356683577162962,-0.243744902734488,7,1 -"398",0.332617095141721,-0.493906230445285,6,1 -"399",0.267629012845972,-0.976825602794744,9,1 -"400",1.12131478232171,-1.33083409815943,2,0 -"401",1.45705145843815,2.32152580259574,1,1 -"402",1.73413937134612,1.42974290703878,8,1 -"403",0.808212952262217,1.08608951408035,5,1 -"404",0.164032087270602,-0.834886408410295,1,0 -"405",0.21761567210472,-1.80734389374982,6,0 -"406",0.880244883694794,-1.24913887802549,3,0 -"407",0.560578188028527,0.714468591884666,10,1 -"408",-0.574336653882468,1.88554175850262,3,0 -"409",-0.985664883665825,1.18397104634821,1,0 -"410",-0.0932099830289401,-0.0553671319788362,2,1 -"411",0.57216150020392,-1.14778052475501,3,1 -"412",-1.09898625648019,0.264449175548062,4,0 -"413",0.906126591149744,-1.61717353974068,3,0 -"414",-1.45556176747542,-0.198907639005909,5,0 -"415",-1.79151547272549,-0.0313254755476226,3,1 -"416",0.395568377881538,-1.11154208680647,1,0 -"417",0.822480282092486,0.556584527061073,6,1 -"418",1.2504063384519,-0.330726571269553,4,1 -"419",-2.37097017479241,-1.42466881396708,8,1 -"420",0.662976885250469,2.23936185141829,10,1 -"421",-0.760187912006092,-0.413186002248303,3,1 -"422",0.345161790757064,0.126796643141707,9,1 -"423",-1.23573066460401,-2.33404415888488,8,1 -"424",-2.10426496295859,-0.50981529742021,1,0 -"425",-0.374216233214262,0.0414720277488919,2,1 -"426",-1.96870746946676,0.503193434949282,5,0 -"427",0.170989519198167,-0.303552046600689,3,0 -"428",-1.70633865716114,0.171508443586208,8,0 -"429",-0.257956976269078,-1.83292783175551,9,1 -"430",-0.472996234133306,0.795467320676614,4,0 -"431",1.74115720974096,-0.962669979083566,2,0 -"432",-1.52645905258892,1.46269675277124,4,0 -"433",-0.197284826989132,-0.19501096446166,10,1 -"434",0.65672990174925,-0.518034939270991,5,1 -"435",0.647571552037267,-0.00463418740127366,1,1 -"436",-0.247570630809423,-0.904071767375255,9,0 -"437",0.141127704895448,-0.668961008917137,9,1 -"438",0.396566669217545,-1.00140157502642,2,0 -"439",-0.772813707551997,0.29970680762646,1,0 -"440",-0.153873422766281,2.43758067411111,3,1 -"441",2.26841836394745,0.00890926004800664,1,1 -"442",-1.80425420095102,1.61299399887491,9,0 -"443",1.13248571370294,-0.971888527365188,5,1 -"444",-1.00809617009944,-0.682531333858913,2,0 -"445",-1.11237889280941,-0.209819213765443,3,0 -"446",-2.32598106657515,2.0770132713822,4,0 -"447",-1.46849741710747,0.123576647894908,1,0 -"448",-0.770069853766748,-1.56111482731484,2,0 -"449",2.12118489071435,1.13297510791021,10,1 -"450",-0.407801287691335,-1.76570904615028,1,0 -"451",-2.05048980184485,-1.83376066365264,10,1 -"452",-0.0521346364441553,-0.523148824732239,8,1 -"453",-0.201251589347537,0.56789932298091,4,0 -"454",-1.40868878621107,1.17763495869735,7,1 -"455",1.36763748432042,-0.738096041003538,5,1 -"456",0.0679771985765997,0.207057581193109,4,1 -"457",0.020725806846714,-0.952020337110541,7,0 -"458",-0.339506058106594,-1.61626422122446,7,0 -"459",0.445869809361787,-0.36109322298337,1,1 -"460",0.0920699352333119,0.32790091988096,8,0 -"461",1.78024380400676,1.69432748882804,3,1 -"462",0.129124446014311,-0.100990009644121,5,0 -"463",-1.59107161061211,0.370403100557718,4,0 -"464",0.767532493626476,0.793272158833193,10,1 -"465",-1.16102782735812,0.432442320860876,10,0 -"466",-0.228618196634798,-1.43962385173374,1,0 -"467",0.649115123865292,-0.541731955956272,2,0 -"468",-0.355954658789513,1.03317377748367,6,1 -"469",-1.94707656599741,0.317094120693319,5,0 -"470",-1.38876709510521,-1.37049448422864,6,1 -"471",0.0726947299234645,-1.17088404836164,10,1 -"472",0.14534271890045,-2.09061812451603,2,0 -"473",-0.351231564246903,0.672089685079316,7,0 -"474",0.135691845601405,-0.514264828261834,2,1 -"475",-0.197966135533904,0.956461118400688,3,0 -"476",-0.646709757708405,2.64720302310365,10,1 -"477",0.455847264186397,-0.515744067295105,9,1 -"478",-0.939386941038692,0.772318221851802,8,0 -"479",0.68310750522823,0.23104116741239,2,1 -"480",0.613812717702589,-0.138516227736858,5,0 -"481",1.04795228902247,1.997037392695,10,1 -"482",-0.572572658309798,1.32826273543788,1,0 -"483",-0.052459066636626,1.15869735956154,6,1 -"484",0.70567122354581,0.596384423501237,7,1 -"485",-1.02570570283446,0.0927124471782075,3,0 -"486",0.267215913973285,-0.35909871528411,5,1 -"487",0.331059707641147,-1.0920584166762,5,0 -"488",-2.46312929424425,0.123303121903337,3,0 -"489",0.310622095959927,-0.249175918164244,8,1 -"490",-1.10133947414506,0.209191742285228,6,1 -"491",-1.65508797954254,-0.0356865228186643,3,0 -"492",0.690357979120451,0.255712287241303,4,1 -"493",0.169653344478785,-1.10446291522989,3,1 -"494",-2.05504461928005,-0.616965928198265,6,0 -"495",0.400968162761324,0.327600348934149,9,1 -"496",0.440354267087702,0.637827836694495,2,1 -"497",0.93806808858404,0.402259825558317,8,1 -"498",0.353741201490983,-2.54379288992807,10,0 -"499",0.859260813932912,1.47532492639916,2,1 -"500",0.312276028528479,-1.21435618644702,8,1 -"501",1.26239349524758,0.202520433212229,8,1 -"502",1.43612371622389,0.0894152218670725,5,1 -"503",1.62919666896976,0.119621688596362,5,1 -"504",-0.342014601723723,1.85416857895404,5,1 -"505",0.426295616162467,-1.1616329575041,10,0 -"506",0.413856286005835,0.483906024662718,9,1 -"507",1.39793407044548,-0.197132293570078,6,1 -"508",-0.373137179690724,-0.996971242763174,9,1 -"509",1.59038871852067,0.277885369241664,7,1 -"510",3.05560012823532,-0.0555681821452812,5,1 -"511",-0.422944801794694,-1.42459110312602,6,1 -"512",-0.203695522584914,-0.314373387665352,8,0 -"513",0.433999068449688,-1.43320424864349,10,1 -"514",0.337304430710627,0.0764948148741274,2,1 -"515",0.676687321422021,0.0453702786721454,1,0 -"516",-0.893854535602691,0.932598561037984,2,1 -"517",-0.0593686378680841,1.86959104818522,1,1 -"518",-0.658507713787768,-1.07498275909995,2,1 -"519",-1.28123785036108,-0.193005304984624,2,0 -"520",-0.147663933551981,-0.726945844329436,3,1 -"521",-0.302855157373189,0.648255840432392,4,1 -"522",0.308763504685862,-1.17939624562991,8,1 -"523",1.04351060614156,0.323011293092442,10,1 -"524",-0.593304957692859,0.237110560244998,8,1 -"525",1.38136164532482,-0.275838750923472,8,0 -"526",0.717232745873662,0.493953205369244,1,1 -"527",-0.905179427348091,0.425886831416598,2,1 -"528",0.212187283369523,-1.67720881714288,5,0 -"529",-1.74036483612467,-2.26635104811488,6,0 -"530",1.69701946897843,-0.31624987270193,4,1 -"531",0.686958862417022,-0.222490739736492,2,1 -"532",1.73831597094449,0.487656648677973,10,1 -"533",1.3102598741256,-0.0458705799607275,10,1 -"534",-0.256085527688691,-0.186478084399075,8,0 -"535",-1.10528948667234,-0.314434775503562,4,0 -"536",0.41269699339251,1.16189384300136,2,1 -"537",-1.17558886986598,0.200842942427544,5,0 -"538",0.662098671141772,1.51738682923441,1,0 -"539",0.586790962506448,-0.900461335829062,7,0 -"540",0.661591231920992,0.403857674963118,6,0 -"541",-0.14084875791113,-1.26404799188301,4,1 -"542",0.883191219178237,0.743238952757195,4,0 -"543",0.897042543994944,-0.454856595566193,6,1 -"544",0.828781863901072,0.532667882737376,5,1 -"545",-0.262067660837744,-0.945249909690996,7,1 -"546",0.0578063511468649,-0.531062108654398,9,0 -"547",0.0243008814556507,-2.11222819075732,8,0 -"548",-0.574245619267998,0.106703388520439,4,0 -"549",-1.11368938675092,-1.00313059125545,5,0 -"550",-0.0601127114462057,-1.08444033541766,9,0 -"551",1.71026629443157,-0.279386018080383,4,1 -"552",0.305549534118966,-0.834523217043838,2,0 -"553",-1.42744021211767,-1.7186388257823,1,1 -"554",1.81445134592683,-0.336976892828455,3,1 -"555",-0.487756783697309,0.0952130982072471,1,0 -"556",0.602295223629145,0.249132422956942,9,1 -"557",0.755850602345463,-0.159416315428505,1,0 -"558",0.862575921556095,-0.0102436018013483,10,1 -"559",-1.70007424710661,0.279765192452063,9,0 -"560",1.02217744037973,-1.01683887895417,5,0 -"561",0.386717469202568,-0.776598407627646,10,0 -"562",1.45017519236196,-1.05567683460375,5,0 -"563",2.29557296944144,0.0810763396632004,9,1 -"564",-0.968079810632171,-0.153792228395213,5,0 -"565",0.659366586531093,-0.220901271813686,6,1 -"566",-0.713979943572449,-0.214378147206809,4,1 -"567",0.367456463791077,0.640832268474424,8,1 -"568",0.0531833556211878,-0.819941138929749,8,1 -"569",1.84163146771472,0.617369659340786,9,1 -"570",-1.01582653009321,0.317684717876524,9,1 -"571",-0.355721583707165,-2.36409256240668,1,0 -"572",1.21905739078094,0.96373107792981,10,1 -"573",-1.98293931328204,0.298726864459803,10,0 -"574",-1.78619947778288,-0.0951390329213102,10,0 -"575",1.5502486731894,-0.329871621313376,10,1 -"576",0.103255333055064,1.86591320296114,9,1 -"577",1.77663148146474,1.11061514865844,8,1 -"578",-1.15078782484055,0.274946498616231,3,0 -"579",0.982836606895121,0.0748500285150689,2,1 -"580",0.14795269896141,-0.718247365791861,2,0 -"581",1.60738538280655,0.821099483599144,10,1 -"582",-0.520388380331408,0.619402633294212,3,1 -"583",-0.00496187469422831,0.0336455095089909,8,1 -"584",-1.46152428809083,-1.23351038940464,6,0 -"585",-0.669407249581795,-1.09597442444652,6,0 -"586",0.800957796014399,-0.807499857906529,9,0 -"587",-1.64319937363744,-0.537624749405528,1,0 -"588",1.57841874021401,-2.11641670664995,7,0 -"589",-0.350312454369682,0.353168877754319,10,1 -"590",0.611392680913446,2.06563656021762,9,1 -"591",1.4812254595327,-0.825631014772726,9,1 -"592",-1.5869578486432,-0.714149679345729,5,1 -"593",-1.05576245567578,-0.63129464156981,2,0 -"594",-1.19631146950654,0.241262940100415,4,0 -"595",0.137503818364021,-0.00723877108477896,7,0 -"596",-0.37733433690237,2.25778394956145,8,1 -"597",0.297862243022396,1.27316096845121,8,1 -"598",0.669726506061738,0.200967177826617,5,1 -"599",0.42118804446301,-0.708283652014327,10,1 -"600",-2.25595797078558,-0.043027658844046,8,0 -"601",-1.54887814428841,-1.30491136559282,7,0 -"602",-0.94872436483153,0.694803233789366,1,1 -"603",-0.837446424593806,-2.21545825698281,8,1 -"604",1.3476389861661,0.901801810608865,1,1 -"605",0.518488218885538,0.415030957276283,9,0 -"606",-0.460404387866283,1.35254445043896,3,1 -"607",-0.574062577372949,1.27782400680122,2,1 -"608",0.912416041917393,0.42283602201918,2,1 -"609",1.26396686143064,1.68342036117214,4,1 -"610",-1.36139776019218,-0.434497587143112,9,0 -"611",-1.16764148931887,-2.41695725341738,8,0 -"612",-0.00172018508809658,-0.517517721463917,10,0 -"613",-0.78103282156489,-1.32888995928337,7,0 -"614",-0.0585471692000637,0.13117082960268,3,0 -"615",1.69244528593605,-1.02901587373941,8,1 -"616",0.661528570057517,0.59640748980066,6,1 -"617",0.597441889918121,-0.279469611444308,3,1 -"618",-0.713913216019525,0.649206741752714,4,1 -"619",-0.206409147887496,-0.112374848154809,6,1 -"620",1.33651925428898,-0.188662467245284,7,0 -"621",2.33232846720642,-0.271000863638774,6,1 -"622",-1.65634074995286,-1.00008862991153,4,1 -"623",0.0255226465884277,0.606737330219328,8,1 -"624",-0.203982712715149,0.94306693843977,9,0 -"625",2.83694295432275,-0.306840886815886,10,1 -"626",1.13674989864642,0.63436026023182,1,1 -"627",-0.850331067572843,0.372440071821406,1,0 -"628",0.866215614337994,0.895703231310655,6,1 -"629",-1.45416459642389,-0.504120892849785,9,0 -"630",0.628593992406751,-0.279037613577049,6,1 -"631",-0.325886416372589,1.4145470392338,1,1 -"632",-1.30942878697473,1.81937929226531,5,0 -"633",0.0483476098058967,0.871257224470347,10,1 -"634",0.57240358864324,-0.863958452918056,7,0 -"635",0.4834928659008,-0.315368230582718,8,0 -"636",0.044303651156692,0.266853167583346,4,0 -"637",1.86036860555908,-0.863358291341998,1,1 -"638",-0.56466464911017,0.76645218707906,6,1 -"639",1.94879011997364,-0.399844005845577,1,1 -"640",-1.57160388517485,-0.611798125775915,5,1 -"641",0.325749824305948,0.521845805067756,4,1 -"642",-0.0935997605090974,0.107525553031054,7,1 -"643",0.872544135663942,1.83154578293297,1,1 -"644",1.43266846738863,-0.542430452400733,1,0 -"645",0.198216845867484,0.53613351989094,1,1 -"646",-1.90860873810729,1.19195761657141,2,0 -"647",-0.552538121558726,0.200193796003359,10,1 -"648",-0.483942978321644,-0.393289226696855,6,1 -"649",-0.286675777048388,-0.387105031679176,8,1 -"650",0.270189755449151,-0.45601394257268,1,0 -"651",-1.48405441803662,1.15228124844852,2,0 -"652",-0.0925916084126851,-0.344721496802792,5,0 -"653",-0.624597651285322,-0.271315142271292,9,1 -"654",1.13996709386237,-0.763023744671282,6,1 -"655",-0.766663024614312,0.302945419061369,5,1 -"656",-0.869959661611112,-0.915272517781153,6,0 -"657",-0.108052874044599,0.029465199089871,7,1 -"658",0.934759282646399,-0.788494839674656,5,1 -"659",1.32077018937942,-1.49612924354295,7,1 -"660",0.0738702511879958,0.866229373612298,9,1 -"661",-1.6208748445883,1.1596325358284,9,0 -"662",-0.628013223008121,-0.446057752797345,2,0 -"663",-0.47845452517421,1.77310990524093,5,0 -"664",0.589688548509235,-1.62257201920331,10,0 -"665",0.340934083486875,-1.52161097564046,3,1 -"666",0.576181569150956,0.252000574605259,4,1 -"667",-1.60419359887055,-0.648761578144092,2,0 -"668",1.34174797870115,1.82663303028123,9,1 -"669",0.692780119198355,0.360604154281169,3,1 -"670",1.41451851573147,-0.088837821968904,8,1 -"671",-1.38528188226849,-2.07860341026875,10,1 -"672",-0.444775462340823,0.840886355783806,6,1 -"673",-1.88263867879803,1.26187066021448,4,0 -"674",0.55626358966112,0.104711632861857,10,1 -"675",2.00259918047965,0.881368402858011,1,1 -"676",0.0208938444201812,0.354932228589358,6,1 -"677",-0.013554536605561,-0.458487988075648,4,0 -"678",-0.697955079474553,-2.33721442416169,9,0 -"679",-0.379156124081866,-0.208699291195645,3,0 -"680",0.384459466065392,1.06913446070485,7,1 -"681",2.73858857585052,-0.373033439626453,10,0 -"682",0.00544559333967241,-0.453426236395124,4,0 -"683",-0.878210140670026,-0.575382561023387,5,1 -"684",-0.907921121004535,0.668261066745674,6,1 -"685",-1.29517822686284,-0.200291691285624,8,1 -"686",0.143671601749781,-0.834749868444918,6,1 -"687",-0.911962649437428,1.02102544554161,8,0 -"688",0.718717400312881,-0.0752213217097831,3,1 -"689",-0.39508946206033,1.01235090614436,8,0 -"690",0.480721661622209,1.14222095562862,6,1 -"691",0.572278535874582,1.64604848896414,7,1 -"692",0.212915583561228,1.56831510977838,3,1 -"693",-1.48425896549528,0.263388231687147,4,0 -"694",-0.476186718295973,-0.204820373995618,4,1 -"695",-1.61970272088853,-1.37751159750921,4,0 -"696",-1.72422354262787,-1.37520529835799,4,1 -"697",0.195557290144131,-0.508767859410625,6,1 -"698",-2.13042108946384,-0.0439939997539797,9,0 -"699",-1.47004842331765,1.83519039749203,7,0 -"700",-0.196823065874698,0.484399167936318,4,1 -"701",1.611246108035,1.1696301414588,4,1 -"702",-0.785078316163952,-0.36234210719507,5,0 -"703",1.01640995927516,-0.46044801942311,5,0 -"704",0.664141699138114,-0.330411173164975,6,1 -"705",1.506393934306,1.77158229900391,3,1 -"706",-1.91245844479511,-0.352000817553817,8,0 -"707",0.723100146504584,1.58118649524434,3,1 -"708",-0.354601975757796,0.282379155267718,1,1 -"709",1.42472044318175,-0.582205248787019,4,1 -"710",0.959385126262147,0.518755913915588,10,1 -"711",0.470204892150714,-1.43815446264246,2,0 -"712",0.855545501894272,-0.80031581736675,9,1 -"713",0.0494345562992139,-1.0980611073568,8,0 -"714",-0.76595642181342,1.1159834609898,2,0 -"715",0.244596936754339,-1.28695864333422,4,0 -"716",-0.0137545835262385,0.635196890098678,1,1 -"717",0.148729705771486,-0.4226460817474,8,1 -"718",-0.116544890857083,-0.935172127884626,5,1 -"719",1.00194885771187,-0.163310915162857,6,1 -"720",0.573399854710655,-1.11018144916345,2,1 -"721",1.05106888809394,1.10318071383029,7,1 -"722",-0.607372617353057,0.391307381573071,1,0 -"723",-0.0033791300679578,-2.03301786740132,9,0 -"724",-0.0681120948388709,1.48836779026561,7,0 -"725",-0.127501909032217,-1.07018349377449,6,1 -"726",0.313719667974031,-0.256103439695586,2,0 -"727",0.141030351795183,-0.97523247526224,7,0 -"728",-0.409250521304824,-0.44726104163289,8,0 -"729",0.724898338309844,-0.709943124685737,2,1 -"730",-0.976191974301124,-0.749036979564225,7,1 -"731",-1.37852459094363,0.280116066564837,2,0 -"732",-0.456174385546362,0.837507355134136,10,1 -"733",0.137417947466113,0.856684492543148,6,1 -"734",-0.0821599229829143,-0.58824016462148,10,1 -"735",0.486418286955778,-0.618499817845401,1,0 -"736",0.14001412226468,-0.189887755978141,2,1 -"737",-0.0329079709055259,0.528653224749263,8,1 -"738",0.560051799413555,-1.86153734736827,3,1 -"739",-0.89708430557682,1.64403492908729,6,0 -"740",1.04376473415745,-2.33141028073173,5,0 -"741",-1.02170517268626,1.04145141018306,5,0 -"742",1.53222167571916,-0.644633888999618,7,1 -"743",-0.465892357729519,0.263051585854995,8,0 -"744",0.676101512011969,0.485250756899248,8,1 -"745",-0.328695258379981,1.66539554681286,5,1 -"746",0.336411620509025,-0.56434363110008,10,0 -"747",-1.42336437217898,-0.979543544617163,10,1 -"748",-0.572853827577909,-0.141400896180547,7,1 -"749",0.907451021283607,1.46426245861552,8,1 -"750",0.871451244237605,1.7215989544432,1,1 -"751",1.25291663210567,-2.57515677372912,3,0 -"752",-0.217446102739174,1.1472986236969,9,1 -"753",0.297010500095485,-1.68546155206185,4,0 -"754",0.44823692188772,-0.45244834120684,2,0 -"755",-1.23532481503483,1.39777469593924,7,1 -"756",-0.346497933624256,0.59834245169152,5,0 -"757",1.46564301534806,0.486553320621174,3,1 -"758",-0.203552529526414,0.845516527243271,9,1 -"759",-1.55705690138816,-1.45169466878814,5,0 -"760",0.0393304199568157,-0.328238790278862,6,0 -"761",0.833763689718112,-1.21492452869847,7,0 -"762",0.637904177415278,-1.14346018852961,3,0 -"763",0.368611054350419,1.37748982250395,9,1 -"764",-1.00197932291587,2.09000074459351,9,0 -"765",1.08027793146119,-0.782324681322973,6,1 -"766",0.796028644627923,-0.231568373206475,2,1 -"767",-0.745913090171105,-1.97467518642819,3,1 -"768",2.47345571812327,1.09092747350133,10,1 -"769",0.279106548836449,0.712118731884942,1,1 -"770",0.277019315597527,-0.746759342331299,7,0 -"771",1.16730431078923,-0.34333925646651,8,1 -"772",0.29482982588556,-0.777127731445244,5,0 -"773",0.484809568911923,-2.664319535519,8,0 -"774",-0.0140183107764543,-0.116589745345368,1,0 -"775",0.166802502951232,-1.78005121421292,7,1 -"776",0.885956291697468,-1.72164781614837,7,0 -"777",0.221169329748631,0.19595784188672,3,1 -"778",-1.13764381390168,0.573425129421667,10,0 -"779",0.00838561349268831,0.505932889420561,1,1 -"780",-0.758581955341018,-0.0766804081513039,8,1 -"781",-0.290659660657329,0.636261018399834,10,1 -"782",-0.217778356192507,-0.97939770576289,5,0 -"783",0.497839456274715,-0.155789017115583,2,1 -"784",-1.8607720457932,0.0338947246052668,7,0 -"785",0.0134408697833298,3.29876120044358,1,1 -"786",1.56899455704785,-1.62934515311617,7,0 -"787",0.651028942338217,-1.06923012064838,5,0 -"788",1.43973363712772,-0.35520196361563,6,0 -"789",0.351006830130886,0.635452781251784,1,1 -"790",0.753802049743564,0.372399372910318,4,1 -"791",1.35828981426012,0.271527246645388,2,1 -"792",1.42777135267608,0.569400280521031,3,1 -"793",1.0646301392967,-1.60836922295487,5,0 -"794",-0.923445675707155,-0.00414760012025685,6,0 -"795",0.664420003725144,0.0489565889292447,7,1 -"796",0.20487850356357,0.594292615065095,1,0 -"797",0.64424940596102,0.353793466363318,10,1 -"798",-1.82798703235459,-1.58008675249134,3,0 -"799",0.999960365327386,-2.21094117158656,9,0 -"800",0.291960987597538,0.449945682771834,8,1 -"801",1.78048737379516,-1.16328206323162,7,1 -"802",-1.0085366243564,1.14170765418922,10,1 -"803",-1.25682127357229,-0.0828253070507757,8,0 -"804",-0.66808958735226,-0.45460858748664,2,1 -"805",1.9649629209436,-0.543650702182644,7,1 -"806",0.378645504182204,-0.311116774768613,2,1 -"807",-0.199799695842948,-0.933814460246155,10,0 -"808",0.681041669479449,1.83868506848057,1,1 -"809",-0.584910739597662,-0.61451000339161,2,1 -"810",1.27938158128828,0.196521998348757,1,1 -"811",0.39480906198216,-0.10044276499293,3,1 -"812",0.528457189205411,2.05441654330112,6,1 -"813",-0.101874939034311,0.00355395149146674,4,1 -"814",0.245184000742171,-0.379309998355836,3,0 -"815",0.0375600796196692,-0.422059489812202,8,1 -"816",-1.97697729278522,-1.08542865447718,10,1 -"817",-0.751155073558556,-0.313622619959154,4,0 -"818",-0.321923301707331,0.944578058469263,8,1 -"819",1.83992839936162,0.603413554420052,5,1 -"820",1.59988432825062,-1.89518766884239,9,0 -"821",1.03580145341133,-0.660329920639936,4,0 -"822",-0.914775339877636,1.02120180217403,4,0 -"823",-0.38960094478535,-0.17054160494051,10,1 -"824",1.67412708271352,0.506775299359289,8,1 -"825",-0.428386225231452,-0.368285959920411,2,1 -"826",0.699531303945007,-0.240724779809204,3,0 -"827",-0.585415728200367,0.801423344781039,1,0 -"828",0.333743495648911,-0.150419151489665,9,1 -"829",-0.580209388399422,0.88205652161633,8,1 -"830",0.440529550529015,-0.689607139726694,1,1 -"831",0.0220880920204526,0.604126771728143,2,0 -"832",1.35546379769105,-0.829238373613371,10,0 -"833",0.457935330165318,0.681855681178763,5,1 -"834",0.273198252776944,-0.422177345694823,9,1 -"835",-0.89190974900482,-0.744345836551257,5,1 -"836",0.541512982388185,0.306695387968279,6,0 -"837",-0.389409672141027,1.05258171577851,9,1 -"838",0.854540661130416,0.561910680584452,7,1 -"839",-0.0791248312855369,0.219500228666292,6,1 -"840",1.62237407508983,-0.513394164497109,2,1 -"841",0.863139157007668,0.864946913967385,9,1 -"842",0.615369033044237,-1.13182983640843,8,0 -"843",-0.439605422408609,-0.908498461697273,7,0 -"844",0.712542051608273,-2.74100324997747,10,0 -"845",0.679626087740748,1.16376536203817,6,1 -"846",1.06328878685229,-0.581181746524241,9,1 -"847",-0.296800280380022,0.107501745425586,4,1 -"848",0.347910544172021,1.03815364136543,8,1 -"849",0.107836217306277,1.19730976980802,6,1 -"850",-0.841394837777399,0.55273219696204,7,0 -"851",-0.626065231291288,-0.36015202222399,3,0 -"852",-1.12152774645535,1.11507227597342,9,1 -"853",1.78030859596195,-1.52565303601814,3,0 -"854",1.21110546104195,-0.073074221984822,6,0 -"855",0.517081824867224,-0.00876748154336742,10,1 -"856",0.277053820700554,0.73356444696547,4,1 -"857",-0.181757170165,0.275238080199174,3,1 -"858",-0.480640416051078,1.20182458284579,10,1 -"859",-0.185141328166873,-1.11536824621347,5,0 -"860",-0.696310997321937,0.358787519901801,3,0 -"861",-0.477740490616974,-1.28394180279717,8,0 -"862",-0.286661347150748,-0.224140265832123,6,1 -"863",-1.81443578115377,0.5451174936621,8,0 -"864",1.11947848613579,0.344254221144445,1,1 -"865",-1.37647136936541,-1.04939611532417,7,0 -"866",1.23085576123594,-0.0315635119536457,6,1 -"867",1.78986376768754,0.283657187882573,7,1 -"868",-0.151850143638071,-1.36057275771299,10,0 -"869",-1.02195154917629,-1.02681078721759,6,0 -"870",-2.16849331198394,-2.72552010761634,3,1 -"871",1.04619695134914,-0.611344679830938,7,0 -"872",0.615367573680465,0.779451566567553,4,1 -"873",-1.14320575657984,1.92164137268233,8,0 -"874",-0.465532049661422,0.486115464699338,7,1 -"875",-2.11315247006788,-0.167298571756325,10,1 -"876",0.613110115042833,-0.753843407216961,1,1 -"877",0.234523673997803,-0.33577146517928,10,0 -"878",0.642761468998484,0.336247297824452,5,1 -"879",-0.378377748164569,0.153388380029115,1,1 -"880",0.30774857758838,-0.420841862892832,9,1 -"881",-0.244251404122837,1.36294340696902,3,1 -"882",0.560258421702272,-0.760980658054936,7,1 -"883",0.638191122845986,-0.476004237431193,2,0 -"884",0.496493586013738,-0.189412058848928,6,1 -"885",-0.00667094460110748,-1.00395010567499,3,0 -"886",1.62291673502245,0.706530090917624,2,1 -"887",-0.247406918315675,-2.33998325722604,8,1 -"888",0.736599439190133,-0.231097740720185,2,0 -"889",-0.938457749076716,0.891376017172157,1,0 -"890",-0.677819215264912,1.25185885750271,7,0 -"891",-0.464445766393475,-0.898657123434108,6,1 -"892",0.468453518802418,-1.75391121215935,7,0 -"893",-1.32714837691464,-0.616600112469501,1,0 -"894",0.0438787811022741,0.36746760758669,9,1 -"895",0.918470372118645,0.774383644622371,1,1 -"896",-0.147103740378553,1.54228361293328,9,1 -"897",-0.51881525632591,1.5004020217127,8,1 -"898",0.297680682952142,-0.721709898049661,8,1 -"899",-0.894565012073268,-0.969072723137849,6,0 -"900",0.259522256975565,0.0926767211775757,2,0 -"901",-1.67408229304129,0.294848724459793,1,0 -"902",1.00987232912551,-1.9257765322872,3,0 -"903",-0.574954987826279,0.153438647876134,4,0 -"904",0.312449253285899,-0.513428233307596,6,1 -"905",-0.0725053805672113,1.33254706431008,6,0 -"906",0.48489635115217,-0.660271641010172,4,0 -"907",2.24219655299806,-1.65416399114415,7,0 -"908",0.238595607639832,-1.20265979940866,2,0 -"909",0.295925204022819,-2.59996507867719,10,0 -"910",0.535589169016755,-1.09006029558183,5,0 -"911",0.469955772796592,0.972984326070239,8,1 -"912",0.529146072089825,0.368470261962385,1,1 -"913",0.22234986396658,0.985506011105209,7,1 -"914",1.35778961003162,-0.440874279210114,2,1 -"915",-0.645164198769991,-0.275042672572972,7,1 -"916",1.58949535689314,-0.515028685049688,8,1 -"917",0.193760667068258,-0.628093906215966,6,0 -"918",-1.34861047482725,-1.27538676882531,9,1 -"919",1.29961495488222,0.168949621675588,3,0 -"920",2.38001957036285,-2.05068689394562,5,0 -"921",-1.26545549138196,-0.651084527279601,3,0 -"922",-0.460202346554631,2.03347835364478,7,1 -"923",-1.13711389064948,0.20193690888732,6,0 -"924",0.243117711981482,0.82092409198349,10,1 -"925",0.845646361868832,0.937593597921916,6,1 -"926",-0.187759721892899,0.876300658981683,4,1 -"927",-1.57653577405296,-0.125179883453471,4,0 -"928",-0.992657208003783,0.810323364248117,7,1 -"929",-0.479257416711327,-1.772583753883,8,1 -"930",-0.654786905858442,-0.00144776397245733,6,0 -"931",0.903297910129634,0.508427120673305,7,1 -"932",-0.124562417133962,-0.0833589625592377,3,0 -"933",-0.140084921118523,0.129318142612313,9,1 -"934",1.34963231887827,2.52997229261579,2,1 -"935",-0.877349302593479,0.624821856259561,7,1 -"936",0.74852577892557,1.90520215528525,8,1 -"937",0.667496883678518,0.282622272955664,2,0 -"938",1.14012226895058,0.581437916363865,10,1 -"939",0.39099624937282,0.684944491259834,6,1 -"940",0.190316216304085,-1.06680532296583,5,1 -"941",0.201347056008359,-0.625163343129629,8,1 -"942",-1.12995010084315,0.998081585435669,1,0 -"943",0.768642090665606,1.48132651467869,1,1 -"944",-0.462017421772084,-0.292478950758808,3,1 -"945",0.892552471080123,0.444266453544344,3,1 -"946",-0.454411239355722,1.36971424949624,6,0 -"947",1.29764124281327,-0.402077311591257,7,1 -"948",-0.268732337977947,0.567338416730429,9,1 -"949",-0.186769283481612,-0.481551060289479,9,1 -"950",-1.90996245799697,2.52884186916396,10,1 -"951",-1.72286066655655,-0.462913366870959,8,0 -"952",-1.30195776452724,-0.903574937519432,2,0 -"953",-0.838285040458432,-1.54512482199128,5,0 -"954",-3.35605461058033,-1.36406903912809,3,1 -"955",0.734555842992035,0.451905584196765,6,1 -"956",1.23977391322679,0.844070243627766,10,1 -"957",1.05562456637041,2.55440473193715,1,1 -"958",-0.352588462728402,-0.259952651104351,7,1 -"959",-1.09671517559011,1.73802338019808,6,0 -"960",-1.30450116054182,0.50525709028685,9,0 -"961",-0.345686988678291,0.556526912877533,5,1 -"962",0.49614108302063,0.713587842937539,9,1 -"963",-0.239192764184251,-0.538558698842734,7,0 -"964",-0.445309912671866,1.84233996014795,4,1 -"965",0.0888544326645125,0.459202419720294,4,1 -"966",0.771258081572015,-0.286159620208699,10,1 -"967",-0.767787730403098,0.537288953802504,10,1 -"968",-0.546629584232326,-0.166029717063729,8,1 -"969",0.896668196799084,0.0739944079509917,3,1 -"970",-0.20057869631381,-1.16814252355766,1,0 -"971",-0.514982997742738,-0.179053008511304,5,1 -"972",-1.27330667836535,2.50235589348172,5,0 -"973",-1.35562676727321,1.46796386180907,7,0 -"974",-0.678974806388467,1.13434560301537,9,1 -"975",0.51535445718745,0.265359374619848,2,1 -"976",0.31726165260558,0.592731393718031,8,1 -"977",0.406692030523417,-2.12921899804122,9,1 -"978",0.990913752021094,0.0106715598016732,7,1 -"979",0.205918620698753,3.12168825012533,3,1 -"980",1.21385641522395,0.725920584050406,8,1 -"981",-0.210047862904661,-0.840741044896276,7,1 -"982",0.699211081866472,1.54444951013521,3,1 -"983",-1.29420330811734,-0.283691864147048,5,1 -"984",0.086738285330508,-0.496546564229769,7,0 -"985",-1.38645931503039,-1.87758105674454,6,0 -"986",-0.896596077167893,0.852920063220944,10,0 -"987",1.95633286365741,0.206362334375767,2,1 -"988",-1.6389111009144,0.21050869768123,4,1 -"989",-1.41589145135932,0.650320872694805,3,0 -"990",-0.62853060148301,0.728547583001271,10,1 -"991",0.967636601917303,-0.559275700610185,8,1 -"992",-1.35439671655797,0.576003659671985,8,1 -"993",0.414737948955044,0.176523367018452,2,0 -"994",-1.34463558145073,-0.779703595548175,10,1 -"995",0.20191407693169,-0.505715434934774,3,0 -"996",-0.537124349961687,-0.845945422356641,8,1 -"997",1.32314626753398,-0.543292808092304,9,1 -"998",-0.619610416056987,0.242765404843852,6,1 -"999",0.484140923610859,0.852950371094532,9,0 -"1000",0.961974778647751,1.34986514143191,2,1 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/databases/quantreg_rq.xls r-cran-marginaleffects-0.18.0/inst/tinytest/stata/databases/quantreg_rq.xls --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/databases/quantreg_rq.xls 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/databases/quantreg_rq.xls 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -FalseFalse(1)(2)y1VARIABLEScoefsehp-0.01495629140.0138772521wt-3.47788e+000.88062307766.cyl-3.04890e+001.90459790618.cyl-4.30437e+002.6386449006Observations32
FalseFalse
\ No newline at end of file diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/databases/stats_glm_01.csv r-cran-marginaleffects-0.18.0/inst/tinytest/stata/databases/stats_glm_01.csv --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/databases/stats_glm_01.csv 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/databases/stats_glm_01.csv 1970-01-01 00:00:00.000000000 +0000 @@ -1,101 +0,0 @@ -"","x1","x2","y" -"1",-0.778662882315158,-0.202030536231507,1 -"2",-0.389476395994671,-0.4642161091742,0 -"3",-2.03379832900752,-0.506149886100606,0 -"4",-0.98237310428081,1.52132525123901,0 -"5",0.24789005396548,0.400900287702186,0 -"6",-2.10386462868389,0.322050953432231,0 -"7",-0.381418049114699,-2.17045728206746,0 -"8",2.0749198375246,-0.526502063786925,0 -"9",1.02713840744203,-1.42700632032016,0 -"10",0.473014227994331,0.215813367627617,0 -"11",-1.87926319306776,0.617343490333244,0 -"12",-1.23918902637838,0.000215456524867078,0 -"13",1.16041860179808,-3.33051527361684,0 -"14",0.00367129095339639,1.76803375536927,1 -"15",-0.0954520660716631,1.34161389601703,1 -"16",1.79555122839724,-0.587775364493114,1 -"17",-1.32213848090178,-0.792448885753515,0 -"18",-0.276086413135047,-0.673002643139923,0 -"19",-0.743976509928317,-2.00696943552075,0 -"20",-1.07005012512571,-1.18923370357108,1 -"21",-0.349525473522315,-0.634576389076701,0 -"22",0.8055596608276,1.17320987144636,1 -"23",1.60530166025953,1.62816862385047,1 -"24",1.44759575420154,-0.107148237356947,1 -"25",-0.128302224183544,2.24328913114731,1 -"26",-0.5389264468092,0.433265765636371,1 -"27",0.391586049634991,0.149319609621561,1 -"28",0.879217022827969,-0.923589673140757,0 -"29",-0.824732092123366,0.908212938775237,1 -"30",0.732876423315893,-1.01913201320175,0 -"31",-0.664914509804808,-0.413162453112035,0 -"32",0.360885549170716,-0.644150942537356,1 -"33",1.01193095703027,-0.119113530291335,0 -"34",-0.235916847667766,-1.56671274945802,0 -"35",1.35358989309039,0.248797752726242,1 -"36",-0.26863296454849,-1.87318208649165,0 -"37",1.0198773683856,1.02930889584371,1 -"38",-0.279706499729985,-1.81377700865334,1 -"39",-0.61814627835718,-1.21890414451281,0 -"40",-0.499273059382934,0.101659715322984,0 -"41",-0.153716776819,-1.48252050458786,0 -"42",1.22086969447182,0.520505243380355,1 -"43",-0.669570510350228,0.51965007323974,0 -"44",-1.20966034237399,-0.354081952476422,1 -"45",1.02409665487927,-0.104605577111384,1 -"46",0.603955311488397,-0.217953983879542,1 -"47",-0.568653469322032,-1.07586995287838,0 -"48",-0.891303116590239,-1.21141408068435,1 -"49",-2.52514569224268,-0.861479231583593,0 -"50",0.589357049230505,-0.981833037124269,0 -"51",-0.653197720907169,1.70253017917675,0 -"52",-0.661202450558244,-0.612301413496714,1 -"53",1.47239097936137,0.770904477239149,1 -"54",0.555527936163091,-1.4963834996248,0 -"55",-0.404499203788117,0.426173305463845,1 -"56",-0.40325427755792,0.506520589609078,0 -"57",-0.274613706421661,-0.402254445861418,1 -"58",-0.214753327971505,-1.52164280824141,0 -"59",-1.10776353254331,0.318632549854711,0 -"60",-0.288105760866942,-0.845578215171646,1 -"61",-0.128353900270885,1.42536917512663,0 -"62",-0.410252135168874,0.113438114298031,0 -"63",-1.53549327306741,-1.66029276763543,0 -"64",0.0910665493425969,-0.635260026663986,0 -"65",0.999939041073546,0.407892399260653,1 -"66",-0.584198981242738,0.393642402410984,0 -"67",-0.537551851622726,0.938967821669026,0 -"68",2.53780305805831,-0.812029379617591,0 -"69",0.523437911520408,1.47162497824168,1 -"70",0.122860178305925,2.76398904835723,0 -"71",-0.145532668438184,-0.525242416865056,0 -"72",-0.0161885005048631,0.623358667982617,1 -"73",1.95260529097045,0.3206507377008,1 -"74",0.236512168023379,0.60264543902644,1 -"75",-0.19148060596561,0.864699041599908,0 -"76",0.682746936293101,-0.250680655993702,0 -"77",-0.709136159493205,0.27561580307981,1 -"78",0.296700066170208,-0.626474395993982,0 -"79",0.138082422173348,0.747592561125489,0 -"80",-0.776498101972313,1.55617297045723,0 -"81",0.619185644318058,2.37559841859215,1 -"82",1.090561796584,0.432128866470571,1 -"83",-1.13979505394065,0.251647216249616,1 -"84",-0.484360085171958,0.618183189854304,1 -"85",-1.61326266169757,-2.98954999873783,1 -"86",0.57886911502236,-0.936377582862676,0 -"87",0.101392523591792,-0.46643226091757,0 -"88",-0.239313538467,-1.45800854647517,0 -"89",0.390178689548306,0.858649183062411,0 -"90",0.976457026120621,0.488378517199767,1 -"91",0.179160920551552,0.450449596353791,1 -"92",-1.39694348661244,1.00503889060621,0 -"93",-1.28662271443852,0.0252720003705792,1 -"94",1.88604475381625,0.927532071690324,1 -"95",-0.356995059940192,1.07692551017613,1 -"96",0.685259697938012,-0.529475025728339,0 -"97",0.409335335611831,-0.127071570693339,0 -"98",1.44144797948714,-0.432626228905172,1 -"99",-0.0286612567452046,0.0717762297506202,0 -"100",-0.43673305217259,-2.21048541990544,0 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/databases/stats_lm_01.csv r-cran-marginaleffects-0.18.0/inst/tinytest/stata/databases/stats_lm_01.csv --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/databases/stats_lm_01.csv 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/databases/stats_lm_01.csv 1970-01-01 00:00:00.000000000 +0000 @@ -1,101 +0,0 @@ -"","x1","x2","y" -"1",-0.778662882315158,-0.202030536231507,0.632510418203176 -"2",-0.389476395994671,-0.4642161091742,-2.00619911401589 -"3",-2.03379832900752,-0.506149886100606,-0.925356641974877 -"4",-0.98237310428081,1.52132525123901,-0.735730302868677 -"5",0.24789005396548,0.400900287702186,-0.453454639288886 -"6",-2.10386462868389,0.322050953432231,-3.11828874196723 -"7",-0.381418049114699,-2.17045728206746,-2.00757127246507 -"8",2.0749198375246,-0.526502063786925,-0.0506424375928305 -"9",1.02713840744203,-1.42700632032016,-2.51620762299777 -"10",0.473014227994331,0.215813367627617,-1.11835065036866 -"11",-1.87926319306776,0.617343490333244,-2.61509501519769 -"12",-1.23918902637838,0.000215456524867078,-1.89703040505424 -"13",1.16041860179808,-3.33051527361684,-6.59739729205624 -"14",0.00367129095339639,1.76803375536927,1.47058932062397 -"15",-0.0954520660716631,1.34161389601703,1.91510939690481 -"16",1.79555122839724,-0.587775364493114,-1.11613134317423 -"17",-1.32213848090178,-0.792448885753515,0.523172710791893 -"18",-0.276086413135047,-0.673002643139923,-1.00244449538476 -"19",-0.743976509928317,-2.00696943552075,-0.951661712236858 -"20",-1.07005012512571,-1.18923370357108,-3.81627411920135 -"21",-0.349525473522315,-0.634576389076701,-1.1701919946961 -"22",0.8055596608276,1.17320987144636,1.6885933428832 -"23",1.60530166025953,1.62816862385047,4.73711865384717 -"24",1.44759575420154,-0.107148237356947,1.74078886442563 -"25",-0.128302224183544,2.24328913114731,0.808469058842654 -"26",-0.5389264468092,0.433265765636371,-0.316377745471255 -"27",0.391586049634991,0.149319609621561,-0.713890469758753 -"28",0.879217022827969,-0.923589673140757,-0.478116018745698 -"29",-0.824732092123366,0.908212938775237,-0.277885491559351 -"30",0.732876423315893,-1.01913201320175,-0.670882259058258 -"31",-0.664914509804808,-0.413162453112035,-0.0263410498193526 -"32",0.360885549170716,-0.644150942537356,-0.631712760405773 -"33",1.01193095703027,-0.119113530291335,1.30055682792709 -"34",-0.235916847667766,-1.56671274945802,-2.13527209879141 -"35",1.35358989309039,0.248797752726242,2.64490189300298 -"36",-0.26863296454849,-1.87318208649165,-1.36537177808042 -"37",1.0198773683856,1.02930889584371,0.649086031313816 -"38",-0.279706499729985,-1.81377700865334,-0.698175680861009 -"39",-0.61814627835718,-1.21890414451281,-0.327344525958628 -"40",-0.499273059382934,0.101659715322984,0.716664969179367 -"41",-0.153716776819,-1.48252050458786,-2.20959568476468 -"42",1.22086969447182,0.520505243380355,3.1589303467263 -"43",-0.669570510350228,0.51965007323974,-0.726948855635889 -"44",-1.20966034237399,-0.354081952476422,-2.08283489715151 -"45",1.02409665487927,-0.104605577111384,3.55749672620053 -"46",0.603955311488397,-0.217953983879542,0.18714876941003 -"47",-0.568653469322032,-1.07586995287838,0.581619412285942 -"48",-0.891303116590239,-1.21141408068435,-1.63198674394565 -"49",-2.52514569224268,-0.861479231583593,-0.866008707429795 -"50",0.589357049230505,-0.981833037124269,-0.635569601360178 -"51",-0.653197720907169,1.70253017917675,-0.0981132082724669 -"52",-0.661202450558244,-0.612301413496714,0.827898164286782 -"53",1.47239097936137,0.770904477239149,2.78632168131036 -"54",0.555527936163091,-1.4963834996248,-3.99664356587571 -"55",-0.404499203788117,0.426173305463845,-0.460888406710499 -"56",-0.40325427755792,0.506520589609078,1.18847592070585 -"57",-0.274613706421661,-0.402254445861418,-2.23090804147103 -"58",-0.214753327971505,-1.52164280824141,-0.543568226757613 -"59",-1.10776353254331,0.318632549854711,-0.56194635347857 -"60",-0.288105760866942,-0.845578215171646,-2.05003294470632 -"61",-0.128353900270885,1.42536917512663,-0.299485439384357 -"62",-0.410252135168874,0.113438114298031,1.10573747644287 -"63",-1.53549327306741,-1.66029276763543,-0.0957651585799943 -"64",0.0910665493425969,-0.635260026663986,-0.602425770478207 -"65",0.999939041073546,0.407892399260653,1.59201044377477 -"66",-0.584198981242738,0.393642402410984,-0.334093709962274 -"67",-0.537551851622726,0.938967821669026,2.62713842988181 -"68",2.53780305805831,-0.812029379617591,0.774030224305404 -"69",0.523437911520408,1.47162497824168,2.57792895751114 -"70",0.122860178305925,2.76398904835723,4.09087244720787 -"71",-0.145532668438184,-0.525242416865056,0.319845431074483 -"72",-0.0161885005048631,0.623358667982617,-0.272288259320015 -"73",1.95260529097045,0.3206507377008,4.29615378374963 -"74",0.236512168023379,0.60264543902644,0.493466636803995 -"75",-0.19148060596561,0.864699041599908,1.78506761933567 -"76",0.682746936293101,-0.250680655993702,0.536238729972189 -"77",-0.709136159493205,0.27561580307981,-1.06846358645416 -"78",0.296700066170208,-0.626474395993982,-0.00440666997449723 -"79",0.138082422173348,0.747592561125489,0.975573966708895 -"80",-0.776498101972313,1.55617297045723,-0.925071949001922 -"81",0.619185644318058,2.37559841859215,3.52181542227358 -"82",1.090561796584,0.432128866470571,1.6334902483499 -"83",-1.13979505394065,0.251647216249616,-1.53086685224004 -"84",-0.484360085171958,0.618183189854304,-1.5749565008413 -"85",-1.61326266169757,-2.98954999873783,0.768523133025429 -"86",0.57886911502236,-0.936377582862676,-0.235288592797665 -"87",0.101392523591792,-0.46643226091757,0.736097142384966 -"88",-0.239313538467,-1.45800854647517,-1.48038370295645 -"89",0.390178689548306,0.858649183062411,2.11294037569394 -"90",0.976457026120621,0.488378517199767,2.02518918787326 -"91",0.179160920551552,0.450449596353791,1.4039634728023 -"92",-1.39694348661244,1.00503889060621,-3.32570196726219 -"93",-1.28662271443852,0.0252720003705792,-1.55110754505133 -"94",1.88604475381625,0.927532071690324,3.81024869927079 -"95",-0.356995059940192,1.07692551017613,0.127262208152218 -"96",0.685259697938012,-0.529475025728339,0.813764401252908 -"97",0.409335335611831,-0.127071570693339,0.743118847132803 -"98",1.44144797948714,-0.432626228905172,-0.91616578464358 -"99",-0.0286612567452046,0.0717762297506202,0.503375757245708 -"100",-0.43673305217259,-2.21048541990544,-0.0645951608652491 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/databases/truncreg_truncreg.xls r-cran-marginaleffects-0.18.0/inst/tinytest/stata/databases/truncreg_truncreg.xls --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/databases/truncreg_truncreg.xls 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/databases/truncreg_truncreg.xls 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -FalseFalse(1)(2)y1VARIABLEScoefseage0.43099438180.2271971581quant-0.11877642300.0325884873Observations7
FalseFalse
\ No newline at end of file diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/estimate.do r-cran-marginaleffects-0.18.0/inst/tinytest/stata/estimate.do --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/estimate.do 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/estimate.do 1970-01-01 00:00:00.000000000 +0000 @@ -1,217 +0,0 @@ -cd ~/repos/marginaleffects/tests/testthat/stata - - -* stats::glm -clear -use databases/stats_glm_01.dta -quiet logit y c.x1##c.x2 -quiet margins, dydx(x1 x2) post -outreg2 using "results/stats_glm_01.xls", dec(10) excel replace noaster sideway noparen stats(coef se) - - -* stats::lm -clear -use databases/stats_lm_01.dta -quiet reg y c.x1##c.x2 -quiet margins, dydx(x1 x2) post -outreg2 using "results/stats_lm_01.xls", dec(10) excel replace noaster sideway noparen stats(coef se) - -* survival::coxph -clear -use databases/survival_coxph_01.dta -stset time status -quiet stcox x, strata(sex) nohr -quiet margins, dydx(x) exp(predict(xb)) post -outreg2 using "results/survival_coxph_01.xls", dec(10) excel replace noaster sideway noparen stats(coef se) - -* betareg::betareg -clear -use databases/betareg_betareg_01.dta -quiet betareg yield i.batch temp -quiet margins, dydx(temp) post -outreg2 using "results/betareg_betareg_01.xls", dec(10) excel replace noaster sideway noparen stats(coef se) - - -* pscl::zeroinfl -clear -use databases/pscl_bioChemists.dta -quiet zinb art kid phd, inflate(ment) -quiet margins, dydx(*) post -outreg2 using "results/pscl_zeroinfl_01.xls", dec(10) excel replace noaster sideway noparen stats(coef se) - -* MASS::polr -clear -use databases/MASS_polr_01.dta -quiet ologit y x1 x2 -quiet margins, dydx(x1 x2) post -outreg2 using "results/MASS_polr_01.xls", dec(10) excel replace noaster sideway noparen stats(coef se) - -* nnet::multinom -clear -use databases/MASS_polr_01.dta -quiet mlogit y x1 x2, baseoutcome(1) -quiet margins, dydx(*) post -outreg2 using "results/nnet_multinom_01.xls", dec(10) excel replace noaster sideway noparen stats(coef se) - -* fixest::feols -clear -use databases/plm_emplUK.dta -xtset firm year -quiet xtreg wage c.capital##c.output, fe cluster(firm) -quiet margins, dydx(*) post -outreg2 using "results/fixest_feols_01.xls", dec(10) excel replace noaster sideway noparen stats(coef se) - -gen logwage = log(wage) -quiet xtpoisson logwage c.capital##c.output, fe vce(robust) -quiet margins, dydx(*) post -outreg2 using "results/fixest_fepois_01.xls", dec(10) excel replace noaster sideway noparen stats(coef se) - - -* ivreg::ivreg -clear -use databases/ivreg_ivreg_01.dta -quiet ivregress 2sls Q D (P = D F A) -quiet margins, dydx(P D) post -outreg2 using "results/ivreg_ivreg_01.xls", dec(10) excel replace noaster sideway noparen stats(coef se) - - -* MASS::glm.nb -clear -use databases/mtcars.dta -quiet nbreg carb wt i.cyl -quiet margins, dydx(*) post -outreg2 using "results/MASS_glm_nb.xls", dec(10) excel replace noaster sideway noparen stats(coef se) - - -* AER::tobit -clear -use databases/affairs.dta -quiet tobit affairs age yearsmarried religiousness occupation rating, ll(0) -quiet margins, dydx(*) post -outreg2 using "results/AER_tobit.xls", dec(10) excel replace noaster sideway noparen stats(coef se) - - -* AER::tobit (right-censured) -clear -use databases/affairs.dta -quiet tobit affairs age yearsmarried religiousness occupation rating, ul(4) ll(0) -quiet margins, dydx(*) post -outreg2 using "results/AER_tobit_right4.xls", dec(10) excel replace noaster sideway noparen stats(coef se) - - -* estimatr::lm_robust -clear -use databases/mtcars.dta -quiet reg carb wt i.cyl, vce(hc2) -quiet margins, dydx(*) post -outreg2 using "results/estimatr_lm_robust.xls", dec(10) excel replace noaster sideway noparen stats(coef se) - - -* estimatr::iv_robust -clear -use databases/kmenta.dta -quiet ivregress 2sls Q D (P = D F A), vce(robust) small -quiet margins, dydx(*) post -outreg2 using "results/estimatr_iv_robust.xls", dec(10) excel replace noaster sideway - -* lmer4 -clear -use databases/lme4_01.dta -xtset clus - -quiet xtreg y c.x1##c.x2, re -quiet margins, dydx(*) post -outreg2 using "results/lme4_01.xls", dec(10) excel replace noaster sideway noparen stats(coef se) - -clear -use databases/lme4_02.dta -xtset clus - -quiet xtlogit y c.x1##c.x2, re -quiet margins, dydx(*) post -outreg2 using "results/lme4_02.xls", dec(10) excel replace noaster sideway noparen stats(coef se) - - -* quantreg::rq -clear -use databases/mtcars.dta -quiet qreg mpg c.hp##c.wt i.cyl -quiet margins, dydx(*) post -outreg2 using "results/quantreg_rq_01.xls", dec(10) excel replace noaster sideway noparen stats(coef se) - - -* truncreg::truncreg -clear -use databases/tobin.dta -quiet truncreg durable age quant, ll(0) -quiet margins, dydx(*) post -outreg2 using "results/truncreg_truncreg_01.xls", dec(10) excel replace noaster sideway noparen stats(coef se) - - -******************* PANEL - -* emplUK -clear -use databases/plm_emplUK.dta -xtset firm year -gen logwage = log(wage) - -* fixest::feols -quiet xtreg wage c.capital##c.output, fe cluster(firm) -quiet margins, dydx(*) post -outreg2 using "results/fixest_feols_01.xls", dec(10) excel replace noaster sideway noparen stats(coef se) - -* fixest::fepois -quiet xtpoisson logwage c.capital##c.output, fe vce(robust) -quiet margins, dydx(*) post -outreg2 using "results/fixest_fepois_01.xls", dec(10) excel replace noaster sideway noparen stats(coef se) - -* Grunfeld -clear -use databases/plm_Grunfeld.dta -xtset firm year - -* plm pooling -quiet reg inv c.value##c.capital -quiet margins, dydx(*) post -outreg2 using "results/plm_pooling_01.xls", dec(10) excel replace noaster sideway noparen stats(coef se) - -* plm Swamy-Arora -quiet xtreg inv c.value##c.capital, sa -quiet margins, dydx(*) post -outreg2 using "results/plm_sa_01.xls", dec(10) excel replace noaster sideway noparen stats(coef se) - - -******************* ELASTICITY - -* stats::glm -clear -use databases/stats_glm_01.dta - -quiet logit y c.x1##c.x2 -quiet margins, eyex(x1 x2) post -outreg2 using "results/stats_glm_elasticity_eyex.xls", dec(10) excel replace noaster sideway noparen stats(coef se) - -quiet logit y c.x1##c.x2 -quiet margins, dyex(x1 x2) post -outreg2 using "results/stats_glm_elasticity_dyex.xls", dec(10) excel replace noaster sideway noparen stats(coef se) - -quiet logit y c.x1##c.x2 -quiet margins, eydx(x1 x2) post -outreg2 using "results/stats_glm_elasticity_eydx.xls", dec(10) excel replace noaster sideway noparen stats(coef se) - -* stats::lm -clear -use databases/stats_lm_01.dta - -quiet reg y c.x1##c.x2 -quiet margins, eyex(x1 x2) post -outreg2 using "results/stats_lm_elasticity_eyex.xls", dec(10) excel replace noaster sideway noparen stats(coef se) - -quiet reg y c.x1##c.x2 -quiet margins, dyex(x1 x2) post -outreg2 using "results/stats_lm_elasticity_dyex.xls", dec(10) excel replace noaster sideway noparen stats(coef se) - -quiet reg y c.x1##c.x2 -quiet margins, eydx(x1 x2) post -outreg2 using "results/stats_lm_elasticity_eydx.xls", dec(10) excel replace noaster sideway noparen stats(coef se) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/generate.R r-cran-marginaleffects-0.18.0/inst/tinytest/stata/generate.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/generate.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/generate.R 1970-01-01 00:00:00.000000000 +0000 @@ -1,133 +0,0 @@ -library(haven) -library(ivreg) -library(betareg) - -################ -# stats::glm # -################ -set.seed(1024) -N <- 100 -dat <- data.frame(x1 = rnorm(N), x2 = rnorm(N)) -dat$y <- plogis(dat$x1 + dat$x2 + dat$x1 * dat$x2) -dat$y <- rbinom(N, 1, dat$y) -haven::write_dta(dat, path = "data/stats_glm_01.dta") - - -############### -# stats::lm # -############### -set.seed(1024) -N <- 100 -dat <- data.frame(x1 = rnorm(N), x2 = rnorm(N)) -dat$y <- dat$x1 + dat$x2 + dat$x1 * dat$x2 + rnorm(N) -haven::write_dta(dat, path = "data/stats_lm_01.dta") - - -################ -# MASS::polr # -################ -set.seed(1024) -N <- 1000 -dat <- data.frame(x1 = rnorm(N), x2 = rnorm(N)) -dat$y <- dat$x1 + dat$x2 + dat$x1 * dat$x2 + rnorm(N) -dat$y <- cut(dat$y, breaks = 4) -dat$y <- factor(as.numeric(dat$y)) -haven::write_dta(dat, path = "data/MASS_polr_01.dta") - - -########## -# lme4 # -########## - -set.seed(1024) -N <- 1000 - -dat_glm <- data.frame(x1 = rnorm(N), - x2 = rnorm(N), - clus = sample(letters[1:10], N, replace = TRUE)) -dat_glm$clus <- as.factor(dat_glm$clus) -dat_glm$y <- dat_glm$x1 + dat_glm$x2 + dat_glm$x1 * dat_glm$x2 + .1 * as.numeric(dat_glm$clus) -dat_glm$y <- rbinom(N, 1, plogis(dat_glm$y)) - -dat_lm <- data.frame(x1 = rnorm(N), - x2 = rnorm(N), - clus = sample(letters[1:10], N, replace = TRUE)) -dat_lm$clus <- as.factor(dat_lm$clus) -dat_lm$y <- dat_lm$x1 + dat_lm$x2 + dat_lm$x1 * dat_lm$x2 + .1 * as.numeric(dat_lm$clus) + rnorm(N) - -haven::write_dta(dat_lm, test_path("stata/data/lme4_01.dta")) -haven::write_dta(dat_glm, test_path("stata/data/lme4_02.dta")) - - -############ -# fixest # -############ -data(trade, package = "fixest") -haven::write_dta(trade, path = test_path("stata/data/fixest_trade_01.dta")) - - -######### -# plm # -######### -data(EmplUK, package = "plm") -haven::write_dta(EmplUK, path = test_path("stata/data/plm_emplUK.dta")) - -data(Grunfeld, package = "plm") -haven::write_dta(Grunfeld, path = test_path("stata/data/plm_Grunfeld.dta")) - -################## -# ivreg::ivreg # -################## -haven::write_dta(ivreg::Kmenta, path = "data/ivreg_ivreg_01.dta") - - -###################### -# betareg::betareg # -###################### -data("GasolineYield", package = "betareg") -haven::write_dta(GasolineYield, path = "data/betareg_betareg_01.dta") - - -#################### -# fixest::fixest # -#################### -haven::write_dta(mtcars, path = "data/fixest_fixest_01.dta") - - -################## -# MASS::glm.nb # -################## -haven::write_dta(mtcars, path = "data/mtcars.dta") - - -################ -# AER::tobit # -################ -write.table(data(Affairs, package = "AER")) -haven::write_dta(Affairs, path = "data/affairs.dta") - - -######################### -# estimatr::lm_robust # -######################### -haven::write_dta(mtcars, path = "data/mtcars.dta") - - -######################### -# estimatr::iv_robust # -######################### -write.table(data(Kmenta, package = "ivreg")) -haven::write_dta(Kmenta, path = "data/kmenta.dta") - - -################## -# quantreg::rq # -################## -haven::write_dta(mtcars, path = "data/mtcars.dta") - -######################## -# truncreg::truncreg # -######################## -write.table(data(tobin, package = "survival")) -haven::write_dta(tobin, path = "data/tobin.dta") - diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/AER_tobit.txt r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/AER_tobit.txt --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/AER_tobit.txt 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/AER_tobit.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ - (1) (2) - y1 -VARIABLES coef se - -age -0.1793325837 0.0790928495 -yearsmarried 0.5541418129 0.1345172487 -religiousness -1.68622e+00 0.4037494784 -occupation 0.3260532488 0.2544235157 -rating -2.28497e+00 0.4078257650 - -Observations 601 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/AER_tobit_right4.txt r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/AER_tobit_right4.txt --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/AER_tobit_right4.txt 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/AER_tobit_right4.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ - (1) (2) - y1 -VARIABLES coef se - -age -0.1775982086 0.0799062851 -yearsmarried 0.5323021096 0.1411683917 -religiousness -1.61634e+00 0.4243966690 -occupation 0.3241864579 0.2538777587 -rating -2.20701e+00 0.4498318454 - -Observations 601 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/MASS_glm_nb.txt r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/MASS_glm_nb.txt --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/MASS_glm_nb.txt 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/MASS_glm_nb.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ - (1) (2) - y1 -VARIABLES coef se - -wt 0.0718038652 0.4794337297 -6.cyl 1.8552893910 0.8210331850 -8.cyl 1.8482807538 0.9422337249 - -Observations 32 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/MASS_polr_01.txt r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/MASS_polr_01.txt --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/MASS_polr_01.txt 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/MASS_polr_01.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ - (1) (2) (3) (4) -VARIABLES x1 x1 x2 x2 - -1bn._predict -0.0471611046 0.0056932449 -0.0453384052 0.0054854492 -2._predict -0.1269902267 0.0088085461 -0.1220822627 0.0086059404 -3._predict 0.1578126742 0.0092054116 0.1517134732 0.0090457337 -4._predict 0.0163386571 0.0038546735 0.0157071948 0.0037037977 - -Observations 1,000 1,000 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/betareg_betareg_01.txt r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/betareg_betareg_01.txt --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/betareg_betareg_01.txt 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/betareg_betareg_01.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ - (1) (2) - y1 -VARIABLES coef se - -temp 0.0016064063 0.0000570207 - -Observations 32 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/estimatr_iv_robust.txt r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/estimatr_iv_robust.txt --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/estimatr_iv_robust.txt 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/estimatr_iv_robust.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ - (1) (2) - y1 -VARIABLES coef se - -P -0.2435565378 (0.0823240385) -D 0.3139917943 (0.0465590737) - -Observations 20 -Standard errors in parentheses diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/estimatr_lm_robust.txt r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/estimatr_lm_robust.txt --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/estimatr_lm_robust.txt 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/estimatr_lm_robust.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ - (1) (2) - y1 -VARIABLES coef se - -wt 0.0757811498 0.2819563058 -6.cyl 1.8201112542 0.7429965420 -8.cyl 1.8246954385 0.8456758537 - -Observations 32 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/fixest_feols_01.txt r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/fixest_feols_01.txt --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/fixest_feols_01.txt 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/fixest_feols_01.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ - (1) (2) - y1 -VARIABLES coef se - -capital 0.0877724431 0.1027361600 -output -0.0416847525 0.0123985970 - -Observations 1,031 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/fixest_fepois_01.txt r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/fixest_fepois_01.txt --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/fixest_fepois_01.txt 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/fixest_fepois_01.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ - (1) (2) - y1 -VARIABLES coef se - -capital 0.0007906052 0.0010165426 -output -0.0005876415 0.0001588062 - -Observations 1,031 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/ivreg_ivreg_01.txt r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/ivreg_ivreg_01.txt --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/ivreg_ivreg_01.txt 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/ivreg_ivreg_01.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ - (1) (2) - y1 -VARIABLES coef se - -P -0.2435565378 0.0889541212 -D 0.3139917943 0.0432799137 - -Observations 20 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/lme4_01.txt r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/lme4_01.txt --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/lme4_01.txt 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/lme4_01.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ - (1) (2) - y1 -VARIABLES coef se - -x1 0.9712139354 0.0314171182 -x2 1.0284145171 0.0313671369 - -Observations 1,000 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/lme4_02.txt r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/lme4_02.txt --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/lme4_02.txt 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/lme4_02.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ - (1) (2) - y1 -VARIABLES coef se - -x1 0.1461091091 0.0117203780 -x2 0.1427228193 0.0119981203 - -Observations 1,000 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/nnet_multinom_01.txt r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/nnet_multinom_01.txt --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/nnet_multinom_01.txt 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/nnet_multinom_01.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ - (1) (2) (3) (4) -VARIABLES x1 x1 x2 x2 - -1bn._predict -0.0327866627 0.0071615575 -0.0180938646 0.0063460046 -2._predict -0.1471263513 0.0120837209 -0.1644308814 0.0113185567 -3._predict 0.1538624273 0.0107526199 0.1570670681 0.0101831330 -4._predict 0.0260505867 0.0041813467 0.0254576780 0.0032559475 - -Observations 1,000 1,000 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/plm_pooling_01.txt r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/plm_pooling_01.txt --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/plm_pooling_01.txt 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/plm_pooling_01.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ - (1) (2) - y1 -VARIABLES coef se - -value 0.1084364067 0.0054148467 -capital 0.1138550617 0.0292736629 - -Observations 200 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/plm_sa_01.txt r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/plm_sa_01.txt --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/plm_sa_01.txt 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/plm_sa_01.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ - (1) (2) - y1 -VARIABLES coef se - -value 0.0899638460 0.0092333491 -capital 0.1381210768 0.0226473509 - -Observations 200 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/pscl_zeroinfl_01.txt r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/pscl_zeroinfl_01.txt --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/pscl_zeroinfl_01.txt 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/pscl_zeroinfl_01.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ - (1) (2) - y1 -VARIABLES coef se - -kid5 -0.1022476299 0.0801312792 -phd 0.0859453332 0.0601970299 -ment 0.0616069847 0.0124472621 - -Observations 915 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/quantreg_rq_01.txt r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/quantreg_rq_01.txt --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/quantreg_rq_01.txt 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/quantreg_rq_01.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ - (1) (2) - y1 -VARIABLES coef se - -hp -0.0149562914 0.0088453537 -wt -3.47788e+00 0.9767817366 -6.cyl -3.04890e+00 1.8732840350 -8.cyl -4.30437e+00 2.7192225413 - -Observations 32 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/stats_glm_01.txt r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/stats_glm_01.txt --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/stats_glm_01.txt 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/stats_glm_01.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ - (1) (2) - y1 -VARIABLES coef se - -x1 0.1143768927 0.0378422159 -x2 0.1322341869 0.0326041995 - -Observations 100 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/stats_glm_elasticity_dyex.txt r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/stats_glm_elasticity_dyex.txt --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/stats_glm_elasticity_dyex.txt 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/stats_glm_elasticity_dyex.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ - (1) (2) - y1 -VARIABLES coef se - -x1 0.0046535244 0.0113457416 -x2 -0.0011355681 0.0143282906 - -Observations 100 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/stats_glm_elasticity_eydx.txt r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/stats_glm_elasticity_eydx.txt --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/stats_glm_elasticity_eydx.txt 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/stats_glm_elasticity_eydx.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ - (1) (2) - y1 -VARIABLES coef se - -x1 0.1976871582 0.1589495242 -x2 0.3317776023 0.1504649837 - -Observations 100 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/stats_glm_elasticity_eyex.txt r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/stats_glm_elasticity_eyex.txt --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/stats_glm_elasticity_eyex.txt 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/stats_glm_elasticity_eyex.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ - (1) (2) - y1 -VARIABLES coef se - -x1 -0.1740364737 0.0869413867 -x2 -0.2512280120 0.1074360646 - -Observations 100 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/stats_lm_01.txt r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/stats_lm_01.txt --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/stats_lm_01.txt 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/stats_lm_01.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ - (1) (2) - y1 -VARIABLES coef se - -x1 0.8562602901 0.1076687866 -x2 0.8789467715 0.0931517970 - -Observations 100 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/stats_lm_elasticity_dyex.txt r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/stats_lm_elasticity_dyex.txt --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/stats_lm_elasticity_dyex.txt 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/stats_lm_elasticity_dyex.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ - (1) (2) - y1 -VARIABLES coef se - -x1 0.0817594517 0.0103296239 -x2 0.0186198419 0.0129778726 - -Observations 100 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/stats_lm_elasticity_eydx.txt r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/stats_lm_elasticity_eydx.txt --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/stats_lm_elasticity_eydx.txt 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/stats_lm_elasticity_eydx.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ - (1) (2) - y1 -VARIABLES coef se - -x1 0.3878157070 3.6093570470 -x2 0.9320338891 3.4062325186 - -Observations 100 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/stats_lm_elasticity_eyex.txt r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/stats_lm_elasticity_eyex.txt --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/stats_lm_elasticity_eyex.txt 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/stats_lm_elasticity_eyex.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ - (1) (2) - y1 -VARIABLES coef se - -x1 0.7768301497 0.3578037028 -x2 0.2467961356 0.6184167322 - -Observations 100 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/survival_coxph_01.txt r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/survival_coxph_01.txt --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/survival_coxph_01.txt 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/survival_coxph_01.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ - (1) (2) - y1 -VARIABLES coef se - -x 0.7357497853 0.8044699767 - -Observations 7 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/truncreg_truncreg_01.txt r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/truncreg_truncreg_01.txt --- r-cran-marginaleffects-0.17.0/inst/tinytest/stata/results/truncreg_truncreg_01.txt 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/stata/results/truncreg_truncreg_01.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ - (1) (2) - y1 -VARIABLES coef se - -age 0.4309943818 0.2271971588 -quant -0.1187764230 0.0325884872 - -Observations 7 Binary files /tmp/tmp4nxicoj3/lnf8rby_zA/r-cran-marginaleffects-0.17.0/inst/tinytest/stata/stata.rds and /tmp/tmp4nxicoj3/okRarB_yt9/r-cran-marginaleffects-0.18.0/inst/tinytest/stata/stata.rds differ diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-bugfix.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-bugfix.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-bugfix.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-bugfix.R 2024-02-05 01:34:54.000000000 +0000 @@ -139,8 +139,19 @@ coef(mod)["treatmentB"] + coef(mod)["treatmentB:countryNZ"]) +# Issue #1005 +d1 <- d2 <- mtcars +d2[["horse power"]] <- d2$hp +m1 <- lm(mpg ~ hp, data = d1) +m2 <- lm(mpg ~ `horse power`, data = d2) +p1 <- plot_predictions(m1, condition = 'hp', draw = FALSE) +p2 <- plot_predictions(m2, condition = 'horse power', draw = FALSE) +expect_equivalent(p1$estimate, p2$estimate) +expect_equivalent(p1$std.error, p2$std.error) + source("helpers.R") rm(list = ls()) + diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-by.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-by.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-by.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-by.R 2024-02-05 01:34:54.000000000 +0000 @@ -20,30 +20,30 @@ # use comparison to collapse into averages mod <- glm(gear ~ cyl + am, family = poisson, data = mtcars) -x <- tidy(comparisons(mod, comparison = "dydx")) +x <- avg_comparisons(mod, comparison = "dydx") y <- comparisons(mod, comparison = "dydxavg") expect_equivalent(x$estimate, y$estimate) -expect_equivalent(x$std.error, y$std.error) +expect_equivalent(x$std.error, y$std.error, tolerance = 1e-5) -x <- tidy(comparisons(mod, comparison = "eyex")) +x <- avg_comparisons(mod, comparison = "eyex") y <- comparisons(mod, comparison = "eyexavg") expect_equivalent(x$estimate, y$estimate) -expect_equivalent(x$std.error, y$std.error) +expect_equivalent(x$std.error, y$std.error, tolerance = 1e-5) -x <- tidy(comparisons(mod, comparison = "eydx")) +x <- avg_comparisons(mod, comparison = "eydx") y <- comparisons(mod, comparison = "eydxavg") expect_equivalent(x$estimate, y$estimate) -expect_equivalent(x$std.error, y$std.error) +expect_equivalent(x$std.error, y$std.error, tolerance = 1e-5) -x <- tidy(comparisons(mod, comparison = "dyex")) +x <- avg_comparisons(mod, comparison = "dyex") y <- comparisons(mod, comparison = "dyexavg") expect_equivalent(x$estimate, y$estimate) -expect_equivalent(x$std.error, y$std.error) +expect_equivalent(x$std.error, y$std.error, tolerance = 1e-5) -x <- tidy(slopes(mod, slope = "dyex")) +x <- avg_slopes(mod, slope = "dyex") y <- slopes(mod, slope = "dyexavg") expect_equivalent(x$estimate, y$estimate) -expect_equivalent(x$std.error, y$std.error) +expect_equivalent(x$std.error, y$std.error, tolerance = 1e-5) # input sanity check expect_error(slopes(mod, slope = "bad"), pattern = "eyexavg") @@ -58,14 +58,6 @@ cmp <- comparisons(mod, by = "am", comparison = "lnor") expect_equal(nrow(cmp), 4) -cmp <- comparisons(mod, by = "am") -tid <- tidy(cmp) - -expect_equivalent(nrow(tid), nrow(cmp)) -expect_equivalent(nrow(tid), 4) -expect_true("am" %in% colnames(tid)) - - # counterfactual margins at() dat <- mtcars @@ -76,7 +68,7 @@ mfx <- slopes( mod, by = "cyl", - newdata = datagridcf(cyl = c(4, 6, 8))) + newdata = datagrid(cyl = c(4, 6, 8), grid_type = "counterfactual")) expect_equivalent(mfx$estimate, mar$AME) expect_equivalent(mfx$std.error, mar$SE, tolerance = 1e6) @@ -162,12 +154,6 @@ expect_equivalent(nrow(pre1), 3) expect_equivalent(nrow(pre2), 96) -mm <- marginal_means( - mod, - variables = "gear") -expect_equivalent(nrow(mm), 3) -expect_error(marginal_means(mod, by = TRUE, variables = "gear")) - # marginaleffects poisson vs. margins dat <- mtcars diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-comparisons-interaction.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-comparisons-interaction.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-comparisons-interaction.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-comparisons-interaction.R 2023-12-24 03:08:04.000000000 +0000 @@ -38,13 +38,6 @@ expect_true(all(round(abs(em$SE), 4) %in% round(abs(cmp$std.error), 4))) -# cross and tidy() -mod <- lm(mpg ~ factor(cyl) + factor(am), data = mtcars) -cmp <- comparisons(mod, variables = c("am", "cyl"), cross = TRUE) -avg <- tidy(cmp) -expect_equivalent(nrow(avg), 2) -expect_true("contrast_am" %in% colnames(avg)) -expect_true("contrast_cyl" %in% colnames(avg)) # tidy does not error (no validity) @@ -76,30 +69,13 @@ expect_true(nrow(cmp) > 17) expect_true(nrow(tidy(cmp)) > 17) -cmp <- comparisons( - mod, - variables = list("cyl" = "sequential", "am" = "sequential"), - cross = TRUE) -expect_equivalent(nrow(cmp), 64) -expect_equivalent(nrow(tidy(cmp)), 2) -cmp <- comparisons( - mod, - cross = TRUE, - variables = c("cyl", "am", "wt")) -expect_equivalent(nrow(cmp), 64) -expect_equivalent(nrow(tidy(cmp)), 2) # deprecated argument expect_warning(comparisons(mod, interaction = TRUE)) -# brms + order of first character doesn't matter -mod <- marginaleffects:::modelarchive_model("brms_factor") -cmp <- comparisons(mod, variables = list("cyl_fac" = "all", "mpg" = 1), cross = TRUE) -expect_equivalent(nrow(cmp), 192) -expect_equivalent(nrow(tidy(cmp)), 6) rm(list = ls()) \ No newline at end of file diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-contrast.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-contrast.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-contrast.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-contrast.R 2023-12-24 03:08:04.000000000 +0000 @@ -4,15 +4,6 @@ requiet("emmeans") -# simple contrasts: no validity check -dat <- mtcars -dat$am <- as.logical(dat$am) -mod <- lm(mpg ~ hp + am + factor(cyl), data = dat) -mfx <- suppressWarnings(slopes(mod)) -res <- tidy(mfx) -expect_inherits(res, "data.frame") -expect_equivalent(nrow(res), 4) - # contrast as difference and CI make sense # problem reported with suggested fix by E.Book in Issue 58 @@ -21,8 +12,7 @@ dat <- dat mod <- glm(large_penguin ~ bill_length_mm + flipper_length_mm + species, data = dat, family = binomial) -mfx <- slopes(mod) -ti <- tidy(mfx) +ti <- avg_slopes(mod) reject_ci <- ti$conf.high < 0 | ti$conf.low > 0 reject_p <- ti$p.value < 0.05 expect_equivalent(reject_ci, reject_p) @@ -57,7 +47,7 @@ # factor glm mod <- glm(am ~ factor(cyl), data = mtcars, family = binomial) pred <- predictions(mod, newdata = datagrid(cyl = mtcars$cyl)) -contr <- tidy(comparisons(mod)) +contr <- avg_comparisons(mod) expect_equivalent(contr$estimate[1], pred$estimate[pred$cyl == 6] - pred$estimate[pred$cyl == 4]) expect_equivalent(contr$estimate[2], pred$estimate[pred$cyl == 8] - pred$estimate[pred$cyl == 4]) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-df.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-df.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-df.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-df.R 2024-02-05 01:34:54.000000000 +0000 @@ -14,17 +14,6 @@ em <- confint(pairs(em), adjust = "none") |> dplyr::arrange(contrast) -mm <- marginal_means( - mod, - variables = "cyl", - hypothesis = "pairwise", - df = insight::get_df(mod), - conf_level = 0.95) |> - dplyr::arrange(term) - -expect_equivalent(sort(abs(em$estimate)), sort(abs(mm$estimate))) -expect_equivalent(sort(abs(c(em$lower.CL, em$upper.CL))), sort(abs(c(mm$conf.low, mm$conf.high)))) - cmp29 <- comparisons(mod, df = insight::get_df(mod)) cmpInf <- comparisons(mod) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-elasticity.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-elasticity.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-elasticity.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-elasticity.R 2023-12-24 03:08:04.000000000 +0000 @@ -18,12 +18,12 @@ expect_equivalent(mfx$std.error, sta$std.errorstata, tolerance = tolse) -mfx <- tidy(slopes(mod, slope = "eydx", numderiv = "richardson")) +mfx <- avg_slopes(mod, slope = "eydx", numderiv = "richardson") sta <- results$stats_lm_elasticity_eydx expect_equivalent(mfx$estimate, sta$dydxstata) expect_equivalent(mfx$std.error, sta$std.errorstata, tolerance = tolse) -mfx <- tidy(slopes(mod, slope = "dyex", numderiv = "richardson")) +mfx <- avg_slopes(mod, slope = "dyex", numderiv = "richardson") sta <- results$stats_lm_elasticity_dyex expect_equivalent(mfx$estimate, sta$dydxstata) expect_equivalent(mfx$std.error, sta$std.errorstata, tolerance = tolse) @@ -32,17 +32,17 @@ dat <- read.csv(testing_path("stata/databases/stats_glm_01.csv")) mod <- glm(y ~ x1 * x2, data = dat, family = binomial) -mfx <- tidy(slopes(mod, slope = "eyex", numderiv = "richardson")) +mfx <- avg_slopes(mod, slope = "eyex", numderiv = "richardson") sta <- results$stats_glm_elasticity_eyex expect_equivalent(mfx$estimate, sta$dydxstata, tolerance = tol) expect_equivalent(mfx$std.error, sta$std.errorstata, tolerance = tolse) -mfx <- tidy(slopes(mod, slope = "eydx", numderiv = "richardson")) +mfx <- avg_slopes(mod, slope = "eydx", numderiv = "richardson") sta <- results$stats_glm_elasticity_eydx expect_equivalent(mfx$estimate, sta$dydxstata, tolerance = tol) expect_equivalent(mfx$std.error, sta$std.errorstata, tolerance = tolse) -mfx <- tidy(slopes(mod, slope = "dyex", numderiv = "richardson")) +mfx <- avg_slopes(mod, slope = "dyex", numderiv = "richardson") sta <- results$stats_glm_elasticity_dyex expect_equivalent(mfx$estimate, sta$dydxstata, tolerance = 1e-2) expect_equivalent(mfx$std.error, sta$std.errorstata, tolerance = tolse) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-equivalence.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-equivalence.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-equivalence.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-equivalence.R 2024-01-24 02:04:51.000000000 +0000 @@ -16,7 +16,7 @@ newdata = datagrid(gear = unique), equivalence = c(19, 21)) |> poorman::arrange(gear) -expect_equivalent(e1$z.ratio, e2$statistic.noninf) +expect_equivalent(e1$z.ratio, e2$statistic.noninf, tolerance = 1e-6) expect_equivalent(e1$p.value, e2$p.value.noninf) @@ -111,16 +111,16 @@ -# marginal_means() vs. {emmeans} rm("mod") delta <- log(1.25) mod <<- lm(log(conc) ~ source + factor(percent), data = pigs) rg <- ref_grid(mod) em <- emmeans(rg, "source", at = list(), df = Inf) pa <- pairs(em, df = Inf) -mm <- marginal_means( +mm <- predictions( mod, - variables = "source", + newdata = datagrid(grid_type = "balanced"), + by = "source", hypothesis = "pairwise") e1 <- test(pa, delta = delta, adjust = "none", side = "nonsuperiority", df = Inf) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-gformula.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-gformula.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-gformula.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-gformula.R 2023-12-24 03:08:04.000000000 +0000 @@ -28,11 +28,9 @@ g2 <- mean(predict(model_interaction, newdata = simdat_doB)) - mean(predict(model_interaction, newdata = simdat_doA)) -c1 <- comparisons(model_additive, variable = "group_id", newdata = tmp) -c1 <- tidy(c1) +c1 <- avg_comparisons(model_additive, variable = "group_id", newdata = tmp) -c2 <- comparisons(model_interaction, variable = "group_id", newdata = tmp) -c2 <- tidy(c2) +c2 <- avg_comparisons(model_interaction, variable = "group_id", newdata = tmp) expect_equivalent(g1, c1$estimate) expect_equivalent(g2, c2$estimate) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-hypotheses.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-hypotheses.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-hypotheses.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-hypotheses.R 2024-02-05 01:34:54.000000000 +0000 @@ -180,11 +180,6 @@ # expect_true("b1=0.05" %in% dm$term) # expect_equivalent(nrow(dm), 1) -# mod <- glm(vs ~ hp + factor(am), data = mtcars, family = binomial) -# mm <- marginal_means(mod, "am") -# dm <- hypotheses(mm, hypothesis = "b1 = b2") -# expect_true("b1=b2" %in% dm$term) -# expect_equivalent(nrow(dm), 1) rm(list = ls()) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-hypotheses_joint.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-hypotheses_joint.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-hypotheses_joint.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-hypotheses_joint.R 2023-12-24 03:08:04.000000000 +0000 @@ -68,3 +68,15 @@ h2 <- hypotheses(lmfit, joint = 5:6, joint_test = "f") expect_equivalent(h1$df1, h2$df1) expect_equivalent(h1$df2, h2$df2) + + +# Issue #981 +model <- lm(mpg ~ as.factor(cyl), data = mtcars) +cmp <- avg_comparisons(model) +h1 <- hypotheses(cmp, joint = ".*") +h2 <- hypotheses(cmp, joint = "cyl") +h3 <- hypotheses(cmp, joint = TRUE) +expect_equivalent(h1$estimate, h2$estimate) +expect_equivalent(h1$estimate, h3$estimate) +expect_equivalent(h1$std.error, h2$std.error) +expect_equivalent(h1$std.error, h3$std.error) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-hypothesis.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-hypothesis.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-hypothesis.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-hypothesis.R 2024-02-05 01:34:54.000000000 +0000 @@ -124,51 +124,12 @@ expect_inherits(p3, "predictions") expect_equivalent(p3$term, c("Contrast A", "Contrast B")) -# marginalmeans: hypothesis complex -lc <- c(-2, 1, 1, 0, -1, 1) -mm <- marginal_means(mod, variables = "carb") -lcmfx <- lc[match(mm$value, sort(unique(mm$value)))] -em <- emmeans(mod, "carb") -em <- emmeans::contrast(em, method = data.frame(custom_contrast = lc)) -em <- data.frame(em) -mm <- marginal_means(mod, variables = "carb", hypothesis = lcmfx) -expect_equivalent(mm$estimate, em$estimate) -expect_equivalent(mm$std.error, em$SE, tol = 1e-6) - -# marginalmeans: hypothesis shortcut -mm <- marginal_means(mod, variables = "carb", hypothesis = "reference") -expect_equivalent(nrow(mm), 5) -mm <- marginal_means(mod, variables = "carb", hypothesis = "sequential") -expect_equivalent(nrow(mm), 5) -mm <- marginal_means(mod, variables = "carb", hypothesis = "pairwise") -expect_equivalent(nrow(mm), 15) - -# marginalmeans: hypothesis complex matrix -lc <- matrix(c( - -2, 1, 1, 0, -1, 1, - -1, 1, 0, 0, 0, 0 - ), ncol = 2) -mm <- marginal_means(mod, variables = "carb", hypothesis = lc) -expect_inherits(mm, "marginalmeans") -expect_equal(nrow(mm), 2) - - # wildcard -mm1 <- marginal_means(mod, hypothesis = "b* = b1") -expect_equal(mm1$term, paste0("b", 1:9, "=b1")) +mm1 <- predictions(mod, by = "cyl", hypothesis = "b* = b1") +expect_equal(mm1$term, paste0("b", 1:3, "=b1")) expect_equal(mm1$estimate[1], 0) -# marginalmeans: string function -mm1 <- marginal_means( - mod, - hypothesis = "b1 + b2 = 12") -mm2 <- marginal_means(mod) -expect_equivalent( - mm2$estimate[1] + mm2$estimate[2] - 12, - mm1$estimate) - - # marginaleffects: string function mod <- lm(mpg ~ hp + drat, data = mtcars) mfx1 <- slopes( diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-inferences.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-inferences.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-inferences.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-inferences.R 2024-02-05 01:34:54.000000000 +0000 @@ -93,10 +93,6 @@ mod <- lm(mpg ~ hp, data = dat) expect_error(inferences(comparisons(mod, wts = "w"), method = "fwb"), pattern = "wts") -# marginal_means not supported -mod <- lm(Petal.Length ~ Sepal.Length * Sepal.Width * Species, data = iris) -expect_error(inferences(marginal_means(mod), method = "fwb"), pattern = "Must inherit") - # Issue #856 tmp <- lm(Petal.Length ~ Sepal.Length * Species, data = iris) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-interaction.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-interaction.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-interaction.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-interaction.R 2023-12-24 03:08:04.000000000 +0000 @@ -10,17 +10,7 @@ mod <- lm(price ~ cut * color + clarity + carat, data = dat) cmp1 <- comparisons(mod, variables = c("cut", "color"), cross = TRUE) cmp2 <- comparisons(mod, variables = "cut") -tid1 <- tidy(cmp1) -tid2 <- tidy(cmp2) -expect_equivalent(nrow(tid1), 24) -expect_equivalent(nrow(tid2), 4) -expect_equivalent(anyDuplicated(tid1$estimate), 0) -expect_equivalent(anyDuplicated(tid2$estimate), 0) -expect_false(anyNA(tid1$estimate)) -expect_false(anyNA(tid1$std.error)) -expect_false(anyNA(tid2$estimate)) -expect_false(anyNA(tid2$std.error)) expect_equivalent(nrow(subset(cmp1, rowid == 1)), 24) expect_equivalent(nrow(subset(cmp2, rowid == 1)), 4) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-jss.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-jss.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-jss.R 1970-01-01 00:00:00.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-jss.R 2023-12-30 22:59:07.000000000 +0000 @@ -0,0 +1,7 @@ +library(tinytest) + +# make sure that the JSS data is always hosted at the same link forever +dat <- read.csv("https://marginaleffects.com/data/titanic.csv") +expect_inherits(dat, "data.frame") +dat <- read.csv("https://marginaleffects.com/data/impartiality.csv") +expect_inherits(dat, "data.frame") diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-marginal_means.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-marginal_means.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-marginal_means.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-marginal_means.R 2024-02-05 01:34:54.000000000 +0000 @@ -9,14 +9,14 @@ # Issue #438: backtransforms allows us to match `emmeans` exactly mod <- glm(vs ~ mpg + factor(cyl), data = mtcars, family = binomial) em <- emmeans(mod, ~cyl, type = "response") -mm <- marginal_means(mod) |> dplyr::arrange(value) +mm <- predictions(mod, by = "cyl", newdata = datagrid(grid_type = "balanced")) |> dplyr::arrange(cyl) expect_equal(data.frame(em)$prob, mm$estimate) expect_equal(data.frame(em)$asymp.LCL, mm$conf.low, tolerance = 1e-5) expect_equal(data.frame(em)$asymp.UCL, mm$conf.high) mod <- glm(breaks ~ wool * tension, family = Gamma, data = warpbreaks) em <- suppressMessages(emmeans(mod, ~wool, type = "response", df = Inf)) -mm <- marginal_means(mod, variables = "wool") +mm <- predictions(mod, newdata=datagrid(grid_type="balanced"), by="wool") expect_equal(data.frame(em)$response, mm$estimate) # TODO: 1/eta link function inverts order of CI. Should we clean this up? expect_equal(data.frame(em)$asymp.LCL, mm$conf.high) @@ -29,32 +29,6 @@ dat$cyl <- as.factor(dat$cyl) dat$vs <- as.factor(dat$vs) -# sanity check -mod <- lm(mpg ~ cyl + am + vs + hp, dat) -expect_error(marginal_means(mod, variables_grid = "junk"), pattern = "missing") -expect_error(marginal_means(mod, variables = "mpg"), pattern = "response") - - -# changing the prediction grid changes marginal means -# remember that the grid is variables + variables_grid -mod <- lm(mpg ~ cyl + am + vs + hp, dat) -mm1 <- marginal_means(mod, variables = "cyl") -mm2 <- marginal_means(mod, variables = "cyl", variables_grid = "vs") -mm3 <- marginal_means(mod, variables = "cyl", variables_grid = "am") -expect_false(all(mm1$estimate == mm2$estimate)) -expect_false(all(mm1$estimate == mm3$estimate)) -expect_false(all(mm2$estimate == mm3$estimate)) - - -# tidy and glance -mod <- lm(mpg ~ cyl + am + hp, dat) -me <- marginal_means(mod) -ti <- tidy(me) -gl <- glance(me) -expect_equivalent(nrow(gl), 1) -expect_equivalent(nrow(ti), 5) -expect_true(ncol(ti) >= 8) - # marginalmeans vs. emmeans: poisson link or response @@ -64,14 +38,14 @@ dat$cyl <- factor(dat$cyl) mod <- glm(gear ~ cyl + am, data = dat, family = poisson) # link -mm <- tidy(marginal_means(mod, variables = "cyl", type = "link")) |> - dplyr::arrange(value) +mm <- predictions(mod, newdata=datagrid(grid_type="balanced"), by="cyl", type = "link") |> + dplyr::arrange(cyl) em <- tidy(emmeans(mod, specs = "cyl")) expect_equivalent(mm$estimate, em$estimate, tolerance = 1e-5) expect_equivalent(mm$estimate, em$estimate, tolerance = 1e-5) # response -mm <- tidy(marginal_means(mod, variables = "cyl")) |> - dplyr::arrange(value) +mm <- predictions(mod, newdata=datagrid(grid_type="balanced"), by="cyl") |> + dplyr::arrange(cyl) em <- tidy(emmeans(mod, specs = "cyl", type = "response")) expect_equivalent(mm$estimate, em$rate) expect_equivalent(mm$p.value, em$p.value) @@ -81,13 +55,13 @@ # simple marginal means mod <- lm(mpg ~ cyl + am + hp, dat) em <- broom::tidy(emmeans::emmeans(mod, "cyl")) -me <- marginal_means(mod, variables = "cyl") |> - dplyr::arrange(value) +me <- predictions(mod, newdata=datagrid(grid_type="balanced"), by="cyl") |> + dplyr::arrange(cyl) expect_equivalent(me$estimate, em$estimate) expect_equivalent(me$std.error, em$std.error, tolerance = 1e-5) em <- broom::tidy(emmeans::emmeans(mod, "am")) -me <- marginal_means(mod, variables = "am") |> - dplyr::arrange(value) +me <- predictions(mod, newdata=datagrid(grid_type="balanced"), by="am") |> + dplyr::arrange(am) expect_equivalent(me$estimate, em$estimate) expect_equivalent(me$std.error, em$std.error, tolerance = 1e-5) @@ -96,48 +70,24 @@ # standard errors do not match emmeans mod <- lm(mpg ~ cyl * am, dat) em <- suppressMessages(broom::tidy(emmeans::emmeans(mod, "cyl"))) -me <- marginal_means(mod, variables = "cyl") |> - dplyr::arrange(value) +me <- predictions(mod, newdata=datagrid(grid_type="balanced"), by="cyl") |> + dplyr::arrange(cyl) expect_equivalent(me$estimate, em$estimate) em <- suppressMessages(broom::tidy(emmeans::emmeans(mod, "am"))) -me <- suppressWarnings(marginal_means(mod, variables = "am")) -me <- me[order(me$value),] +me <- suppressWarnings(predictions(mod, newdata=datagrid(grid_type="balanced"), by="am")) +me <- me[order(me$am),] expect_equivalent(me$estimate, em$estimate) -# error: no factor -mod <- lm(hp ~ mpg, mtcars) -expect_error(marginal_means(mod), pattern = "was found") - # wts mod1 <- lm(vs ~ factor(am) + factor(gear) + factor(cyl), data = mtcars) mod2 <- glm(vs ~ factor(am) + factor(gear) + mpg, data = mtcars, family = binomial) # wts = "cells" em <- data.frame(emmeans(mod1, ~am, weights = "cells")) -mm <- marginal_means(mod1, variables = "am", wts = "cells") +mm <- predictions(mod1, by = "am") expect_equivalent(mm$estimate, em$emmean) expect_equivalent(mm$std.error, em$SE) -em <- data.frame(emmeans(mod2, ~am, weights = "cells", type = "response")) -mm <- marginal_means(mod2, variables = "am", wts = "cells") -expect_equivalent(mm$estimate, em$prob) -expect_equivalent(mm$conf.low, em$asymp.LCL, tolerance = 1e-5) -expect_equivalent(mm$conf.high, em$asymp.UCL, tolerance = 1e-5) - -# wts = "proportional" -em <- data.frame(emmeans(mod1, ~am, weights = "proportional")) -mm <- marginal_means(mod1, variables = "am", wts = "proportional") |> - dplyr::arrange(value) -expect_equivalent(mm$estimate, em$emmean) -expect_equivalent(mm$std.error, em$SE, tolerance = 1e-5) - -em <- data.frame(emmeans(mod2, ~am, weights = "proportional", type = "response")) -mm <- marginal_means(mod2, variables = "am", wts = "proportional") |> - dplyr::arrange(value) -expect_equivalent(mm$estimate, em$prob) -expect_equivalent(mm$conf.low, em$asymp.LCL) -expect_equivalent(mm$conf.high, em$asymp.UCL) - # Issue #583 dat <- mtcars dat$am <- factor(dat$am) @@ -148,38 +98,7 @@ by <- data.frame( by = c("(4 & 6)", "(4 & 6)", "(8)"), cyl = unique(dat$cyl)) -expect_inherits(marginal_means(mod, variables = "cyl", by = by), "marginalmeans") -expect_error(marginal_means(mod, by = by), pattern = "common") - -# Issue #508 -df <- data.frame(id = rep(1:5, each = 2e2)) -df$city = ifelse(df$id <= 3, "Denver", "Paris") -df$y <- rbinom(1e3, 1, prob = plogis(-3 + 1/2 * df$id)) -df$id <- factor(df$id) -ma <- aggregate(y ~ city, FUN = mean, data = df) - -m <- glm(y ~ id, data = df, family = binomial) -by <- data.frame( - id = 1:5, - by = ifelse(1:5 <= 3, "Denver", "Paris")) - -mm <- marginal_means(m, by = by, type = "response") -expect_equivalent(mm$estimate, ma$y, tol = .1) - - -# simple marginal means for each level of `cyl` -dat <- mtcars -dat$carb <- factor(dat$carb) -dat$cyl <- factor(dat$cyl) -dat$am <- as.logical(dat$am) -mod <- lm(mpg ~ carb + cyl + am, dat) -by <- data.frame( - cyl = c(4, 6, 8), - by = c("4 & 6", "4 & 6", "8")) -mm <- marginal_means(mod, - variables = "cyl", - by = by) -expect_equivalent(nrow(mm), 2) +expect_inherits(predictions(mod, newdata=datagrid(grid_type="balanced"), by = by), "predictions") # Issue #620 @@ -194,8 +113,4 @@ -# # Issue #637: marginal_means() refactor -# mod <- lm(mpg ~ factor(cyl) + as.logical(am), data = mtcars) -# mm <- marginal_means(mod) - rm(list = ls()) \ No newline at end of file diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-p_adjust.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-p_adjust.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-p_adjust.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-p_adjust.R 2024-02-05 01:34:54.000000000 +0000 @@ -18,11 +18,3 @@ expect_true(any(mfx1$p.value < mfx2$p.value)) expect_true(all(mfx1$p.value <= mfx2$p.value)) expect_false("conf.low" %in% colnames(mfx2)) - -mm1 <- marginal_means(mod) -mm2 <- marginal_means(mod, p_adjust = "hochberg") -expect_true(any(mm1$p.value < mm2$p.value)) -expect_true(all(mm1$p.value <= mm2$p.value)) -expect_false("conf.low" %in% colnames(mm2)) - -expect_error(marginal_means(mod, p_adjust = "junk"), pattern = "Assertion") \ No newline at end of file diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-AER.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-AER.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-AER.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-AER.R 2024-02-05 01:34:54.000000000 +0000 @@ -31,18 +31,6 @@ expect_equivalent(mfx$std.error, mfx$std.errorstata, tolerance = .1) -# TODO: Works interactively but not in CI -# # tobit: marginalmeans vs. emmeans -# tmp <- dat -# tmp$religiousness <- as.logical(tmp$religiousness) -# mod <- tobit( -# affairs ~ age + yearsmarried + religiousness + occupation + rating, -# data = tmp) -# em <- emmeans(mod, specs = "religiousness") -# em <- tidy(em) -# mm <- tidy(marginal_means(mod)) -# expect_equivalent(mm$estimate, em$estimate) -# expect_equivalent(mm$std.error, em$std.error, tolerance = tol_se) # marginaleffects vs. emtrends diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-Amelia.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-Amelia.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-Amelia.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-Amelia.R 2024-02-05 01:34:54.000000000 +0000 @@ -47,22 +47,5 @@ -# Issue #793 -set.seed(1024) -dat <- iris -dat$Sepal.Length[sample(seq_len(nrow(iris)), 40)] <- NA -dat$Sepal.Width[sample(seq_len(nrow(iris)), 40)] <- NA -dat$Species[sample(seq_len(nrow(iris)), 40)] <- NA -dat_amelia <- Amelia::amelia(dat, m = 20, noms = "Species", p2s = 0) -mod_amelia <- with(dat_amelia, lm(Petal.Width ~ Sepal.Length * Sepal.Width + Species)) -marg_means_amelia = marginal_means(mod_amelia) -expect_inherits(marg_means_amelia, "marginalmeans") - -mod_amelia <- with(dat_amelia, glm(rbinom(n = length(Petal.Width), 1, 0.5) ~ Sepal.Length * Sepal.Width + Species, family = "binomial")) -expect_error(marginal_means(mod_amelia), pattern = "std.error") -m <- marginal_means(mod_amelia, type = "response") -expect_inherits(m, "marginalmeans") - - source("helpers.R") \ No newline at end of file diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-MASS.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-MASS.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-MASS.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-MASS.R 2024-02-05 01:34:54.000000000 +0000 @@ -42,7 +42,7 @@ # margins: standard errors at mean gradient -mfx_tid <- tidy(mfx) +mfx_tid <- avg_slopes(model) mar_tid <- tidy(mar)[, c("term", "estimate", "std.error")] mar_tid <- setNames(mar_tid, c("term", "mar_estimate", "mar_std.error")) tmp <- merge(mfx_tid, mar_tid) @@ -72,7 +72,7 @@ stata <- readRDS(testing_path("stata/stata.rds"))$mass_glm_nb model <- suppressWarnings( MASS::glm.nb(carb ~ wt + factor(cyl), data = mtcars)) -mfx <- tidy(slopes(model)) +mfx <- avg_slopes(model) stata$contrast <- ifelse(stata$term == "factor(cyl)6", "6 - 4", "") stata$contrast <- ifelse(stata$term == "factor(cyl)8", "8 - 4", stata$contrast) stata$term <- ifelse(grepl("cyl", stata$term), "cyl", stata$term) @@ -85,8 +85,7 @@ stata <- readRDS(testing_path("stata/stata.rds"))[["MASS_polr_01"]] dat <- read.csv(testing_path("stata/databases/MASS_polr_01.csv")) mod <- MASS::polr(factor(y) ~ x1 + x2, data = dat, Hess = TRUE) -mfx <- slopes(mod, type = "probs") -mfx <- tidy(mfx) +mfx <- avg_slopes(mod, type = "probs") mfx <- merge(mfx, stata) expect_equivalent(mfx$estimate, mfx$dydxstata, tolerance = .01) expect_equivalent(mfx$std.error, mfx$std.errorstata, tolerance = .01) @@ -147,10 +146,9 @@ dat$am <- as.logical(dat$am) dat <- dat model <- suppressWarnings(MASS::glm.nb(carb ~ am + cyl, data = dat)) -mm <- marginal_means(model, type = "link", variables = "cyl") -ti <- tidy(mm) |> dplyr::arrange(value) +mm <- predictions(model, type = "link", by = "cyl", newdata = datagrid(grid_type = "balanced")) +ti <- mm |> dplyr::arrange(cyl) em <- tidy(emmeans::emmeans(model, "cyl")) -expect_marginal_means(mm) expect_equivalent(ti$estimate, em$estimate) expect_equivalent(ti$std.error, em$std.error, tolerance = 1e-4) @@ -159,9 +157,7 @@ dat$cyl <- as.factor(dat$cyl) dat$am <- as.logical(dat$am) model <- MASS::rlm(mpg ~ cyl + am, dat) -mm <- marginal_means(model) -expect_marginal_means(mm) -ti <- tidy(marginal_means(model, variables = "cyl")) |> dplyr::arrange(value) +ti <- predictions(model, by = "cyl", newdata = datagrid(grid_type = "balanced")) |> dplyr::arrange(cyl) em <- tidy(emmeans::emmeans(model, "cyl")) expect_equivalent(ti$estimate, em$estimate) expect_equivalent(ti$std.error, em$std.error, tolerance = 1e-4) @@ -200,14 +196,13 @@ dat <- dat mod <- polr(factor(gear) ~ cyl, data = dat, Hess = TRUE) # not clear why this generates a warning only on CI -mfx <- suppressMessages(slopes(mod, type = "probs")) -tid <- tidy(mfx) +tid <- suppressMessages(avg_slopes(mod, type = "probs")) expect_equivalent(nrow(tid), 6) # polr: average predictions by group against Stata mod <- polr(factor(gear) ~ hp, data = mtcars, Hess = TRUE) -p <- suppressMessages(tidy(predictions(mod, type = "probs"))) +p <- suppressMessages(avg_predictions(mod, type = "probs")) expect_equivalent( p$estimate, c(.4933237, .363384, .1432922), @@ -243,7 +238,7 @@ # TODO: emmeans seems broken at the moment # em <- emmeans(mod, specs = "am", type = "response") # em <- tidy(em) -mm <- marginal_means(mod, variables = "am", type = "probs") +mm <- predictions(mod, by = "am", type = "probs", newdata = datagrid(grid_type = "balanced")) expect_equivalent(nrow(mm), 6) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-afex.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-afex.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-afex.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-afex.R 2024-02-05 01:34:54.000000000 +0000 @@ -14,16 +14,6 @@ cmp <- comparisons(mod) expect_inherits(cmp, "comparisons") -# marginalmeans vs. emmeans -mm <- marginal_means( - mod, - variables = c("angle", "noise"), - cross = FALSE) -em1 <- data.frame(emmeans(mod, ~angle)) -em2 <- data.frame(emmeans(mod, ~noise)) -expect_equal(mm$estimate, c(em1$emmean, em2$emmean)) -expect_equal(mm$std.error, c(em1$SE, em2$SE)) - # contrasts vs emmeans cmp <- comparisons(mod, variables = "angle", @@ -52,7 +42,9 @@ data = obk.long, observed = "gender")) em <- data.frame(emmeans(mod, ~ phase)) -mm <- marginal_means(mod, "phase") +mm <- predictions(mod, + newdata = datagrid(grid_type = "balanced"), + by = "phase") expect_equivalent(mm$estimate, em$emmean) expect_equivalent(mm$std.error, em$SE) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-betareg.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-betareg.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-betareg.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-betareg.R 2024-02-05 01:34:54.000000000 +0000 @@ -30,7 +30,7 @@ # marginaleffects: vs. Stata # stata does not include contrasts stata <- readRDS(testing_path("stata/stata.rds"))[["betareg_betareg_01"]] -mfx <- merge(tidy(slopes(mod)), stata) +mfx <- merge(avg_slopes(mod), stata) expect_equivalent(mfx$estimate, mfx$dydxstata, tolerance = .0001) expect_equivalent(mfx$std.error, mfx$std.errorstata, tolerance = .0001) @@ -43,10 +43,10 @@ # marginalmeans: vs. emmeans -mm <- marginal_means(mod, type = "link") -expect_inherits(mm, "marginalmeans") +mm <- predictions(mod, type = "link", by = "batch", newdata = datagrid(grid_type = "balanced")) |> + dplyr::arrange(batch) +expect_inherits(mm, "predictions") expect_equal(nrow(mm), 10) -mm <- tidy(mm) em <- broom::tidy(emmeans::emmeans(mod, "batch")) expect_equivalent(mm$estimate, em$estimate) expect_equivalent(mm$std.error, em$std.error, tolerance = 0.01) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-brms.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-brms.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-brms.R 2023-10-20 14:07:51.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-brms.R 2024-01-24 02:04:51.000000000 +0000 @@ -12,6 +12,7 @@ options("marginaleffects_posterior_interval" = "hdi") requiet("brms") requiet("emmeans") +requiet("mice") requiet("broom") requiet("posterior") requiet("data.table") @@ -20,45 +21,38 @@ tol_se <- 0.001 +# load models +brms_numeric <- readRDS("modelarchive/data/brms_numeric.rds") +brms_numeric2 <- readRDS("modelarchive/data/brms_numeric2.rds") +brms_character <- readRDS("modelarchive/data/brms_character.rds") +brms_factor <- readRDS("modelarchive/data/brms_factor.rds") +brms_factor_formula <- readRDS("modelarchive/data/brms_factor_formula.rds") +brms_interaction <- readRDS("modelarchive/data/brms_interaction.rds") +brms_logical <- readRDS("modelarchive/data/brms_logical.rds") +brms_epi <- readRDS("modelarchive/data/brms_epi.rds") +brms_cumulative_random <- readRDS("modelarchive/data/brms_cumulative_random.rds") +brms_monotonic <- readRDS("modelarchive/data/brms_monotonic.rds") +brms_monotonic_factor <- readRDS("modelarchive/data/brms_monotonic_factor.rds") +brms_vdem <- readRDS("modelarchive/data/brms_vdem.rds") +brms_lognormal_hurdle <- readRDS("modelarchive/data/brms_lognormal_hurdle.rds") +brms_lognormal_hurdle2 <- readRDS("modelarchive/data/brms_lognormal_hurdle2.rds") +brms_binomial <- readRDS("modelarchive/data/brms_binomial.rds") +brms_mv_1 <- readRDS("modelarchive/data/brms_mv_1.rds") +brms_vdem <- readRDS("modelarchive/data/brms_vdem.rds") +brms_ordinal_1 <- readRDS("modelarchive/data/brms_ordinal_1.rds") +brms_categorical_1 <- readRDS("modelarchive/data/brms_categorical_1.rds") +brms_logit_re <- readRDS("modelarchive/data/brms_logit_re.rds") +brms_mixed_3 <- readRDS("modelarchive/data/brms_mixed_3.rds") +brms_kurz <- readRDS("modelarchive/data/brms_kurz.rds") +brms_inhaler_cat <- readRDS("modelarchive/data/brms_inhaler_cat.rds") +brms_poisson <- readRDS("modelarchive/data/brms_poisson.rds") +brms_issue500 <- readRDS("modelarchive/data/brms_issue500.rds") +brms_issue576 <- readRDS("modelarchive/data/brms_issue576.rds") +brms_issue639 <- readRDS("modelarchive/data/brms_issue639.rds") +brms_issue782 <- readRDS("modelarchive/data/brms_issue782.rds") +brms_issue1006 <- readRDS("modelarchive/data/brms_issue1006.rds") -# download models -brms_numeric <- marginaleffects:::modelarchive_model("brms_numeric") -brms_numeric2 <- marginaleffects:::modelarchive_model("brms_numeric2") -brms_character <- marginaleffects:::modelarchive_model("brms_character") -brms_factor <- marginaleffects:::modelarchive_model("brms_factor") -brms_factor_formula <- marginaleffects:::modelarchive_model("brms_factor_formula") -brms_interaction <- marginaleffects:::modelarchive_model("brms_interaction") -brms_logical <- marginaleffects:::modelarchive_model("brms_logical") -brms_epi <- marginaleffects:::modelarchive_model("brms_epi") -brms_cumulative_random <- marginaleffects:::modelarchive_model("brms_cumulative_random") -brms_monotonic <- marginaleffects:::modelarchive_model("brms_monotonic") -brms_monotonic_factor <- marginaleffects:::modelarchive_model("brms_monotonic_factor") -brms_vdem <- marginaleffects:::modelarchive_model("brms_vdem") -brms_lognormal_hurdle <- marginaleffects:::modelarchive_model("brms_lognormal_hurdle") -brms_lognormal_hurdle2 <- marginaleffects:::modelarchive_model("brms_lognormal_hurdle2") -brms_binomial <- marginaleffects:::modelarchive_model("brms_binomial") -brms_mv_1 <- marginaleffects:::modelarchive_model("brms_mv_1") -brms_vdem <- marginaleffects:::modelarchive_model("brms_vdem") -brms_ordinal_1 <- insight::download_model("brms_ordinal_1") -brms_categorical_1 <- marginaleffects:::modelarchive_model("brms_categorical_1") -brms_logit_re <- marginaleffects:::modelarchive_model("brms_logit_re") - -# link (code from easystats circus) -# brms_mixed_3 <- insight::download_model("brms_mixed_3") -set.seed(123) -tmp <- read.csv("https://vincentarelbundock.github.io/Rdatasets/csv/lme4/sleepstudy.csv") -tmp$grp <- sample(1:5, size = 180, replace = TRUE) -tmp$cat <- as.factor(sample(1:5, size = 180, replace = TRUE)) -tmp$Reaction_d <- - ifelse(tmp$Reaction < median(tmp$Reaction), 0, 1) -tmp <- tmp |> - poorman::group_by(grp) |> - poorman::mutate(subgrp = sample(1:15, size = poorman::n(), replace = TRUE)) -void <- capture.output(suppressMessages( - brms_mixed_3 <- brm(Reaction ~ Days + (1 | grp / subgrp) + (1 | Subject), data = tmp) -)) - # average marginal effects brmsmargins options("marginaleffects_posterior_interval" = "eti") @@ -69,10 +63,7 @@ contrasts = cbind("AME MPG" = c(-1 / h, 1 / h)), CI = 0.95, CIType = "ETI") bm <- data.frame(bm$ContrastSummary) - -mfx <- slopes(brms_numeric) -mfx <- tidy(mfx) - +mfx <- avg_slopes(brms_numeric) expect_equivalent(mean(posterior_draws(mfx)$draw), bm$M, tolerance = tol) expect_equivalent(mfx$conf.low, bm$LL, tolerance = tol) expect_equivalent(mfx$conf.high, bm$UL, tolerance = tol) @@ -80,7 +71,7 @@ options("marginaleffects_posterior_interval" = "hdi") # marginaleffects vs. emmeans -mfx <- slopes( +mfx <- avg_slopes( brms_numeric2, newdata = datagrid(mpg = 20, hp = 100), variables = "mpg", @@ -92,7 +83,7 @@ expect_equivalent(mfx$conf.low, em$lower.HPD) expect_equivalent(mfx$conf.high, em$upper.HPD) # tolerance is less good for back-transformed response -mfx <- slopes(brms_numeric2, newdata = datagrid(mpg = 20, hp = 100), +mfx <- avg_slopes(brms_numeric2, newdata = datagrid(mpg = 20, hp = 100), variables = "mpg", type = "response") em <- emtrends(brms_numeric2, ~mpg, "mpg", at = list(mpg = 20, hp = 100), regrid = "response") em <- tidy(em) @@ -126,6 +117,15 @@ # predictions w/ random effects +set.seed(123) +tmp <- read.csv("https://vincentarelbundock.github.io/Rdatasets/csv/lme4/sleepstudy.csv") +tmp$grp <- sample(1:5, size = 180, replace = TRUE) +tmp$cat <- as.factor(sample(1:5, size = 180, replace = TRUE)) +tmp$Reaction_d <- + ifelse(tmp$Reaction < median(tmp$Reaction), 0, 1) +tmp <- tmp |> + poorman::group_by(grp) |> + poorman::mutate(subgrp = sample(1:15, size = poorman::n(), replace = TRUE)) w <- apply(posterior_linpred(brms_mixed_3), 2, stats::median) x <- get_predict(brms_mixed_3, newdata = tmp, type = "link") y <- predictions(brms_mixed_3, type = "link") @@ -178,8 +178,7 @@ dat$logic <- as.logical(dat$vs) dat$cyl_fac <- as.factor(dat$cyl) dat$cyl_cha <- as.character(dat$cyl) -mfx <- slopes(brms_factor, newdata = dat) -ti <- tidy(mfx) +ti <- avg_slopes(brms_factor, newdata = dat) expect_inherits(ti, "data.frame") expect_true(nrow(ti) == 3) expect_true(ncol(ti) >= 5) @@ -227,14 +226,6 @@ -# marginalmeans vs. emmeans -requiet("emmeans") -requiet("broom") -expect_error(marginal_means(brms_factor, variables = "cyl_fac", type = "link")) -# emmeans::emmeans(brms_factor, specs = ~cyl_fac) - - - # marginaleffects: no validity expect_slopes(brms_numeric2, se = FALSE) expect_slopes(brms_interaction, se = FALSE) @@ -326,8 +317,8 @@ # comparisons expect_error(comparisons(brms_monotonic_factor), pattern = "cannot be used") -contr1 <- tidy(comparisons(brms_monotonic)) -known <- c(sprintf("mean(%s) - mean(1)", c(2:4, 6, 8)), "mean(+1)") +contr1 <- avg_comparisons(brms_monotonic) +known <- c(sprintf("%s - 1", c(2:4, 6, 8)), "+1") expect_equivalent(contr1$contrast, known) @@ -386,8 +377,7 @@ # bugs stay dead: character regressors used to produce duplicates expect_slopes(brms_character, se = FALSE) -mfx <- slopes(brms_character) -ti <- tidy(mfx) +mfx <- avg_slopes(brms_character) expect_true(length(unique(ti$estimate)) == nrow(ti)) @@ -542,18 +532,9 @@ dat <- mtcars dat$cyl <- factor(dat$cyl) mod <- lm(mpg ~ am * factor(cyl), data = mtcars) -void <- capture.output(suppressMessages( - mod.b <- brm( - mpg ~ am * cyl, - data = dat, - family = gaussian, - seed = 1024) -)) - -cmp <- comparisons(mod, variables = c("cyl", "am"), cross = TRUE) -cmp.b <- comparisons(mod.b, variables = c("cyl", "am"), cross = TRUE) -tid <- tidy(cmp) -tid.b <- tidy(cmp.b) + +tid <- avg_comparisons(mod, variables = c("cyl", "am"), cross = TRUE) +tid.b <- avg_comparisons(brms_kurz, variables = c("cyl", "am"), cross = TRUE) expect_equivalent(tid$estimate, tid.b$estimate, tolerance = 0.1) @@ -568,19 +549,15 @@ # transform works for comparisons() and predictions() -void <- capture.output(suppressMessages( - mod <- brm(gear ~ mpg + hp, data = mtcars, family = poisson) -)) - -p1 <- predictions(mod, type = "link") -p2 <- predictions(mod, type = "link", transform = exp) +p1 <- predictions(brms_poisson, type = "link") +p2 <- predictions(brms_poisson, type = "link", transform = exp) expect_equivalent(exp(p1$estimate), p2$estimate) expect_equivalent(exp(p1$conf.low), p2$conf.low) expect_equivalent(exp(p1$conf.high), p2$conf.high) expect_equivalent(exp(attr(p1, "posterior_draws")), attr(p2, "posterior_draws")) -p1 <- comparisons(mod, type = "link") -p2 <- comparisons(mod, type = "link", transform = exp) +p1 <- comparisons(brms_poisson, type = "link") +p2 <- comparisons(brms_poisson, type = "link", transform = exp) expect_equivalent(exp(p1$estimate), p2$estimate) expect_equivalent(exp(p1$conf.low), p2$conf.low) expect_equivalent(exp(p1$conf.high), p2$conf.high) @@ -602,22 +579,7 @@ # Issue #500 -# TODO -N <- 1250 -n <- sample(10:100, size = N, replace = TRUE) -x <- rbinom(N, 1, 0.5) -w <- rbinom(N, 1, 0.5) -z <- rbinom(N, 1, 0.5) -y <- rbinom(N, n, 0.25 + .25 * x + .125 * w + 0.05 * z) -d <- data.frame(x, w, z, y, n) -void <- capture.output(suppressMessages( - fit <- brm( - y | trials(n) ~ ., - data = d, - family = binomial(), - chains = 1) -)) -p <- plot_predictions(fit, condition = "z") +p <- plot_predictions(brms_issue500, condition = "z") expect_inherits(p, "gg") @@ -626,12 +588,11 @@ K <<- 100 -cmp <- comparisons( +cmp <- avg_comparisons( brms_logit_re, newdata = datagrid(firm = sample(1e5:2e6, K)), allow_new_levels = TRUE, sample_new_levels = "gaussian") -cmp <- tidy(cmp) bm <- brmsmargins( k = K, @@ -648,16 +609,14 @@ # posterior_draws(shape = ) -cmp <- comparisons(brms_numeric2) -tid <- tidy(cmp) +tid <- avg_comparisons(brms_numeric2) pd <- posterior_draws(tid, shape = "DxP") hyp <- brms::hypothesis(pd, "b1 - b2 > 0") expect_inherits(hyp, "brmshypothesis") # posterior::rvar -cmp <- comparisons(brms_numeric2) -tid <- tidy(cmp) +tid <- avg_comparisons(brms_numeric2) rv <- posterior_draws(tid, "rvar") expect_equivalent(nrow(rv), 2) expect_inherits(rv$rvar[[1]], "rvar") @@ -669,35 +628,19 @@ # Issue #576 -void <- capture.output(suppressMessages( - mod <- brm(mpg ~ hp, data = mtcars) -)) -cmp <- comparisons(mod) +cmp <- comparisons(brms_issue576) expect_equal(nrow(cmp), 32) -cmp <- comparisons(mod, by = "term") +cmp <- comparisons(brms_issue576, by = "term") expect_equal(nrow(cmp), 1) -cmp <- comparisons(mod, by = "cyl") +cmp <- comparisons(brms_issue576, by = "cyl") expect_equal(nrow(cmp), 3) -cmp <- comparisons(mod, by = "am") +cmp <- comparisons(brms_issue576, by = "am") expect_equal(nrow(cmp), 2) # Issue #639 -dat <- structure(list(y = structure(c(1L, 1L, 2L, 2L, 3L, 3L, 4L, 4L, -5L, 5L), levels = c("1", "2", "3", "4", "5"), class = c("ordered", -"factor")), x = structure(c(1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, -2L), levels = c("0", "1"), class = "factor"), n = c(102L, 50L, -97L, 84L, 9L, 11L, 89L, 130L, 38L, 59L)), class = "data.frame", row.names = c(NA, --10L)) -dat <- transform(dat, x = factor(x), y = ordered(y)) -void <- capture.output(suppressMessages( - m <- brms::brm( - y | weights(n) ~ x, - data = dat, - family = "cumulative") -)) -pre <- avg_predictions(m) -cmp <- avg_comparisons(m) +pre <- avg_predictions(brms_issue639) +cmp <- avg_comparisons(brms_issue639) expect_inherits(pre, "predictions") expect_inherits(cmp, "comparisons") expect_equivalent(nrow(pre), 5) @@ -706,10 +649,9 @@ # Issue #703 -mod <- marginaleffects:::modelarchive_model("brms_inhaler_cat") -pre <- predictions(mod, type = "link") +pre <- predictions(brms_inhaler_cat, type = "link") expect_inherits(pre, "predictions") -cmp <- comparisons(mod, type = "link") +cmp <- comparisons(brms_inhaler_cat, type = "link") expect_inherits(cmp, "comparisons") @@ -720,35 +662,6 @@ expect_inherits(cmp, "comparisons") -# Issue #782: by reorders factors incorrectly in brms models -dat <- read.csv("https://vincentarelbundock.github.io/Rdatasets/csv/carData/TitanicSurvival.csv") -dat$survived <- ifelse(dat$survived == "yes", 1, 0) -dat$woman <- ifelse(dat$sex == "female", 1, 0) -dat$passengerClass <- factor(dat$passengerClass, levels = c("3rd", "2nd", "1st")) - -mod <- marginaleffects:::hush(brm(survived ~ woman * age + passengerClass, - family = bernoulli(link = "logit"), - data = dat)) - -set.seed(1024) -known <- slopes( - mod, - variables = "woman") |> - posterior_draws() |> - data.table() -known <- known[, .(estimate = mean(estimate)), by = c("drawid", "passengerClass")][ - , .(estimate = median(estimate)), by = "passengerClass"] |> - dplyr::arrange(passengerClass) -set.seed(1024) -unknown <- slopes( - mod, - variables = "woman", - by = "passengerClass") |> - dplyr::arrange(passengerClass) -expect_equal(known$estimate, unknown$estimate, tolerance = 1e-3) -expect_equal(known$passengerClass, unknown$passengerClass) - - # Issue #888: posterior_draws() fails for quantile transformation expect_error(predictions( brms_factor, @@ -758,6 +671,16 @@ pattern = "matrix input must return") +# Issue 1006: predictor is also a response +cmp <- avg_comparisons(brms_issue1006) +expect_inherits(cmp, "comparisons") +cmp <- avg_comparisons(brms_issue1006, variables = list(chl = 1)) +expect_inherits(cmp, "comparisons") +cmp <- avg_comparisons(brms_issue1006, variables = list(chl = 1)) +expect_inherits(cmp, "comparisons") +cmp <- avg_comparisons(brms_issue1006, variables = list(chl = 1, age = 1)) +expect_inherits(cmp, "comparisons") + source("helpers.R") diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-crch.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-crch.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-crch.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-crch.R 2024-02-05 01:34:54.000000000 +0000 @@ -48,15 +48,6 @@ expect_predictions(pred2, n_row = 6) -# marginalmeans: crch gaussian: no validity -tmp <- dat -tmp$categ <- as.factor(sample(letters[1:5], nrow(tmp), replace = TRUE)) -model <- crch(sqrt(rain) ~ sqrtensmean + sqrtenssd + categ, - data = tmp, dist = "gaussian") -mm <- marginal_means(model) -expect_marginal_means(mm, n_row = 5) - - source("helpers.R") diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-estimatr.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-estimatr.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-estimatr.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-estimatr.R 2024-02-05 01:34:54.000000000 +0000 @@ -75,7 +75,6 @@ data = tmp) expect_predictions(predictions(model), n_row = nrow(tmp)) expect_predictions(predictions(model, newdata = head(tmp)), n_row = 6) -expect_marginal_means(marginal_means(model)) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-fixest.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-fixest.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-fixest.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-fixest.R 2023-12-24 03:08:04.000000000 +0000 @@ -47,7 +47,7 @@ data(EmplUK, package = "plm") stata <- readRDS(testing_path("stata/stata.rds"))$fixest_feols model <- feols(wage ~ capital * output | firm, EmplUK) -mfx <- merge(tidy(slopes(model)), stata) +mfx <- merge(avg_slopes(model), stata) expect_slopes(model) expect_equivalent(mfx$estimate, mfx$estimate) expect_equivalent(mfx$std.error, mfx$std.errorstata, tolerance = .00001) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-gam.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-gam.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-gam.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-gam.R 2024-02-05 01:34:54.000000000 +0000 @@ -38,16 +38,23 @@ # `datagrid()` is smarter than `emmeans()` about integers atlist <- list(Age = round(mean(tmp$Age)), Number = round(mean(tmp$Number))) -mm1 <- marginal_means(model, numderiv = "richardson") |> dplyr::arrange(value) +mm1 <- predictions(model, by = "categ", newdata = datagrid(grid_type = "balanced"), numderiv = "richardson") |> dplyr::arrange(categ) em1 <- data.frame(emmeans(model, specs = "categ", type = "response", at = atlist)) -mm2 <- marginal_means(model, type = "link", numderiv = "richardson") |> dplyr::arrange(value) + +mm1 <- predictions(model, + newdata = datagrid( + grid_type = "balanced", + Age = round(mean(tmp$Age)), + Number = round(mean(tmp$Number))), + by = "categ") +mm2 <- predictions(model, type = "link", by = "categ", newdata = datagrid(grid_type = "balanced"), numderiv = "richardson") |> dplyr::arrange(categ) em2 <- data.frame(emmeans(model, specs = "categ", at = atlist)) expect_equivalent(mm1$estimate, em1$prob) expect_equivalent(mm2$estimate, em2$emmean) -expect_equivalent(mm1$conf.low, em1$asymp.LCL) -expect_equivalent(mm1$conf.high, em1$asymp.UCL) -expect_equivalent(mm2$conf.low, em2$asymp.LCL) +expect_equivalent(mm1$conf.low, em1$asymp.LCL, tolerance = 1e-6) +expect_equivalent(mm1$conf.high, em1$asymp.UCL, tolerance = 1e-6) +expect_equivalent(mm2$conf.low, em2$asymp.LCL, tolerance = 1e-6) expect_equivalent(mm2$conf.high, em2$asymp.UCL, tolerance = 1e-4) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-gamlss.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-gamlss.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-gamlss.R 2023-10-17 18:24:22.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-gamlss.R 2024-02-05 01:34:54.000000000 +0000 @@ -54,9 +54,7 @@ # marginalmeans: vs. emmeans -mm <- marginal_means(mod, what = "mu") -expect_marginal_means(mm, n_row = 10) -mm <- tidy(mm) +mm <- predictions(mod, by = "batch", newdata = datagrid(grid_type="balanced"), what = "mu") em <- broom::tidy(emmeans::emmeans(mod, "batch", type = "response")) expect_equivalent(mm$estimate, em$response, tol = 0.001) expect_equivalent(mm$std.error, em$std.error, tolerance = 0.01) @@ -101,9 +99,8 @@ # marginalmeans: vs. emmeans -mm <- marginal_means(mod, variables = "Pclass", what = "mu") |> - dplyr::arrange(value) -expect_marginal_means(mm, n_row = 3) +mm <- predictions(mod, by = "Pclass", what = "mu", newdata = datagrid(grid_type = "balanced")) |> + dplyr::arrange(Pclass) mm <- tidy(mm) em <- broom::tidy(emmeans::emmeans(mod, "Pclass", type = "response")) expect_equivalent(mm$estimate, em$response) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-glmmTMB.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-glmmTMB.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-glmmTMB.R 2023-10-02 13:42:27.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-glmmTMB.R 2024-02-05 01:34:54.000000000 +0000 @@ -138,43 +138,17 @@ -# marginalmeans (no validity) -dat <- "https://vincentarelbundock.github.io/Rdatasets/csv/Stat2Data/Titanic.csv" -dat <- read.csv(dat) -dat$z <- factor(sample(1:4, nrow(dat), replace = TRUE)) -mod <- glmmTMB( - Survived ~ Sex + z + (1 + Age | PClass), - family = binomial, - data = dat) -mm1 <- marginal_means(mod, variables = c("Sex", "PClass")) |> dplyr::arrange(value) -mm2 <- marginal_means(mod, type = "link", variables = c("Sex", "PClass")) |> dplyr::arrange(value) -mm3 <- marginal_means(mod, variables = c("Sex", "PClass"), cross = TRUE) |> dplyr::arrange(Sex, PClass) -mm4 <- marginal_means(mod, type = "link", variables = c("Sex", "PClass"), cross = TRUE) |> dplyr::arrange(Sex, PClass) -expect_true(all(mm1$estimate != mm2$estimate)) -expect_true(all(mm1$std.error != mm2$std.error)) -expect_true(all(mm3$estimate != mm4$estimate)) -expect_true(all(mm3$std.error != mm4$std.error)) -expect_true(nrow(mm3) > nrow(mm1)) - # marginalmeans: some validity p <- predictions(mod, type = "link", re.form = NA) expect_inherits(p, "predictions") em <- data.frame(emmeans(mod, ~Sex)) -mm <- marginal_means(mod, variables = "Sex", type = "link", re.form = NA) +mm <- predictions(mod, by = "Sex", newdata = datagrid(grid_type = "balanced"), type = "link", re.form = NA) expect_equivalent(em$emmean, mm$estimate) expect_equivalent(em$SE, mm$std.error) -mfx <- slopes(m1) -m1 <- glmmTMB( - count ~ mined + (1 | site), - zi = ~mined, - family = poisson, data = Salamanders) -expect_inherits(marginal_means(m1, variables = "mined"), "marginalmeans") - - # Issue #466: REML not supported # Problem is that model$fit$par does not include all the parameters when @@ -188,16 +162,6 @@ transform(PlantGrowth, trial = "C", weight = runif(30) * weight))) colnames(dat)[2] <- "groupid" -model <- glmmTMB( - weight ~ groupid + trial + (1 | groupid:trial), - REML = FALSE, - data = dat) -em <- data.frame(emmeans(model, ~trial + groupid, df = Inf)) -mm <- marginal_means(model, variables = c("trial", "groupid"), cross = TRUE, re.form = NA) -mm <- mm[order(mm$groupid, mm$trial),] -expect_equivalent(mm$estimate, em$emmean) -expect_equivalent(mm$conf.high, em$asymp.UCL) - model_REML <- glmmTMB( weight ~ groupid + trial + (1 | groupid:trial), REML = TRUE, @@ -206,7 +170,6 @@ expect_error(slopes(model_REML), pattern = "REML") expect_error(comparisons(model_REML), pattern = "REML") expect_error(predictions(model_REML), pattern = "REML") -expect_error(marginal_means(model_REML), pattern = "REML") expect_inherits(slopes(model_REML, vcov = FALSE), "marginaleffects") expect_inherits(predictions(model_REML, re.form = NA, vcov = FALSE), "predictions") expect_inherits(predictions(model_REML, vcov = FALSE, re.form = NA), "predictions") diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-ivreg.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-ivreg.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-ivreg.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-ivreg.R 2024-02-05 01:34:54.000000000 +0000 @@ -41,16 +41,6 @@ expect_predictions(pred2, n_row = 6) -# marginalmeans: no validity -set.seed(1024) -data(Kmenta, package = "ivreg") -tmp <- Kmenta -tmp$categ <- factor(sample(letters[1:5], nrow(tmp), replace = TRUE)) -mod <- ivreg::ivreg(Q ~ P + D + categ | D + F + A + categ, data = tmp) -mm <- marginal_means(mod) -expect_marginal_means(mm) - - rm(list = ls()) \ No newline at end of file diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-lme4.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-lme4.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-lme4.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-lme4.R 2024-01-24 02:04:51.000000000 +0000 @@ -101,7 +101,7 @@ tmp <- read.csv(testing_path("stata/databases/lme4_02.csv")) mod <- glmer(y ~ x1 * x2 + (1 | clus), data = tmp, family = binomial) stata <- readRDS(testing_path("stata/stata.rds"))$lme4_glmer -mfx <- merge(tidy(slopes(mod)), stata) +mfx <- merge(avg_slopes(mod), stata) expect_slopes(mod) expect_equivalent(mfx$estimate, mfx$dydxstata, tolerance = .01) expect_equivalent(mfx$std.error, mfx$std.errorstata, tolerance = .01) @@ -126,7 +126,7 @@ tmp <- read.csv(testing_path("stata/databases/lme4_01.csv")) mod <- lme4::lmer(y ~ x1 * x2 + (1 | clus), data = tmp) stata <- readRDS(testing_path("stata/stata.rds"))$lme4_lmer -mfx <- merge(tidy(slopes(mod)), stata) +mfx <- merge(avg_slopes(mod), stata) expect_slopes(mod) expect_equivalent(mfx$estimate, mfx$dydxstata, tolerance = .001) expect_equivalent(mfx$std.error, mfx$std.errorstata, tolerance = .001) @@ -165,8 +165,7 @@ # bug stay dead: tidy without std.error tmp <- read.csv(testing_path("stata/databases/lme4_02.csv")) mod <- lme4::glmer(y ~ x1 * x2 + (1 | clus), data = tmp, family = binomial) -res <- slopes(mod, vcov = FALSE) -tid <- tidy(res) +tid <- avg_slopes(mod, vcov = FALSE) expect_inherits(tid, "data.frame") expect_equivalent(nrow(tid), 2) @@ -207,7 +206,7 @@ # margins mar <- tidy(margins(mod)) -mfx <- tidy(slopes(mod)) +mfx <- avg_slopes(mod) expect_equivalent(mfx$estimate, mar$estimate, tolerance = .0001) expect_equivalent(mfx$std.error, mar$std.error, tolerance = .0001) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-lmerTest.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-lmerTest.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-lmerTest.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-lmerTest.R 2023-12-24 03:08:04.000000000 +0000 @@ -17,14 +17,12 @@ # emmeans em <- suppressMessages(emmeans::emtrends(mod, ~x1, "x1", at = list(x1 = 0, x2 = 0))) em <- tidy(em) -me <- slopes(mod, newdata = datagrid(x1 = 0, x2 = 0, clus = 1)) -me <- tidy(me) +me <- avg_slopes(mod, newdata = datagrid(x1 = 0, x2 = 0, clus = 1)) expect_equivalent(me$std.error[1], em$std.error, tolerance = .01) expect_equivalent(me$estimate[1], em$x1.trend) # margins -me <- slopes(mod) -me <- tidy(me) +me <- avg_slopes(mod) ma <- margins(mod) ma <- tidy(ma) expect_equivalent(me$std.error, ma$std.error, tolerance = .0001) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-mhurdle.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-mhurdle.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-mhurdle.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-mhurdle.R 2023-12-24 03:08:04.000000000 +0000 @@ -26,8 +26,7 @@ expect_equivalent(mfx[mfx$term == "age", "std.error"], mar$SE_dydx_age, tolerance = tol_se) # marginaleffects vs. margins: AME -mfx <- slopes(m2, type = "E") -mfx <- tidy(mfx) +mfx <- avg_slopes(m2, type = "E") mfx <- mfx[match(c("age", "educ", "linc", "size", "smsa"), mfx$term),] mar <- margins(m2) mar <- summary(mar) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-mice.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-mice.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-mice.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-mice.R 2024-02-05 01:34:54.000000000 +0000 @@ -40,26 +40,9 @@ fit <- with(imp, glm(endp ~ trt, family = binomial(link = "logit"))) auto <- suppressWarnings(avg_slopes(fit)) expect_equivalent(auto$estimate, manu$estimate) -expect_equivalent(auto$std.error, manu$std.error) +expect_equivalent(auto$std.error, manu$std.error, tolerance = 1e-6) -# Issue #793 -set.seed(1024) -dat <- iris -dat$Sepal.Length[sample(seq_len(nrow(iris)), 40)] <- NA -dat$Sepal.Width[sample(seq_len(nrow(iris)), 40)] <- NA -dat$Species[sample(seq_len(nrow(iris)), 40)] <- NA -dat_mice <- mice(dat, m = 20, printFlag = FALSE, .Random.seed = 1024) -mod_mice <- with(dat_mice, lm(Petal.Width ~ Sepal.Length * Sepal.Width + Species)) -marg_means_mice = marginal_means(mod_mice) -expect_inherits(marg_means_mice, "marginalmeans") - -mod_mice <- with(dat_mice, glm(rbinom(n = length(Petal.Width), 1, 0.5) ~ Sepal.Length * Sepal.Width + Species, family = "binomial")) -expect_error(marginal_means(mod_mice), pattern = "std.error") -m <- marginal_means(mod_mice, type = "response") -expect_inherits(m, "marginalmeans") - - source("helpers.R") \ No newline at end of file diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-mvgam.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-mvgam.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-mvgam.R 1970-01-01 00:00:00.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-mvgam.R 2024-01-24 02:04:51.000000000 +0000 @@ -0,0 +1,62 @@ +source("helpers.R") +using("marginaleffects") + +if (!EXPENSIVE) exit_file("EXPENSIVE") +if (ON_WINDOWS) exit_file("on windows") +if (!minver("base", "4.1.0")) exit_file("R 4.1.0") +if (!requiet("mvgam")) exit_file("mvgam not installed") + + +# load a pre-compiled model +mod1 <- mvgam:::mvgam_example1 + +# slopes() and tidy() +mfx <- slopes(mod1) +ti <- tidy(mfx) +expect_inherits(ti, "data.frame") +expect_true(nrow(ti) == 1) +expect_true(ncol(ti) >= 5) +expect_true(all(c("term", "estimate", "conf.low") %in% colnames(ti))) + +# get_predict() with original data +preds <- get_predict(mod1) +expect_equal(NROW(preds), NROW(mod1$obs_data)) + +w <- apply(posterior_linpred(mod1, process_error = FALSE), 2, stats::median) +x <- get_predict(mod1, type = "link", process_error = FALSE) +expect_equivalent(w, x$estimate) + +# get_predict() with newdata +newdat <- mod1$obs_data +newdat$season <- rep(1, nrow(newdat)) +w <- apply(posterior_linpred(mod1, + newdata = newdat, + process_error = FALSE), + 2, stats::median) +x <- get_predict(mod1, + type = "link", + newdata = newdat, + process_error = FALSE) +expect_equivalent(w, x$estimate) +expect_equal(NROW(x), NROW(newdat)) + +# expectations vs response predictions() +p1 <- suppressWarnings(predictions(mod1, type = "expected")) +p2 <- suppressWarnings(predictions(mod1, type = "response")) +expected_uncertainty <- p1$conf.high - p1$conf.low +response_uncertainty <- p2$conf.high - p2$conf.low +expect_true(all(expected_uncertainty < response_uncertainty)) + +# avg_predictions() +ems <- avg_predictions(mod1) +expect_equal(NROW(ems), 1) +expect_true(all(c("estimate", "conf.low", "conf.high") %in% colnames(ems))) + +ems <- avg_predictions(mod1, variables = list(season = c(1, 6, 12))) +expect_equal(NROW(ems), 3) +expect_true(all(c("season", "estimate", "conf.low", "conf.high") %in% colnames(ems))) + +# latent_N should be an allowed type, but shouldn't work for this model +expect_error(predictions(mod1, type = 'latent_N'), + '"latent_N" type only available for N-mixture models', + fixed = TRUE) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-nlme.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-nlme.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-nlme.R 2023-11-20 15:52:38.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-nlme.R 2024-02-05 01:34:54.000000000 +0000 @@ -44,8 +44,7 @@ data = tmp, correlation = corAR1(form = ~ 1 | Mare)) em <- suppressMessages(emmeans(mod, specs = "categ")) em <- tidy(em) -mm <- marginal_means(mod, variables = "categ") |> dplyr::arrange(value) -expect_marginal_means(mm) +mm <- predictions(mod, newdata = datagrid(grid_type = "balanced"), by = "categ") |> dplyr::arrange(categ) expect_equivalent(mm$estimate, em$estimate) expect_equivalent(mm$std.error, em$std.error, tolerance = 1e-5) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-nnet.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-nnet.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-nnet.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-nnet.R 2024-02-05 01:34:54.000000000 +0000 @@ -20,7 +20,9 @@ type = "probs", variables = "sex", by = "age3", - newdata = datagridcf(age3 = c("[0,25)","[25,50)","[50,80]"))) + newdata = datagrid( + age3 = c("[0,25)","[25,50)","[50,80]"), + grid_type = "counterfactual")) expect_equivalent(nrow(mfx), 9) @@ -37,8 +39,7 @@ void <- capture.output( mod <- nnet::multinom(factor(y) ~ x1 + x2, data = dat, quiet = true) ) -mfx <- slopes(mod, type = "probs") -s <- tidy(mfx) +s <- avg_slopes(mod, type = "probs") expect_false(anyNA(s$estimate)) expect_false(anyNA(s$std.error)) @@ -50,8 +51,8 @@ void <- capture.output( mod <- nnet::multinom(y ~ x1 + x2, data = dat, quiet = true) ) -mfx <- slopes(mod, type = "probs") -mfx <- merge(tidy(mfx), stata, all = TRUE) +mfx <- avg_slopes(mod, type = "probs") +mfx <- merge(mfx, stata, all = TRUE) mfx <- na.omit(mfx) expect_true(nrow(mfx) == 6) # na.omit doesn't trash everything # standard errors match now!! @@ -104,7 +105,6 @@ # class outcome not supported expect_error(predictions(m1, type = "class"), pattern = "type") -expect_error(marginal_means(m1, type = "class"), pattern = "type") expect_error(slopes(m1, type = "class"), pattern = "type") # small predictions @@ -178,8 +178,8 @@ family = multinomial(refLevel = 1), trace = FALSE, data = carData::WVS) -p1 <- predictions(reg, variables = list(religion = c("no"), gender = c("male"))) -p1 <- summary(p1)$estimate +p1 <- avg_predictions(reg, variables = list(religion = c("no"), gender = c("male"))) +p1 <- p1$estimate p2 <- prediction::prediction(reg , at = list(religion=c("no"), gender=c("male"))) p2 <- colMeans(p2[, grep("^Pr", colnames(p2))]) expect_equivalent(p1, p2, ignore_attr = TRUE) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-ordinal.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-ordinal.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-ordinal.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-ordinal.R 2024-01-24 02:04:51.000000000 +0000 @@ -12,9 +12,9 @@ # marginaleffects: clm: vs. MASS known <- MASS::polr(Sat ~ Infl + Type + Cont, weights = Freq, data = dat, Hess = TRUE) -known <- tidy(suppressMessages(slopes(known, type = "probs"))) +known <- suppressMessages(avg_slopes(known, type = "probs")) unknown <- clm(Sat ~ Infl + Type + Cont, weights = Freq, data = dat) -unknown <- tidy(slopes(unknown)) +unknown <- avg_slopes(unknown) expect_equivalent(unknown$estimate, known$estimate, tolerance = .00001) expect_equivalent(unknown$std.error, known$std.error, tolerance = .00001) @@ -36,8 +36,7 @@ dat$y <- factor(dat$y) dat <- dat mod <- ordinal::clm(y ~ x1 + x2, data = dat) -mfx <- slopes(mod) -mfx <- tidy(mfx) +mfx <- avg_slopes(mod) mfx <- merge(mfx, stata) expect_equivalent(mfx$estimate, mfx$dydxstata, tolerance = .001) expect_equivalent(mfx$std.error, mfx$std.errorstata, tolerance = .001) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-plm.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-plm.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-plm.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-plm.R 2023-12-24 03:08:04.000000000 +0000 @@ -30,7 +30,7 @@ # pooling vs. Stata stata <- readRDS(testing_path("stata/stata.rds"))$plm_pooling -mfx <- merge(tidy(slopes(pool)), stata) +mfx <- merge(avg_slopes(pool), stata) expect_slopes(pool, n_unique = 1) expect_equivalent(mfx$estimate, mfx$dydxstata, tolerance = tol) expect_equivalent(mfx$std.error, mfx$std.errorstata, tolerance = tol_se) @@ -39,13 +39,13 @@ # Swamy-Arora vs. Stata stata <- readRDS(testing_path("stata/stata.rds"))$plm_sa -mfx <- merge(tidy(slopes(swamy)), stata) +mfx <- merge(avg_slopes(swamy), stata) expect_slopes(swamy) expect_equivalent(mfx$estimate, mfx$dydxstata, tolerance = tol) expect_equivalent(mfx$std.error, mfx$std.errorstata, tolerance = tol_se) # margins -mfx <- tidy(slopes(swamy)) +mfx <- avg_slopes(swamy) mar <- tidy(margins(swamy)) mfx <- mfx[order(mfx$term),] expect_equivalent(mfx$estimate, mar$estimate, tolerance = tol) @@ -56,9 +56,9 @@ # no validity checks expect_slopes(amemiya) # margins -tidy(slopes(amemiya, type = "link")) -tidy(slopes(amemiya, type = "response")) -mfx <- tidy(slopes(amemiya)) +avg_slopes(amemiya, type = "link") +avg_slopes(amemiya, type = "response") +mfx <- avg_slopes(amemiya) mar <- tidy(margins(amemiya)) mfx <- mfx[order(mfx$term),] expect_equivalent(mfx$estimate, mar$estimate, tolerance = tol) @@ -67,7 +67,7 @@ expect_slopes(walhus) # margins -mfx <- tidy(slopes(walhus)) +mfx <- avg_slopes(walhus) mar <- tidy(margins(walhus)) mfx <- mfx[order(mfx$term),] expect_equivalent(mfx$estimate, mar$estimate, tolerance = tol) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-pscl.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-pscl.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-pscl.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-pscl.R 2024-02-05 01:34:54.000000000 +0000 @@ -21,10 +21,8 @@ # hurdle: marginaleffects vs margins vs emtrends data("bioChemists", package = "pscl") model <- hurdle(art ~ phd + fem | ment, data = bioChemists, dist = "negbin") -mfx1 <- slopes(model, type = "response") -mfx2 <- slopes(model, type = "zero") -mfx1 <- tidy(mfx1) -mfx2 <- tidy(mfx2) +mfx1 <- avg_slopes(model, type = "response") +mfx2 <- avg_slopes(model, type = "zero") expect_false(any(mfx1$estimate == 0)) expect_false(any(mfx2$estimate == 0)) expect_false(any(mfx1$std.error == 0)) @@ -67,7 +65,7 @@ # stata stata <- readRDS(testing_path("stata/stata.rds"))$pscl_zeroinfl_01 -mfx <- merge(tidy(slopes(model)), stata) +mfx <- merge(avg_slopes(model), stata) expect_slopes(model) expect_equivalent(mfx$estimate, mfx$dydxstata, tolerance = 1e-3) expect_equivalent(mfx$std.error, mfx$std.errorstata, tolerance = tol_se) @@ -81,8 +79,8 @@ # margins: does not support standard errors (all zeros) mar <- margins(model, data = head(bioChemists), unit_ses = TRUE) -mfx <- slopes(model, variables = c("kid5", "phd", "ment"), newdata = head(bioChemists)) -expect_equivalent(sort(summary(mar)$AME), sort(summary(mfx)$estimate), tolerance = 1e-3) +mfx <- avg_slopes(model, variables = c("kid5", "phd", "ment"), newdata = head(bioChemists)) +expect_equivalent(sort(summary(mar)$AME), sort(mfx$estimate), tolerance = 1e-3) ### predictions @@ -105,10 +103,8 @@ model <- zeroinfl(art ~ kid5 + phd + mar | ment, dist = "negbin", data = bioChemists) -mm <- marginal_means(model) -expect_marginal_means(mm) # response -mm <- tidy(marginal_means(model)) |> dplyr::arrange(value) +mm <- predictions(model, by = "mar", newdata = datagrid(grid_type = "balanced")) |> dplyr::arrange(mar) em <- tidy(emmeans(model, specs = "mar", df = Inf)) expect_equivalent(mm$estimate, em$estimate, tol = 0.01) expect_equivalent(mm$std.error, em$std.error, tolerance = .01) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-quantreg.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-quantreg.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-quantreg.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-quantreg.R 2024-02-05 01:34:54.000000000 +0000 @@ -10,7 +10,7 @@ stata <- readRDS(testing_path("stata/stata.rds"))$quantreg_rq_01 model <- suppressWarnings(quantreg::rq(mpg ~ hp * wt + factor(cyl), data = mtcars)) expect_slopes(model) -mfx <- merge(tidy(slopes(model)), stata) +mfx <- merge(avg_slopes(model), stata) expect_equivalent(mfx$estimate, mfx$dydxstata, tolerance = .0001) expect_equivalent(mfx$std.error, mfx$std.errorstata, tolerance = .001) @@ -35,13 +35,6 @@ expect_equivalent(pred2$estimate, predict(model, newdata = head(mtcars))) -# marginalmeans: rq: no validity -tmp <- mtcars -tmp$cyl <- factor(tmp$cyl) -model <- quantreg::rq(mpg ~ hp + wt + cyl, data = tmp) -mm <- marginal_means(model) -expect_marginal_means(mm) - # Issue #829 diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-speedglm.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-speedglm.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-speedglm.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-speedglm.R 2023-12-24 03:08:04.000000000 +0000 @@ -8,7 +8,7 @@ stata <- readRDS(testing_path("stata/stata.rds"))[["stats_glm_01"]] dat <- read.csv(testing_path("stata/databases/stats_glm_01.csv")) mod <- speedglm(y ~ x1 * x2, family = binomial(), data = dat) -mfx <- merge(tidy(slopes(mod)), stata) +mfx <- merge(avg_slopes(mod), stata) expect_slopes(mod) expect_equivalent(mfx$estimate, mfx$dydxstata, tolerance = .0001) expect_equivalent(mfx$std.error, mfx$std.errorstata, tolerance = .0001) @@ -22,7 +22,7 @@ stata <- readRDS(testing_path("stata/stata.rds"))[["stats_lm_01"]] dat <- read.csv(testing_path("stata/databases/stats_lm_01.csv")) mod <- speedlm(y ~ x1 * x2, data = dat) -mfx <- merge(tidy(slopes(mod)), stata) +mfx <- merge(avg_slopes(mod), stata) expect_slopes(mod) expect_equivalent(mfx$estimate, mfx$dydxstata, tolerance = .00001) expect_equivalent(mfx$std.error, mfx$std.errorstata, tolerance = .0001) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-stats.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-stats.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-stats.R 2023-11-06 17:03:37.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-stats.R 2024-02-05 01:34:54.000000000 +0000 @@ -50,7 +50,7 @@ stata <- readRDS(testing_path("stata/stata.rds"))[["stats_glm_01"]] dat <- read.csv(testing_path("stata/databases/stats_glm_01.csv")) mod <- glm(y ~ x1 * x2, family = binomial, data = dat) -ame <- merge(tidy(slopes(mod, eps = 1e-4)), stata) +ame <- merge(avg_slopes(mod, eps = 1e-4), stata) expect_equivalent(ame$estimate, ame$dydxstata, tolerance = 1e-4) expect_equivalent(ame$std.error, ame$std.errorstata, tolerance = 1e-4) @@ -60,7 +60,7 @@ stata <- readRDS(testing_path("stata/stata.rds"))[["stats_lm_01"]] dat <- read.csv(testing_path("stata/databases/stats_lm_01.csv")) mod <- lm(y ~ x1 * x2, data = dat) -ame <- merge(tidy(slopes(mod, eps = 1e-4)), stata) +ame <- merge(avg_slopes(mod, eps = 1e-4), stata) expect_equivalent(ame$estimate, ame$dydxstata, tolerance = 1e-4) expect_equivalent(ame$std.error, ame$std.errorstata, tolerance = 1e-4) @@ -94,11 +94,13 @@ dat$cyl <- as.factor(dat$cyl) dat$am <- as.logical(dat$am) mod <- lm(mpg ~ hp + cyl + am, data = dat) -mm <- tidy(marginal_means(mod, variables = "cyl")) |> dplyr::arrange(value) +mm <- predictions(mod, by = "cyl", newdata = datagrid(grid_type = "balanced")) |> + dplyr::arrange(cyl) em <- broom::tidy(emmeans::emmeans(mod, specs = "cyl")) expect_equivalent(mm$estimate, em$estimate) -expect_equivalent(mm$std.error, em$std.error) -mm <- tidy(marginal_means(mod, variables = "am")) |> dplyr::arrange(value) +expect_equivalent(mm$std.error, em$std.error, tolerance = 1e-6) +mm <- predictions(mod, by = "am", newdata = datagrid(grid_type = "balanced")) |> + dplyr::arrange(am) em <- broom::tidy(emmeans::emmeans(mod, specs = "am")) expect_equivalent(mm$estimate, em$estimate) expect_equivalent(mm$std.error, em$std.error, tolerance = 1e-5) @@ -117,22 +119,22 @@ dat$MainCity <- as.factor(dat$MainCity) mod <- glm(binary ~ Region + MainCity + Commerce, data = dat, family = "binomial") -mm <- marginal_means(mod, type = "link", variables = "Region") |> dplyr::arrange(value) +mm <- predictions(mod, type = "link", by = "Region", newdata = datagrid(grid_type = "balanced")) |> dplyr::arrange(Region) em <- data.frame(emmeans::emmeans(mod, specs = "Region")) -expect_equivalent(as.character(mm$value), as.character(em$Region)) +expect_equivalent(as.character(mm$Region), as.character(em$Region)) expect_equivalent(mm$estimate, em$emmean, tol = 0.05) # not sure why tolerance is not good expect_equivalent(mm$std.error, em$SE, tol = 0.001) -mm <- marginal_means(mod, type = "link", variables = "MainCity") |> dplyr::arrange(value) +mm <- predictions(mod, type = "link", newdata = datagrid(grid_type = "balanced"), by = "MainCity") |> dplyr::arrange(MainCity) em <- data.frame(emmeans::emmeans(mod, specs = "MainCity", type = "link")) -expect_equivalent(as.character(mm$value), as.character(em$MainCity)) +expect_equivalent(as.character(mm$MainCity), as.character(em$MainCity)) expect_equivalent(mm$estimate, em$emmean, tol = 0.01) # not sure why tolerance is not good expect_equivalent(mm$std.error, em$SE, tol = 0.001) -mm <- marginal_means(mod, type = "link", variables = "MainCity", transform = plogis) |> dplyr::arrange(value) +mm <- predictions(mod, type = "link", by = "MainCity", newdata = datagrid(grid_type = "balanced"), transform = plogis) |> dplyr::arrange(MainCity) em <- data.frame(emmeans(mod, specs = "MainCity", type = "response")) -expect_equivalent(as.character(mm$value), as.character(em$MainCity)) +expect_equivalent(as.character(mm$MainCity), as.character(em$MainCity)) expect_equivalent(mm$estimate, em$prob, tolerance = .01) expect_equivalent(mm$conf.low, em$asymp.LCL, tolerance = .01) expect_equivalent(mm$conf.high, em$asymp.UCL, tolerance = .01) @@ -164,9 +166,8 @@ # Issue #548: mlm support mod <- lm(cbind(mpg, cyl) ~ disp + am, data = mtcars) -mfx <- slopes(mod) -tid <- tidy(mfx) -expect_inherits(mfx, "marginaleffects") +tid <- avg_slopes(mod) +expect_inherits(tid, "marginaleffects") expect_equivalent(nrow(tid), 4) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-truncreg.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-truncreg.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-pkg-truncreg.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-pkg-truncreg.R 2023-12-24 03:08:04.000000000 +0000 @@ -8,8 +8,7 @@ # truncreg: no validity check data("tobin", package = "survival") model <- truncreg(durable ~ age + quant, data = tobin, subset = durable > 0) -mfx <- slopes(model) -tid <- tidy(mfx) +tid <- avg_slopes(model) expect_inherits(tid, "data.frame") expect_equivalent(nrow(tid), 2) expect_false(any(tid$estimate == 0)) @@ -26,7 +25,7 @@ data("tobin", package = "survival") model <- truncreg::truncreg(durable ~ age + quant, data = tobin, subset = durable > 0) -mfx <- merge(tidy(slopes(model)), stata) +mfx <- merge(avg_slopes(model), stata) expect_equivalent(mfx$estimate, mfx$dydxstata, tolerance = .0001) expect_equivalent(mfx$std.error, mfx$std.errorstata, tolerance = .001) # margins diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-plot_comparisons.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-plot_comparisons.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-plot_comparisons.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-plot_comparisons.R 2023-12-24 03:08:04.000000000 +0000 @@ -51,8 +51,12 @@ # Issue #725: `newdata` argument in plotting functions mod <- glm(vs ~ hp + am, mtcars, family = binomial) -p1 <- plot_comparisons(mod, variables = "hp", by = "am", newdata = datagridcf(am = 0:1), draw = FALSE) -p2 <- avg_comparisons(mod, variables = "hp", by = "am", newdata = datagridcf(am = 0:1), draw = FALSE) +p1 <- plot_comparisons(mod, + variables = "hp", by = "am", + newdata = datagrid(am = 0:1, grid_type = "counterfactual"), + draw = FALSE) +p2 <- avg_comparisons(mod, variables = "hp", by = "am", draw = FALSE, + newdata = datagrid(am = 0:1, grid_type = "counterfactual")) expect_equivalent(p1$estimate, p2$estimate) expect_equivalent(p1$conf.low, p2$conf.low, tolerance = 1e-6) p3 <- plot_comparisons(mod, variables = "hp", by = "am", draw = FALSE) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-plot_predictions.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-plot_predictions.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-plot_predictions.R 2023-10-25 16:43:38.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-plot_predictions.R 2023-12-24 03:08:04.000000000 +0000 @@ -65,6 +65,7 @@ expect_snapshot_plot(p, "plot_predictions-alpha") + # two conditions mod <- lm(mpg ~ hp * wt * am, data = mtcars) p <- plot_predictions(mod, condition = c("hp", "wt")) @@ -90,6 +91,17 @@ expect_snapshot_plot(p1, "plot_predictions_conf_99") expect_snapshot_plot(p2, "plot_predictions_conf_40") +p1 <- plot_predictions(mod, condition = "hp", conf.level = .99, draw = FALSE) +p2 <- data.frame(predict(mod, newdata = p1, se.fit = TRUE)) +expect_equivalent(p1$estimate, p2$fit) +expect_equivalent(p1$std.error, p2$se.fit, tolerance = 1e-6) +expect_equivalent( + p1$conf.low, + p2$fit - qnorm(.995) * p2$se.fit, tolerance = 1e-6) +expect_equivalent( + p1$conf.high, + p2$fit + qnorm(.995) * p2$se.fit, tolerance = 1e-6) + # link vs response mod <- glm(am ~ hp + wt, data = mtcars, family = binomial) @@ -157,7 +169,7 @@ dat <- transform(mtcars, am_fct = factor(am)) mod <- lm(wt ~ am_fct * mpg, data = dat) -p1 <- plot_cap( +p1 <- plot_predictions( mod, condition = list("am_fct", mpg = "minmax")) expect_inherits(p1, "gg") @@ -184,8 +196,10 @@ # Issue #725: `newdata` argument in plotting functions mod <- lm(mpg ~ hp + am + factor(cyl), mtcars) -p1 <- plot_predictions(mod, by = "am", newdata = datagridcf(am = 0:1), draw = FALSE) -p2 <- avg_predictions(mod, by = "am", newdata = datagridcf(am = 0:1), draw = FALSE) +p1 <- plot_predictions(mod, by = "am", draw = FALSE, + newdata = datagrid(am = 0:1, grid_type = "counterfactual")) +p2 <- avg_predictions(mod, by = "am", draw = FALSE, + newdata = datagrid(am = 0:1, grid_type = "counterfactual")) expect_equivalent(p1$estimate, p2$estimate) expect_equivalent(p1$conf.low, p2$conf.low) p3 <- plot_predictions(mod, by = "am", draw = FALSE) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-plot_slopes.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-plot_slopes.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-plot_slopes.R 2023-10-25 16:43:38.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-plot_slopes.R 2023-12-24 03:08:04.000000000 +0000 @@ -60,8 +60,10 @@ # Issue #725: `newdata` argument in plotting functions mod <- glm(vs ~ hp + am, mtcars, family = binomial) -p1 <- plot_slopes(mod, variables = "hp", by = "am", newdata = datagridcf(am = 0:1), draw = FALSE) -p2 <- avg_slopes(mod, variables = "hp", by = "am", newdata = datagridcf(am = 0:1), draw = FALSE) +p1 <- plot_slopes(mod, variables = "hp", by = "am", draw = FALSE, + newdata = datagrid(am = 0:1, grid_type = "counterfactual")) +p2 <- avg_slopes(mod, variables = "hp", by = "am", + newdata = datagrid(am = 0:1, grid_type = "counterfactual")) expect_equivalent(p1$estimate, p2$estimate) expect_equivalent(p1$conf.low, p2$conf.low, tolerance = 1e-6) p3 <- plot_slopes(mod, variables = "hp", by = "am", draw = FALSE) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-predict_type.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-predict_type.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-predict_type.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-predict_type.R 2024-02-05 01:34:54.000000000 +0000 @@ -10,7 +10,6 @@ expect_error(comparisons(mod, type = "junk"), pattern = "Must be element") expect_error(predictions(mod, type = "junk"), pattern = "Must be element") expect_error(slopes(mod, type = "junk"), pattern = "Must be element") -expect_error(marginal_means(mod, type = "junk"), pattern = "Must be element") diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-predictions.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-predictions.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-predictions.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-predictions.R 2023-12-24 03:08:04.000000000 +0000 @@ -46,8 +46,8 @@ y = rbinom(N, 1, prob = .9), x = rnorm(N)) mod <- glm(y ~ x, family = binomial, data = dat) -p1 <- tidy(predictions(mod)) # average prediction outside [0,1] -p2 <- tidy(predictions(mod, type = "link"), transform = insight::link_inverse(mod)) # average prediction inside [0,1] +p1 <- avg_predictions(mod) # average prediction outside [0,1] +p2 <- avg_predictions(mod, type = "link", transform = insight::link_inverse(mod)) # average prediction inside [0,1] expect_equivalent(p1$estimate, p2$estimate, tolerance = .001) expect_equivalent(p1$conf.low, p2$conf.low, tolerance = .01) expect_equivalent(p1$conf.high, p2$conf.high, tolerance = .01) @@ -84,12 +84,9 @@ ######################################### # weigted average adjusted predictions # ######################################### -pre1 <- predictions(mod, wts = mtcars$w) -pre2 <- predictions(mod) -tid1 <- tidy(pre1) -tid2 <- tidy(pre2) -expect_equivalent(pre1$estimate, pre2$estimate) -expect_true(all(tid1$estimate != tid2$estimate)) +pre1 <- avg_predictions(mod, wts = mtcars$w) +pre2 <- avg_predictions(mod) +expect_true(all(pre1$estimate != pre2$estimate)) @@ -191,7 +188,9 @@ expect_error(predictions(fit, variables = list(race = "all"), newdata = dat), pattern = "Check") -p <- predictions(fit, newdata = datagridcf(race = c("black", "hispan", "white"))) +p <- predictions(fit, newdata = datagrid( + race = c("black", "hispan", "white"), + grid_type = "counterfactual")) expect_equivalent(nrow(p), nrow(dat) * 3) dat <- transform(mtcars, am = as.logical(am)) @@ -220,7 +219,9 @@ pre <- avg_predictions(mod, variables = list(cyl = c(4, 6))) expect_inherits(pre, "predictions") expect_equivalent(nrow(pre), 2) -pre <- avg_predictions(mod, by = "cyl", newdata = datagridcf(cyl = c(4, 6))) +pre <- avg_predictions(mod, + by = "cyl", + newdata = datagrid(cyl = c(4, 6), grid_type = "counterfactual")) expect_inherits(pre, "predictions") expect_equivalent(nrow(pre), 2) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-print.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-print.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-print.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-print.R 2023-12-28 03:32:12.000000000 +0000 @@ -11,8 +11,6 @@ # expect_snapshot_print(comparisons(mod), "print-comparisons") expect_snapshot_print(comparisons(mod, by = "gear"), "print-comparisons_by") -expect_snapshot_print(marginal_means(mod, "gear"), "print-marginal_means") - # Issue #638: keep datagrid() explicit variables in print dat <- read.csv("https://vincentarelbundock.github.io/Rdatasets/csv/Stat2Data/Titanic.csv") diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-summary.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-summary.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-summary.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-summary.R 1970-01-01 00:00:00.000000000 +0000 @@ -1,68 +0,0 @@ -source("helpers.R") -using("marginaleffects") -if (!requiet("tinysnapshot")) exit_file("tinysnapshot") -using("tinysnapshot") - -requiet("poorman") - -dat <- mtcars -mod <- glm(am ~ hp, data = dat, family = binomial) -cmp <- comparisons(mod, comparison = "lnor") - -cmp <- comparisons(mod, comparison = "lnoravg") -expect_equivalent(nrow(cmp), 1) - -# these two errors are no longer relevant, since we no longer aggregate in -# tidy(), but instead run the same call through comparisons(), which does fancy -# averaging by changing comparison when possible/known. -# expect_error(summary(cmp), pattern = "collapsible") -# expect_error(tidy(cmp), pattern = "collapsible") - -# simple summary output -mod <- lm(mpg ~ hp + factor(cyl), dat) -mfx <- slopes(mod) -expect_snapshot_print(summary(mfx), "summary-marginaleffects") - - -# summary conf.level -mod <- lm(mpg ~ hp + factor(cyl), dat) -mfx <- slopes(mod) -expect_snapshot_print(summary(mfx, conf_level = .9), "summary-marginaleffects_conf_level_90") -expect_snapshot_print(summary(mfx, conf_level = .2), "summary-marginaleffects_conf_level_20") - - -# summary.hypotheses -mod <- lm(mpg ~ hp + factor(cyl), mtcars) -hyp <- hypotheses(mod, "b3 = b4") -expect_snapshot_print(summary(hyp), "summary-hypotheses") - - -# summary: marginal means -dat <- mtcars -dat$am <- as.logical(dat$am) -dat$vs <- as.logical(dat$vs) -dat$gear <- as.factor(dat$gear) -dat <- dat -mod <- lm(mpg ~ gear + am + vs, dat) -mm <- marginal_means(mod) -expect_snapshot_print(summary(mm), "summary-marginalmeans") - - -# bugs stay dead: summary manipulation (destroys attributes, unfortunately) -dat <- mtcars -mod <- glm(am ~ hp * wt, data = dat, family = binomial) -mfx <- slopes(mod) -s <- summary(mfx) |> poorman::select(term, estimate, conf.low, conf.high) -expect_inherits(s, "slopes") -expect_equal(dim(s), c(2, 4)) - - -# bugs stay dead: label transformation_post -dat <- mtcars -mod <- glm(am ~ hp, data = dat, family = binomial) -cmp <- avg_comparisons(mod, comparison = function(hi, lo) hi / lo, transform = exp) -expect_snapshot_print(cmp, "summary-comparisons_transform") - - - -rm(list = ls()) \ No newline at end of file diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-tidy-predictions.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-tidy-predictions.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-tidy-predictions.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-tidy-predictions.R 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -source("helpers.R") -using("marginaleffects") -requiet("prediction") -requiet("insight") - - -# lm: Average prediction vs. {prediction} -mod <- lm(am ~ mpg + drat + factor(cyl), data = mtcars) -pre <- predictions(mod) -tid <- tidy(pre) -expect_equal(nrow(tid), 1) -expect_equal(mean(pre$estimate), tid$estimate) -lee <- data.frame(summary(prediction::prediction(mod))) -expect_equivalent(tid$estimate, lee$Prediction) -expect_equivalent(tid$std.error, lee$SE) - -# lm: Group-Average Prediction (no validity) -pre <- predictions(mod, by = "cyl") -tid <- tidy(pre) -expect_equal(nrow(tid), 3) - -# glm response scale -# CI retrieved by `insight::get_predicted()` for units -# CI not supported yet for `tidy()` -mod <- glm(am ~ mpg + drat + factor(cyl), data = mtcars, family = binomial) -pre <- predictions(mod, type = "link") -tid <- tidy(pre) -lee <- data.frame(summary(prediction::prediction(mod, type = "link"))) -ins <- data.frame(insight::get_predicted(mod, ci = .95, predict = "link")) -expect_equivalent(tid$estimate, lee$Prediction, tolerance = 1e-5) -expect_equivalent(pre$estimate, ins$Predicted, tolerance = 1e-5) -expect_equivalent(pre$conf.low, ins$CI_low, tolerance = 1e-5) -expect_equivalent(pre$conf.high, ins$CI_high, tolerance = 1e-5) -expect_true("std.error" %in% colnames(pre)) -expect_true("conf.low" %in% colnames(pre)) - -# glm link scale: CI fully supported -mod <- glm(am ~ mpg + drat + factor(cyl), data = mtcars, family = binomial) -pre <- predictions(mod, type = "link") -tid <- tidy(pre) -lee <- data.frame(summary(prediction::prediction(mod, type = "link"))) -ins <- data.frame(insight::get_predicted(mod, predict = "link", ci = .95)) -expect_equivalent(tid$estimate, lee$Prediction, tolerance = 1e-5) -expect_equivalent(tid$std.error, lee$SE, tolerance = 1e-5) -expect_equivalent(tid$conf.low, lee$lower, tolerance = 1e-5) -expect_equivalent(tid$conf.high, lee$upper, tolerance = 1e-5) -expect_equivalent(tid$estimate, lee$Prediction, tolerance = 1e-5) -expect_equivalent(pre$estimate, ins$Predicted, tolerance = 1e-5) -expect_equivalent(pre$std.error, ins$SE, tolerance = 1e-5) -expect_equivalent(pre$conf.low, ins$CI_low, tolerance = 1e-5) -expect_equivalent(pre$conf.high, ins$CI_high, tolerance = 1e-5) - - - -rm(list = ls()) \ No newline at end of file diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-tidy.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-tidy.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-tidy.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-tidy.R 1970-01-01 00:00:00.000000000 +0000 @@ -1,112 +0,0 @@ -source("helpers.R") -using("marginaleffects") - - - -mod <- glm(vs ~ hp * mpg, data = mtcars, family = binomial) -mfx <- slopes(mod) -pred <- predictions(mod) - - -# tidy.predictions -requiet("MASS") -mod1 <- glm(vs ~ hp * mpg, data = mtcars, family = binomial) -# there used to be an interaction in this polr model, but it produced -# negative variances and NaN standard errors -mod2 <- polr(factor(gear) ~ hp + mpg, data = mtcars, Hess = TRUE) -pred1 <- predictions(mod1) -pred2 <- suppressMessages(predictions(mod2, type = "probs")) -ti1 <- tidy(pred1) -ti2 <- tidy(pred2) -expect_false(all(ti2$std.error == 0)) -expect_inherits(ti1, "data.frame") -expect_inherits(ti2, "data.frame") -expect_equivalent(nrow(ti1), 1) -expect_equivalent(nrow(ti2), 3) - -# Stata comparisons (manually collected) -mod <- lm(mpg ~ hp + wt, data = mtcars) -pred <- predictions(mod) -ti <- tidy(pred) -expect_equivalent(ti$estimate, 20.09062, tolerance = .0001) -# not supported yet -# expect_equivalent(ti$std.error, 45.84548, tolerance = .0001) -# expect_equivalent(ti$conf.low, 19.15298, tolerance = .0001) -# expect_equivalent(ti$conf.high, 21.02827, tolerance = .0001) - - - -# tidy: minimal -ti <- tidy(mfx) -expect_equivalent(nrow(ti), 2) -expect_true(ncol(ti) > 6) -ti1 <- tidy(mfx, conf.level = .90) -ti2 <- tidy(mfx, conf.level = .99) -expect_true(all(ti1$conf.low > ti2$conf.low)) -expect_true(all(ti1$conf.high < ti2$conf.high)) - - - -# glance: with modelsummary -gl <- glance(mfx) -expect_equivalent(nrow(gl), 1) -expect_true(ncol(gl) > 5) - - - -# bug: emmeans contrast rename in binomial -x <- glm(am ~ mpg + factor(cyl), data = mtcars, family = binomial) -x <- slopes(x) -x <- tidy(x) -expect_inherits(x, "data.frame") -expect_equivalent(nrow(x), 3) - - - -# tidy: with and without contrasts -tmp <- mtcars -tmp$am <- as.logical(tmp$am) - -# numeric only -x <- tidy(slopes(lm(mpg ~ hp, tmp))) -expect_true(nrow(x) == 1) -expect_true(ncol(x) > 7) - -# logical only -model <- lm(mpg ~ am, tmp) -x <- tidy(slopes(model)) -expect_true(nrow(x) == 1) -expect_true(ncol(x) > 7) - -# factor only -model <- lm(mpg ~ factor(gear), tmp) -x <- tidy(slopes(model)) -expect_true(nrow(x) == 2) -expect_true(ncol(x) > 7) - -# combinations -x <- tidy(slopes(lm(mpg ~ hp + am, tmp))) -expect_true(nrow(x) == 2) -expect_true(ncol(x) > 7) - -x <- tidy(slopes(lm(mpg ~ hp + factor(gear), tmp))) -expect_true(nrow(x) == 3) -expect_true(ncol(x) > 7) - -x <- tidy(slopes(lm(mpg ~ am + factor(gear), tmp))) -expect_true(nrow(x) == 3) -expect_true(ncol(x) > 7) - -x <- tidy(slopes(lm(mpg ~ hp + am + factor(gear), tmp))) -expect_true(nrow(x) == 4) -expect_true(ncol(x) > 7) - - -# deprecated argument -mod <- lm(mpg ~ hp, mtcars) -cmp <- comparisons(mod) -expect_error(tidy(cmp, transform_avg = exp), pattern = "deprecated") - - - -rm(list = ls()) \ No newline at end of file diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-tinytest.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-tinytest.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-tinytest.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-tinytest.R 2024-02-05 01:34:54.000000000 +0000 @@ -4,10 +4,8 @@ dat <- transform(mtcars, gear = factor(gear)) mod <- lm(mpg ~ hp + gear, data = dat) pre <- predictions(mod) -mm <- marginal_means(mod) expect_slopes(mod) -expect_marginal_means(mm) expect_predictions(pre) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-transform_pre.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-transform_pre.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-transform_pre.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-transform_pre.R 2024-01-24 02:04:51.000000000 +0000 @@ -9,14 +9,13 @@ # manual average contrast mod <- glm(am ~ vs + mpg, data = mtcars, family = binomial) -cmp1 <- comparisons( +cmp1 <- avg_comparisons( mod, variables = list(vs = 0:1), comparison = function(hi, lo) mean(hi - lo)) -cmp2 <- comparisons( +cmp2 <- avg_comparisons( mod, variables = list(vs = 0:1)) -cmp2 <- tidy(cmp2) expect_equivalent(cmp1$estimate, cmp2$estimate) expect_equivalent(cmp1$std.error, cmp2$std.error, tolerance = tol) @@ -46,12 +45,12 @@ acs12$disability <- as.numeric(acs12$disability == "yes") mod <- glm(disability ~ gender, data = acs12, family = binomial) -ard_r <- comparisons(mod, comparison = function(hi, lo) lo - hi) -arr_r <- comparisons(mod, comparison = function(hi, lo) mean(lo) / mean(hi)) +ard_r <- avg_comparisons(mod, comparison = function(hi, lo) lo - hi) +arr_r <- avg_comparisons(mod, comparison = function(hi, lo) mean(lo) / mean(hi)) cols <- c("estimate", "std.error", "conf.low", "conf.high") -ard_r <- unlist(tidy(ard_r)[, cols]) -arr_r <- unlist(tidy(arr_r)[, cols]) +ard_r <- unlist(ard_r[, cols]) +arr_r <- unlist(arr_r[, cols]) expect_equivalent(arr_r[1:2], arr_s[1:2], tolerance = tol) expect_equivalent(ard_r[1:2], ard_s[1:2], tolerance = tol) @@ -67,18 +66,13 @@ acs12$disability <- as.numeric(acs12$disability == "yes") mod <- glm(disability ~ gender + race + married + age, data = acs12, family = binomial) -ard_r <- comparisons(mod, variables = "gender", comparison = function(hi, lo) lo - hi) -arr_r <- comparisons(mod, variables = "gender", comparison = function(hi, lo) mean(lo) / mean(hi)) +ard_r <- avg_comparisons(mod, variables = "gender", comparison = function(hi, lo) lo - hi) +arr_r <- avg_comparisons(mod, variables = "gender", comparison = function(hi, lo) mean(lo) / mean(hi)) cols <- c("estimate", "std.error", "conf.low", "conf.high") -ard_r <- unlist(tidy(ard_r)[, cols]) -arr_r <- unlist(tidy(arr_r)[, cols]) +ard_r <- unlist(ard_r[, cols]) +arr_r <- unlist(arr_r[, cols]) -# # Stata not sure how CIs are built in Stata -# critical_t <- qt(0.025, df = 1999) -# arr_r <- tidy(arr_r) -# arr_r$estimate - abs(critical_t) * arr_r$std.error -# arr_r$estimate + abs(critical_t) * arr_r$std.error expect_equivalent(arr_r[1:2], arr_s[1:2], tolerance = tol) expect_equivalent(arr_r[1:2], arr_s[1:2], tolerance = tol) @@ -95,36 +89,30 @@ mod <- glm(health ~ insurance + gender + ethnicity + married + age, data = dat, family = binomial) -# # Stata CI: exp(r(lnARR)-invnorm(0.975)*r(lnARR_se)) -# lnarr_r <- comparisons( -# mod, variables = "insurance", -# comparison = function(hi, lo) log(mean(hi) / mean(lo))) -# lnarr_r <- tidy(lnarr_r) -# exp(lnarr_r$estimate - qnorm(0.975) * lnarr_r$std.error) -# exp(lnarr_r$estimate - qnorm(0.025) * lnarr_r$std.error) -ard_r <- comparisons( +ard_r <- avg_comparisons( mod, variables = "insurance", comparison = function(hi, lo) hi - lo) -arr_r <- comparisons( +arr_r <- avg_comparisons( mod, variables = "insurance", comparison = function(hi, lo) mean(hi) / mean(lo)) cols <- c("estimate", "std.error", "conf.low", "conf.high") -ard_r <- unlist(tidy(ard_r)[, cols]) -arr_r <- unlist(tidy(arr_r)[, cols]) +ard_r <- unlist(ard_r[, cols]) +arr_r <- unlist(arr_r[, cols]) expect_equivalent(ard_r[1:2], ard_s[1:2], tolerance = tol) expect_equivalent(arr_r[1:2], arr_s[1:2], tolerance = tol) # Using manual back-transformation cols <- c("estimate", "conf.low", "conf.high") -arr_r <- comparisons( +arr_r <- avg_comparisons( mod, variables = "insurance", - comparison = function(hi, lo) log(mean(hi) / mean(lo))) -arr_r <- unlist(tidy(arr_r, transform = exp)[, cols]) + comparison = function(hi, lo) log(mean(hi) / mean(lo)), + transform = exp) +arr_r <- unlist(arr_r[, cols]) expect_equivalent(arr_r, arr_s[c(1, 3, 4)], tolerance = tol) @@ -134,7 +122,7 @@ dat <- read.csv("https://vincentarelbundock.github.io/Rdatasets/csv/carData/TitanicSurvival.csv") dat$survived <- as.factor(dat$survived) mod <- glm(survived ~ passengerClass + sex, data = dat, family = binomial) -cmp <- tidy(comparisons(mod, comparison = function(hi, lo) mean(hi - lo))) +cmp <- avg_comparisons(mod, comparison = function(hi, lo) mean(hi - lo)) # bug created duplicate estimates expect_equivalent(length(unique(cmp$estimate)), nrow(cmp)) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-variables.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-variables.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-variables.R 2023-11-06 17:29:13.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-variables.R 2024-01-24 02:04:41.000000000 +0000 @@ -13,18 +13,17 @@ cmp2 <- comparisons(mod, variables = list("hp" = 1), newdata = head(tmp, 1)) expect_equivalent(cmp1, cmp2) -cmp1 <- comparisons( +cmp1 <- avg_comparisons( mod, - variables = list(gear = "sequential", hp = 10, cyl = "pairwise")) -cmp1 <- tidy(cmp1) |> dplyr::arrange(term, contrast) -cmp2 <- comparisons( + variables = list(gear = "sequential", hp = 10, cyl = "pairwise")) |> + dplyr::arrange(term, contrast) +cmp2 <- avg_comparisons( mod, - variables = list(gear = "sequential", hp = 1, cyl = "pairwise")) -cmp2 <- tidy(cmp2) |> dplyr::arrange(term, contrast) + variables = list(gear = "sequential", hp = 1, cyl = "pairwise")) |> + dplyr::arrange(term, contrast) # known <- c("4 - 3", "5 - 4", "+10", "6 - 4", "8 - 4", "8 - 6") # aggregate refactor gave us new labels -known <- c("mean(+10)", "mean(4) - mean(3)", "mean(5) - mean(4)", "mean(6) - mean(4)", -"mean(8) - mean(4)", "mean(8) - mean(6)") +known <- c("+10", "4 - 3", "5 - 4", "6 - 4", "8 - 4", "8 - 6") expect_true(all(known %in% cmp1$contrast)) expect_equivalent(cmp1$estimate[6], cmp2$estimate[6] * 10) @@ -43,12 +42,6 @@ cmp3 <- comparisons(mod, variables = list(vs = 1)) expect_inherits(cmp3, "comparisons") - -# Issue #582: sanitize_variables should reject reponse as -mod <- lm(mpg ~ hp + qsec, data = mtcars) -expect_error(slopes(mod, variables = "mpg"), pattern = "predictor variables") - - # no need to include categorical focal variable when there is only one of them mod <- lm(mpg ~ hp + factor(am) + wt, mtcars) nd <- data.frame(hp = 120, am = 1) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-vcov.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-vcov.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-vcov.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-vcov.R 2024-02-05 01:34:54.000000000 +0000 @@ -82,33 +82,6 @@ expect_true(all(pre5$std.error != pre6$std.error)) - -# marginalmeans strings (no validity) -dat <- dat -dat$cyl <- factor(dat$cyl) -mod <- lm(mpg ~ cyl, data = dat) - -# aliases -mm1 <- marginal_means(mod, vcov = "HC2") -mm2 <- marginal_means(mod, vcov = "stata") -mm3 <- marginal_means(mod, vcov = "HC3") -mm4 <- marginal_means(mod, vcov = "robust") -expect_equivalent(mm1$std.error, mm2$std.error) -expect_equivalent(mm3$std.error, mm4$std.error) - -# different (no validity) -mm5 <- marginal_means(mod, vcov = ~ gear) -mm6 <- marginal_means(mod, vcov = "HAC") -expect_true(all(mm1$std.error != mm3$std.error)) -expect_true(all(mm1$std.error != mm4$std.error)) -expect_true(all(mm1$std.error != mm5$std.error)) -expect_true(all(mm1$std.error != mm6$std.error)) -expect_true(all(mm3$std.error != mm5$std.error)) -expect_true(all(mm3$std.error != mm6$std.error)) -expect_true(all(mm5$std.error != mm6$std.error)) - - - # Issue #554 mod <- lm(mpg ~ cyl, data = dat) diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-vignettes.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-vignettes.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-vignettes.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-vignettes.R 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -source("helpers.R") -using("marginaleffects") - -# Stata comparisons produces identical results -mod <- lm(mpg ~ cyl + hp + wt, data = mtcars) -mfx <- slopes(mod) -tid <- tidy(mfx) -expect_equivalent(tid$estimate, c(-0.941616811900303, -0.0180381021785969, -3.16697311076308)) -expect_equivalent(tid$std.error, c(0.550916180593437, 0.0118762627948526, 0.740576187204658), - tolerance = 1e-3) - -mod <- lm(mpg ~ as.factor(cyl) * hp + wt, data = mtcars) -mfx <- slopes( - mod, - by = "cyl", - variables = "hp", - newdata = datagrid(cyl = c(4, 6, 8), - grid_type = "counterfactual")) -tid <- tidy(mfx) -expect_equivalent(tid$estimate, c(-0.0994659820285903, -0.0213767880896665, -0.0134410254648554)) -expect_equivalent(tid$std.error, c(0.0348665154637227, 0.0388220444007849, 0.0125138337466129), - tolerance = 1e-4) - - -rm(list = ls()) \ No newline at end of file diff -Nru r-cran-marginaleffects-0.17.0/inst/tinytest/test-weights.R r-cran-marginaleffects-0.18.0/inst/tinytest/test-weights.R --- r-cran-marginaleffects-0.17.0/inst/tinytest/test-weights.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/inst/tinytest/test-weights.R 2023-12-24 03:08:04.000000000 +0000 @@ -11,25 +11,22 @@ design = svydesign(ids = ~1, weights = ~weights, data = dat), family = binomial)) -p1 <- predictions(mod, newdata = dat) -p2 <- predictions(mod, wts = "weights", newdata = dat) -p3 <- predictions(mod, wts = "w", newdata = dat) -p4 <- predictions(mod, wts = dat$weights) -expect_false(tidy(p1)$estimate == tidy(p2)$estimate) -expect_false(tidy(p1)$std.error == tidy(p2)$std.error) -expect_equivalent(tidy(p2), tidy(p3)) -expect_equivalent(tidy(p2), tidy(p4)) +p1 <- avg_predictions(mod, newdata = dat) +p2 <- avg_predictions(mod, wts = "weights", newdata = dat) +p3 <- avg_predictions(mod, wts = "w", newdata = dat) +p4 <- avg_predictions(mod, wts = dat$weights) +expect_false(p1$estimate == p2$estimate) +expect_false(p1$std.error == p2$std.error) +expect_equivalent(p2, p3) +expect_equivalent(p2, p4) # by supports weights -p1 <- predictions(mod, wts = "weights", newdata = dat) -p1 <- tidy(p1) +p1 <- avg_predictions(mod, wts = "weights", newdata = dat) expect_inherits(p1, "data.frame") -m1 <- slopes(mod, wts = "weights", newdata = dat, by = "cyl") -m1 <- tidy(m1) +m1 <- avg_slopes(mod, wts = "weights", newdata = dat, by = "cyl") expect_inherits(m1, "data.frame") -c1 <- comparisons(mod, wts = "weights", newdata = dat, by = "cyl") -c1 <- tidy(c1) +c1 <- avg_comparisons(mod, wts = "weights", newdata = dat, by = "cyl") expect_inherits(c1, "data.frame") @@ -41,7 +38,6 @@ data = k, weights = w) cmp1 <- comparisons(fit, variables = "treat", wts = "w") cmp2 <- comparisons(fit, variables = "treat", wts = "w", comparison = "differenceavg") -expect_equivalent(tidy(cmp1)$estimate, weighted.mean(cmp1$estimate, k$w)) expect_equivalent(cmp2$estimate, weighted.mean(cmp1$estimate, k$w)) diff -Nru r-cran-marginaleffects-0.17.0/man/comparisons.Rd r-cran-marginaleffects-0.18.0/man/comparisons.Rd --- r-cran-marginaleffects-0.17.0/man/comparisons.Rd 2023-12-08 15:34:54.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/man/comparisons.Rd 2024-01-24 03:51:41.000000000 +0000 @@ -229,7 +229,7 @@ \code{marginaleffects} website). Available arguments can vary from model to model, depending on the range of supported arguments by each modeling package. See the "Model-Specific Arguments" section of the -\code{?marginaleffects} documentation for a non-exhaustive list of available +\code{?slopes} documentation for a non-exhaustive list of available arguments.} } \value{ @@ -418,11 +418,12 @@ Some of the most common \code{type} values are: -response, link, E, Ep, average, class, conditional, count, cum.prob, cumprob, density, disp, ev, expected, expvalue, fitted, invlink(link), latent, linear.predictor, linpred, location, lp, mean, numeric, p, ppd, pr, precision, prediction, prob, probability, probs, quantile, risk, scale, survival, unconditional, utility, variance, xb, zero, zlink, zprob +response, link, E, Ep, average, class, conditional, count, cum.prob, cumprob, density, detection, disp, ev, expected, expvalue, fitted, invlink(link), latent, latent_N, linear.predictor, linpred, location, lp, mean, numeric, p, ppd, pr, precision, prediction, prob, probability, probs, quantile, risk, scale, survival, unconditional, utility, variance, xb, zero, zlink, zprob } \examples{ -\dontrun{ +\dontshow{if (interactive() || isTRUE(Sys.getenv("R_DOC_BUILD") == "true")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{\}) # examplesIf} library(marginaleffects) # Linear model @@ -521,7 +522,9 @@ tmp <- mtcars \%>\% group_by(cyl) \%>\% mutate(hp_sd = sd(hp)) -avg_comparisons(mod, variables = list(hp = tmp$hp_sd), by = "cyl") +avg_comparisons(mod, + variables = list(hp = function(x) data.frame(x, x + tmp$hp_sd)), + by = "cyl") # `by` argument mod <- lm(mpg ~ hp * am * vs, data = mtcars) @@ -536,7 +539,6 @@ group = c("3", "4", "5"), by = c("3,4", "3,4", "5")) comparisons(mod, type = "probs", by = by) -} } \references{ diff -Nru r-cran-marginaleffects-0.17.0/man/datagrid.Rd r-cran-marginaleffects-0.18.0/man/datagrid.Rd --- r-cran-marginaleffects-0.17.0/man/datagrid.Rd 2023-11-24 16:54:37.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/man/datagrid.Rd 2023-12-28 02:59:45.000000000 +0000 @@ -2,7 +2,6 @@ % Please edit documentation in R/datagrid.R \name{datagrid} \alias{datagrid} -\alias{datagridcf} \title{Data grids} \usage{ datagrid( @@ -10,16 +9,15 @@ model = NULL, newdata = NULL, by = NULL, - FUN_character = get_mode, - FUN_factor = get_mode, - FUN_logical = get_mode, - FUN_numeric = function(x) mean(x, na.rm = TRUE), - FUN_integer = function(x) round(mean(x, na.rm = TRUE)), - FUN_other = function(x) mean(x, na.rm = TRUE), - grid_type = "typical" + grid_type = "mean_or_mode", + FUN_character = NULL, + FUN_factor = NULL, + FUN_logical = NULL, + FUN_numeric = NULL, + FUN_integer = NULL, + FUN_binary = NULL, + FUN_other = NULL ) - -datagridcf(..., model = NULL, newdata = NULL) } \arguments{ \item{...}{named arguments with vectors of values or functions for user-specified variables. @@ -35,6 +33,13 @@ \item{by}{character vector with grouping variables within which \verb{FUN_*} functions are applied to create "sub-grids" with unspecified variables.} +\item{grid_type}{character. Determines the functions to apply to each variable. The defaults can be overridden by defining individual variables explicitly in \code{...}, or by supplying a function to one of the \verb{FUN_*} arguments. +\itemize{ +\item "mean_or_mode": Character, factor, logical, and binary variables are set to their modes. Numeric, integer, and other variables are set to their means. +\item "balanced": Each unique level of character, factor, logical, and binary variables are preserved. Numeric, integer, and other variables are set to their means. Warning: When there are many variables and many levels per variable, a balanced grid can be very large. In those cases, it is better to use \code{grid_type="mean_or_mode"} and to specify the unique levels of a subset of named variables explicitly. +\item "counterfactual": the entire dataset is duplicated for each combination of the variable values specified in \code{...}. Variables not explicitly supplied to \code{datagrid()} are set to their observed values in the original dataset. +}} + \item{FUN_character}{the function to be applied to character variables.} \item{FUN_factor}{the function to be applied to factor variables.} @@ -45,13 +50,9 @@ \item{FUN_integer}{the function to be applied to integer variables.} -\item{FUN_other}{the function to be applied to other variable types.} +\item{FUN_binary}{the function to be applied to binary variables.} -\item{grid_type}{character -\itemize{ -\item "typical": variables whose values are not explicitly specified by the user in \code{...} are set to their mean or mode, or to the output of the functions supplied to \code{FUN_type} arguments. -\item "counterfactual": the entire dataset is duplicated for each combination of the variable values specified in \code{...}. Variables not explicitly supplied to \code{datagrid()} are set to their observed values in the original dataset. -}} +\item{FUN_other}{the function to be applied to other variable types.} } \value{ A \code{data.frame} in which each row corresponds to one combination of the named @@ -60,24 +61,22 @@ } \description{ Generate a data grid of user-specified values for use in the \code{newdata} argument of the \code{predictions()}, \code{comparisons()}, and \code{slopes()} functions. This is useful to define where in the predictor space we want to evaluate the quantities of interest. Ex: the predicted outcome or slope for a 37 year old college graduate. -\itemize{ -\item \code{datagrid()} generates data frames with combinations of "typical" or user-supplied predictor values. -\item \code{datagridcf()} generates "counter-factual" data frames, by replicating the entire dataset once for every combination of predictor values supplied by the user. -} } \details{ If \code{datagrid} is used in a \code{predictions()}, \code{comparisons()}, or \code{slopes()} call as the \code{newdata} argument, the model is automatically inserted in the \code{model} argument of \code{datagrid()} -call, and users do not need to specify either the \code{model} or \code{newdata} arguments. +call, and users do not need to specify either the \code{model} or \code{newdata} arguments. The same behavior will occur when the value supplied to \verb{newdata=} is a function call which starts with "datagrid". This is intended to allow users to create convenience shortcuts like: + +\preformatted{ +library(marginaleffects) +mod <- lm(mpg ~ am + vs + factor(cyl) + hp, mtcars) +datagrid_bal <- function(...) datagrid(..., grid_type = "balanced") +predictions(model, newdata = datagrid_bal(cyl = 4)) +} If users supply a model, the data used to fit that model is retrieved using the \code{insight::get_data} function. } -\section{Functions}{ -\itemize{ -\item \code{datagridcf()}: Counterfactual data grid - -}} \examples{ # The output only has 2 rows, and all the variables except `hp` are at their # mean or mode. diff -Nru r-cran-marginaleffects-0.17.0/man/datagridcf.Rd r-cran-marginaleffects-0.18.0/man/datagridcf.Rd --- r-cran-marginaleffects-0.17.0/man/datagridcf.Rd 1970-01-01 00:00:00.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/man/datagridcf.Rd 2024-02-05 01:34:54.000000000 +0000 @@ -0,0 +1,12 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/deprecated.R +\name{datagridcf} +\alias{datagridcf} +\title{Deprecated function} +\usage{ +datagridcf(...) +} +\description{ +Deprecated function +} +\keyword{internal} diff -Nru r-cran-marginaleffects-0.17.0/man/deltamethod.Rd r-cran-marginaleffects-0.18.0/man/deltamethod.Rd --- r-cran-marginaleffects-0.17.0/man/deltamethod.Rd 2023-11-24 16:54:37.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/man/deltamethod.Rd 2024-02-05 01:34:54.000000000 +0000 @@ -1,24 +1,12 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/hypotheses.R +% Please edit documentation in R/deprecated.R \name{deltamethod} \alias{deltamethod} -\title{\code{deltamethod()} is an alias to \code{hypotheses()}} +\title{Deprecated function} \usage{ -deltamethod( - model, - hypothesis = NULL, - vcov = NULL, - conf_level = 0.95, - df = Inf, - equivalence = NULL, - joint = FALSE, - joint_test = "f", - FUN = NULL, - numderiv = "fdforward", - ... -) +deltamethod(...) } \description{ -This alias is kept for backward compatibility. +Deprecated function } \keyword{internal} diff -Nru r-cran-marginaleffects-0.17.0/man/expect_marginal_means.Rd r-cran-marginaleffects-0.18.0/man/expect_marginal_means.Rd --- r-cran-marginaleffects-0.17.0/man/expect_marginal_means.Rd 2023-11-24 16:54:37.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/man/expect_marginal_means.Rd 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/tinytest.R -\name{expect_marginal_means} -\alias{expect_marginal_means} -\title{\code{tinytest} helper} -\usage{ -expect_marginal_means(object, se = TRUE, n_row = NULL) -} -\description{ -\code{tinytest} helper -} -\keyword{internal} diff -Nru r-cran-marginaleffects-0.17.0/man/get_averages.Rd r-cran-marginaleffects-0.18.0/man/get_averages.Rd --- r-cran-marginaleffects-0.17.0/man/get_averages.Rd 2023-11-24 16:54:37.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/man/get_averages.Rd 2024-01-24 03:02:07.000000000 +0000 @@ -45,10 +45,10 @@ obtain the Average Marginal Effect and its associated interval. } \examples{ -\dontrun{ +\dontshow{if (interactive() || isTRUE(Sys.getenv("R_DOC_BUILD") == "true")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{\}) # examplesIf} mod <- lm(mpg ~ factor(gear), data = mtcars) -contr <- comparisons(mod, variables = list(gear = "sequential")) -tidy(contr) -} +avg_comparisons(mod, variables = list(gear = "sequential")) + } \keyword{internal} diff -Nru r-cran-marginaleffects-0.17.0/man/get_coef.Rd r-cran-marginaleffects-0.18.0/man/get_coef.Rd --- r-cran-marginaleffects-0.17.0/man/get_coef.Rd 2023-11-24 16:54:37.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/man/get_coef.Rd 2023-12-28 03:07:26.000000000 +0000 @@ -86,7 +86,7 @@ \code{marginaleffects} website). Available arguments can vary from model to model, depending on the range of supported arguments by each modeling package. See the "Model-Specific Arguments" section of the -\code{?marginaleffects} documentation for a non-exhaustive list of available +\code{?slopes} documentation for a non-exhaustive list of available arguments.} } \value{ diff -Nru r-cran-marginaleffects-0.17.0/man/get_group_names.Rd r-cran-marginaleffects-0.18.0/man/get_group_names.Rd --- r-cran-marginaleffects-0.17.0/man/get_group_names.Rd 2023-11-24 16:54:37.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/man/get_group_names.Rd 2023-12-28 03:07:26.000000000 +0000 @@ -47,7 +47,7 @@ \code{marginaleffects} website). Available arguments can vary from model to model, depending on the range of supported arguments by each modeling package. See the "Model-Specific Arguments" section of the -\code{?marginaleffects} documentation for a non-exhaustive list of available +\code{?slopes} documentation for a non-exhaustive list of available arguments.} \item{type}{string indicates the type (scale) of the predictions used to diff -Nru r-cran-marginaleffects-0.17.0/man/get_predict.Rd r-cran-marginaleffects-0.18.0/man/get_predict.Rd --- r-cran-marginaleffects-0.17.0/man/get_predict.Rd 2023-11-24 16:54:37.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/man/get_predict.Rd 2023-12-28 03:07:26.000000000 +0000 @@ -171,7 +171,7 @@ \code{marginaleffects} website). Available arguments can vary from model to model, depending on the range of supported arguments by each modeling package. See the "Model-Specific Arguments" section of the -\code{?marginaleffects} documentation for a non-exhaustive list of available +\code{?slopes} documentation for a non-exhaustive list of available arguments.} } \value{ diff -Nru r-cran-marginaleffects-0.17.0/man/get_vcov.Rd r-cran-marginaleffects-0.18.0/man/get_vcov.Rd --- r-cran-marginaleffects-0.17.0/man/get_vcov.Rd 2023-11-24 16:54:37.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/man/get_vcov.Rd 2023-12-28 03:07:26.000000000 +0000 @@ -67,7 +67,7 @@ \code{marginaleffects} website). Available arguments can vary from model to model, depending on the range of supported arguments by each modeling package. See the "Model-Specific Arguments" section of the -\code{?marginaleffects} documentation for a non-exhaustive list of available +\code{?slopes} documentation for a non-exhaustive list of available arguments.} \item{vcov}{Type of uncertainty estimates to report (e.g., for robust standard errors). Acceptable values: diff -Nru r-cran-marginaleffects-0.17.0/man/hypotheses.Rd r-cran-marginaleffects-0.18.0/man/hypotheses.Rd --- r-cran-marginaleffects-0.17.0/man/hypotheses.Rd 2023-12-08 15:34:54.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/man/hypotheses.Rd 2024-02-02 23:46:58.000000000 +0000 @@ -19,7 +19,7 @@ ) } \arguments{ -\item{model}{Model object or object generated by the \code{comparisons()}, \code{slopes()}, \code{predictions()}, or \code{marginal_means()} functions.} +\item{model}{Model object or object generated by the \code{comparisons()}, \code{slopes()}, or \code{predictions()} functions.} \item{hypothesis}{specify a hypothesis test or custom contrast using a numeric value, vector, or matrix, a string, or a string formula. \itemize{ @@ -99,7 +99,7 @@ \code{marginaleffects} website). Available arguments can vary from model to model, depending on the range of supported arguments by each modeling package. See the "Model-Specific Arguments" section of the -\code{?marginaleffects} documentation for a non-exhaustive list of available +\code{?slopes} documentation for a non-exhaustive list of available arguments.} } \description{ diff -Nru r-cran-marginaleffects-0.17.0/man/marginal_means.Rd r-cran-marginaleffects-0.18.0/man/marginal_means.Rd --- r-cran-marginaleffects-0.17.0/man/marginal_means.Rd 2023-12-08 15:34:54.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/man/marginal_means.Rd 2024-02-05 01:34:54.000000000 +0000 @@ -1,8 +1,8 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/marginal_means.R +% Please edit documentation in R/deprecated.R \name{marginal_means} \alias{marginal_means} -\title{Marginal Means} +\title{Deprecated function} \usage{ marginal_means( model, @@ -23,331 +23,7 @@ ... ) } -\arguments{ -\item{model}{Model object} - -\item{variables}{Focal variables -\itemize{ -\item Character vector of variable names: compute marginal means for each category of the listed variables. -\item \code{NULL}: calculate marginal means for all logical, character, or factor variables in the dataset used to fit \code{model}. Hint: Set \code{cross=TRUE} to compute marginal means for combinations of focal variables. -}} - -\item{newdata}{Grid of predictor values over which we marginalize. -\itemize{ -\item Warning: Please avoid modifying your dataset between fitting the model and calling a \code{marginaleffects} function. This can sometimes lead to unexpected results. -\item \code{NULL} create a grid with all combinations of all categorical predictors in the model. Warning: can be expensive. -\item Character vector: subset of categorical variables to use when building the balanced grid of predictors. Other variables are held to their mean or mode. -\item Data frame: A data frame which includes all the predictors in the original model. The full dataset is replicated once for every combination of the focal variables in the \code{variables} argument, using the \code{datagridcf()} function. -}} - -\item{vcov}{Type of uncertainty estimates to report (e.g., for robust standard errors). Acceptable values: -\itemize{ -\item FALSE: Do not compute standard errors. This can speed up computation considerably. -\item TRUE: Unit-level standard errors using the default \code{vcov(model)} variance-covariance matrix. -\item String which indicates the kind of uncertainty estimates to return. -\itemize{ -\item Heteroskedasticity-consistent: \code{"HC"}, \code{"HC0"}, \code{"HC1"}, \code{"HC2"}, \code{"HC3"}, \code{"HC4"}, \code{"HC4m"}, \code{"HC5"}. See \code{?sandwich::vcovHC} -\item Heteroskedasticity and autocorrelation consistent: \code{"HAC"} -\item Mixed-Models degrees of freedom: "satterthwaite", "kenward-roger" -\item Other: \code{"NeweyWest"}, \code{"KernHAC"}, \code{"OPG"}. See the \code{sandwich} package documentation. -} -\item One-sided formula which indicates the name of cluster variables (e.g., \code{~unit_id}). This formula is passed to the \code{cluster} argument of the \code{sandwich::vcovCL} function. -\item Square covariance matrix -\item Function which returns a covariance matrix (e.g., \code{stats::vcov(model)}) -}} - -\item{conf_level}{numeric value between 0 and 1. Confidence level to use to build a confidence interval.} - -\item{type}{string indicates the type (scale) of the predictions used to -compute marginal effects or contrasts. This can differ based on the model -type, but will typically be a string such as: "response", "link", "probs", -or "zero". When an unsupported string is entered, the model-specific list of -acceptable values is returned in an error message. When \code{type} is \code{NULL}, the -first entry in the error message is used by default.} - -\item{transform}{A function applied to unit-level adjusted predictions and confidence intervals just before the function returns results. For bayesian models, this function is applied to individual draws from the posterior distribution, before computing summaries.} - -\item{cross}{TRUE or FALSE -\itemize{ -\item \code{FALSE} (default): Marginal means are computed for each predictor individually. -\item \code{TRUE}: Marginal means are computed for each combination of predictors specified in the \code{variables} argument. -}} - -\item{hypothesis}{specify a hypothesis test or custom contrast using a numeric value, vector, or matrix, a string, or a string formula. -\itemize{ -\item Numeric: -\itemize{ -\item Single value: the null hypothesis used in the computation of Z and p (before applying \code{transform}). -\item Vector: Weights to compute a linear combination of (custom contrast between) estimates. Length equal to the number of rows generated by the same function call, but without the \code{hypothesis} argument. -\item Matrix: Each column is a vector of weights, as describe above, used to compute a distinct linear combination of (contrast between) estimates. The column names of the matrix are used as labels in the output. -} -\item String formula to specify linear or non-linear hypothesis tests. If the \code{term} column uniquely identifies rows, terms can be used in the formula. Otherwise, use \code{b1}, \code{b2}, etc. to identify the position of each parameter. The \verb{b*} wildcard can be used to test hypotheses on all estimates. Examples: -\itemize{ -\item \code{hp = drat} -\item \code{hp + drat = 12} -\item \code{b1 + b2 + b3 = 0} -\item \verb{b* / b1 = 1} -} -\item String: -\itemize{ -\item "pairwise": pairwise differences between estimates in each row. -\item "reference": differences between the estimates in each row and the estimate in the first row. -\item "sequential": difference between an estimate and the estimate in the next row. -\item "revpairwise", "revreference", "revsequential": inverse of the corresponding hypotheses, as described above. -} -\item See the Examples section below and the vignette: https://marginaleffects.com/vignettes/hypothesis.html -}} - -\item{equivalence}{Numeric vector of length 2: bounds used for the two-one-sided test (TOST) of equivalence, and for the non-inferiority and non-superiority tests. See Details section below.} - -\item{p_adjust}{Adjust p-values for multiple comparisons: "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", or "fdr". See \link[stats:p.adjust]{stats::p.adjust}} - -\item{df}{Degrees of freedom used to compute p values and confidence intervals. A single numeric value between 1 and \code{Inf}. When \code{df} is \code{Inf}, the normal distribution is used. When \code{df} is finite, the \code{t} distribution is used. See \link[insight:get_df]{insight::get_df} for a convenient function to extract degrees of freedom. Ex: \code{slopes(model, df = insight::get_df(model))}} - -\item{wts}{character value. Weights to use in the averaging. -\itemize{ -\item "equal": each combination of variables in \code{newdata} gets equal weight. -\item "cells": each combination of values for the variables in the \code{newdata} gets a weight proportional to its frequency in the original data. -\item "proportional": each combination of values for the variables in \code{newdata} -- except for those in the \code{variables} argument -- gets a weight proportional to its frequency in the original data. -}} - -\item{by}{Collapse marginal means into categories. Data frame with a \code{by} column of group labels, and merging columns shared by \code{newdata} or the data frame produced by calling the same function without the \code{by} argument.} - -\item{numderiv}{string or list of strings indicating the method to use to for the numeric differentiation used in to compute delta method standard errors. -\itemize{ -\item "fdforward": finite difference method with forward differences -\item "fdcenter": finite difference method with central differences (default) -\item "richardson": Richardson extrapolation method -\item Extra arguments can be specified by passing a list to the \code{numDeriv} argument, with the name of the method first and named arguments following, ex: \code{numderiv=list("fdcenter", eps = 1e-5)}. When an unknown argument is used, \code{marginaleffects} prints the list of valid arguments for each method. -}} - -\item{...}{Additional arguments are passed to the \code{predict()} method -supplied by the modeling package.These arguments are particularly useful -for mixed-effects or bayesian models (see the online vignettes on the -\code{marginaleffects} website). Available arguments can vary from model to -model, depending on the range of supported arguments by each modeling -package. See the "Model-Specific Arguments" section of the -\code{?marginaleffects} documentation for a non-exhaustive list of available -arguments.} -} -\value{ -Data frame of marginal means with one row per variable-value combination. -} \description{ -Marginal means are adjusted predictions, averaged across a grid of categorical predictors, -holding other numeric predictors at their means. To learn more, read the marginal means vignette, visit the -package website, or scroll down this page for a full list of vignettes: -\itemize{ -\item \url{https://marginaleffects.com/vignettes/marginalmeans.html} -\item \url{https://marginaleffects.com/} -} -} -\details{ -This function begins by calling the \code{predictions} function to obtain a -grid of predictors, and adjusted predictions for each cell. The grid -includes all combinations of the categorical variables listed in the -\code{variables} and \code{newdata} arguments, or all combinations of the -categorical variables used to fit the model if \code{newdata} is \code{NULL}. -In the prediction grid, numeric variables are held at their means. - -After constructing the grid and filling the grid with adjusted predictions, -\code{marginal_means} computes marginal means for the variables listed in the -\code{variables} argument, by average across all categories in the grid. - -\code{marginal_means} can only compute standard errors for linear models, or for -predictions on the link scale, that is, with the \code{type} argument set to -"link". - -The \code{marginaleffects} website compares the output of this function to the -popular \code{emmeans} package, which provides similar but more advanced -functionality: https://marginaleffects.com/ -} -\section{Standard errors using the delta method}{ - - -Standard errors for all quantities estimated by \code{marginaleffects} can be obtained via the delta method. This requires differentiating a function with respect to the coefficients in the model using a finite difference approach. In some models, the delta method standard errors can be sensitive to various aspects of the numeric differentiation strategy, including the step size. By default, the step size is set to \code{1e-8}, or to \code{1e-4} times the smallest absolute model coefficient, whichever is largest. - -\code{marginaleffects} can delegate numeric differentiation to the \code{numDeriv} package, which allows more flexibility. To do this, users can pass arguments to the \code{numDeriv::jacobian} function through a global option. For example: -\itemize{ -\item \code{options(marginaleffects_numDeriv = list(method = "simple", method.args = list(eps = 1e-6)))} -\item \code{options(marginaleffects_numDeriv = list(method = "Richardson", method.args = list(eps = 1e-5)))} -\item \code{options(marginaleffects_numDeriv = NULL)} -} - -See the "Standard Errors and Confidence Intervals" vignette on the \code{marginaleffects} website for more details on the computation of standard errors: - -https://marginaleffects.com/vignettes/uncertainty.html - -Note that the \code{inferences()} function can be used to compute uncertainty estimates using a bootstrap or simulation-based inference. See the vignette: - -https://marginaleffects.com/vignettes/bootstrap.html -} - -\section{Model-Specific Arguments}{ - - -Some model types allow model-specific arguments to modify the nature of -marginal effects, predictions, marginal means, and contrasts. Please report -other package-specific \code{predict()} arguments on Github so we can add them to -the table below. - -https://github.com/vincentarelbundock/marginaleffects/issues\tabular{llll}{ - Package \tab Class \tab Argument \tab Documentation \cr - \code{brms} \tab \code{brmsfit} \tab \code{ndraws} \tab \link[brms:posterior_predict.brmsfit]{brms::posterior_predict} \cr - \tab \tab \code{re_formula} \tab \link[brms:posterior_predict.brmsfit]{brms::posterior_predict} \cr - \code{lme4} \tab \code{merMod} \tab \code{re.form} \tab \link[lme4:predict.merMod]{lme4::predict.merMod} \cr - \tab \tab \code{allow.new.levels} \tab \link[lme4:predict.merMod]{lme4::predict.merMod} \cr - \code{glmmTMB} \tab \code{glmmTMB} \tab \code{re.form} \tab \link[glmmTMB:predict.glmmTMB]{glmmTMB::predict.glmmTMB} \cr - \tab \tab \code{allow.new.levels} \tab \link[glmmTMB:predict.glmmTMB]{glmmTMB::predict.glmmTMB} \cr - \tab \tab \code{zitype} \tab \link[glmmTMB:predict.glmmTMB]{glmmTMB::predict.glmmTMB} \cr - \code{mgcv} \tab \code{bam} \tab \code{exclude} \tab \link[mgcv:predict.bam]{mgcv::predict.bam} \cr - \code{robustlmm} \tab \code{rlmerMod} \tab \code{re.form} \tab \link[robustlmm:rlmerMod-class]{robustlmm::predict.rlmerMod} \cr - \tab \tab \code{allow.new.levels} \tab \link[robustlmm:rlmerMod-class]{robustlmm::predict.rlmerMod} \cr - \code{MCMCglmm} \tab \code{MCMCglmm} \tab \code{ndraws} \tab \cr -} -} - -\section{Bayesian posterior summaries}{ - - -By default, credible intervals in bayesian models are built as equal-tailed -intervals. This can be changed to a highest density interval by setting a global -option: - -\code{options("marginaleffects_posterior_interval" = "eti")} - -\code{options("marginaleffects_posterior_interval" = "hdi")} - -By default, the center of the posterior distribution in bayesian models is -identified by the median. Users can use a different summary function by setting a -global option: - -\code{options("marginaleffects_posterior_center" = "mean")} - -\code{options("marginaleffects_posterior_center" = "median")} - -When estimates are averaged using the \code{by} argument, the \code{tidy()} function, or -the \code{summary()} function, the posterior distribution is marginalized twice over. -First, we take the average \emph{across} units but \emph{within} each iteration of the -MCMC chain, according to what the user requested in \code{by} argument or -\code{tidy()/summary()} functions. Then, we identify the center of the resulting -posterior using the function supplied to the -\code{"marginaleffects_posterior_center"} option (the median by default). -} - -\section{Equivalence, Inferiority, Superiority}{ - - -\eqn{\theta} is an estimate, \eqn{\sigma_\theta} its estimated standard error, and \eqn{[a, b]} are the bounds of the interval supplied to the \code{equivalence} argument. - -Non-inferiority: -\itemize{ -\item \eqn{H_0}{H0}: \eqn{\theta \leq a}{\theta <= a} -\item \eqn{H_1}{H1}: \eqn{\theta > a} -\item \eqn{t=(\theta - a)/\sigma_\theta}{t=(\theta - a)/\sigma_\theta} -\item p: Upper-tail probability -} - -Non-superiority: -\itemize{ -\item \eqn{H_0}{H0}: \eqn{\theta \geq b}{\theta >= b} -\item \eqn{H_1}{H1}: \eqn{\theta < b} -\item \eqn{t=(\theta - b)/\sigma_\theta}{t=(\theta - b)/\sigma_\theta} -\item p: Lower-tail probability -} - -Equivalence: Two One-Sided Tests (TOST) -\itemize{ -\item p: Maximum of the non-inferiority and non-superiority p values. -} - -Thanks to Russell V. Lenth for the excellent \code{emmeans} package and documentation which inspired this feature. -} - -\section{Prediction types}{ - - -The \code{type} argument determines the scale of the predictions used to compute quantities of interest with functions from the \code{marginaleffects} package. Admissible values for \code{type} depend on the model object. When users specify an incorrect value for \code{type}, \code{marginaleffects} will raise an informative error with a list of valid \code{type} values for the specific model object. The first entry in the list in that error message is the default type. - -The \code{invlink(link)} is a special type defined by \code{marginaleffects}. It is available for some (but not all) models and functions. With this link type, we first compute predictions on the link scale, then we use the inverse link function to backtransform the predictions to the response scale. This is useful for models with non-linear link functions as it can ensure that confidence intervals stay within desirable bounds, ex: 0 to 1 for a logit model. Note that an average of estimates with \code{type="invlink(link)"} will not always be equivalent to the average of estimates with \code{type="response"}. - -Some of the most common \code{type} values are: - -response, link, E, Ep, average, class, conditional, count, cum.prob, cumprob, density, disp, ev, expected, expvalue, fitted, invlink(link), latent, linear.predictor, linpred, location, lp, mean, numeric, p, ppd, pr, precision, prediction, prob, probability, probs, quantile, risk, scale, survival, unconditional, utility, variance, xb, zero, zlink, zprob -} - -\examples{ -library(marginaleffects) - -# simple marginal means for each level of `cyl` -dat <- mtcars -dat$carb <- factor(dat$carb) -dat$cyl <- factor(dat$cyl) -dat$am <- as.logical(dat$am) -mod <- lm(mpg ~ carb + cyl + am, dat) - -marginal_means( - mod, - variables = "cyl") - -# collapse levels of cyl by averaging -by <- data.frame( - cyl = c(4, 6, 8), - by = c("4 & 6", "4 & 6", "8")) -marginal_means(mod, - variables = "cyl", - by = by) - -# pairwise differences between collapsed levels -marginal_means(mod, - variables = "cyl", - by = by, - hypothesis = "pairwise") - -# cross -marginal_means(mod, - variables = c("cyl", "carb"), - cross = TRUE) - -# collapsed cross -by <- expand.grid( - cyl = unique(mtcars$cyl), - carb = unique(mtcars$carb)) -by$by <- ifelse( - by$cyl == 4, - paste("Control:", by$carb), - paste("Treatment:", by$carb)) - - -# Convert numeric variables to categorical before fitting the model -dat <- mtcars -dat$am <- as.logical(dat$am) -dat$carb <- as.factor(dat$carb) -mod <- lm(mpg ~ hp + am + carb, data = dat) - -# Compute and summarize marginal means -marginal_means(mod) - -# Contrast between marginal means (carb2 - carb1), or "is the 1st marginal means equal to the 2nd?" -# see the vignette on "Hypothesis Tests and Custom Contrasts" on the `marginaleffects` website. -lc <- c(-1, 1, 0, 0, 0, 0) -marginal_means(mod, variables = "carb", hypothesis = "b2 = b1") - -marginal_means(mod, variables = "carb", hypothesis = lc) - -# Multiple custom contrasts -lc <- matrix(c( - -2, 1, 1, 0, -1, 1, - -1, 1, 0, 0, 0, 0 - ), - ncol = 2, - dimnames = list(NULL, c("A", "B"))) -marginal_means(mod, variables = "carb", hypothesis = lc) - -} -\references{ -\itemize{ -\item Greenland S. 2019. "Valid P-Values Behave Exactly as They Should: Some Misleading Criticisms of P-Values and Their Resolution With S-Values." The American Statistician. 73(S1): 106–114. -\item Cole, Stephen R, Jessie K Edwards, and Sander Greenland. 2020. "Surprise!" American Journal of Epidemiology 190 (2): 191–93. https://doi.org/10.1093/aje/kwaa136 -} +Deprecated function } +\keyword{internal} diff -Nru r-cran-marginaleffects-0.17.0/man/marginaleffects.Rd r-cran-marginaleffects-0.18.0/man/marginaleffects.Rd --- r-cran-marginaleffects-0.17.0/man/marginaleffects.Rd 2023-12-08 18:43:20.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/man/marginaleffects.Rd 2024-02-05 01:34:54.000000000 +0000 @@ -1,12 +1,12 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slopes.R +% Please edit documentation in R/deprecated.R \name{marginaleffects} \alias{marginaleffects} -\title{\code{marginaleffects()} is an alias to \code{slopes()}} +\title{Deprecated function} \usage{ marginaleffects(...) } \description{ -This alias is kept for backward compatibility and because some users may prefer that name. +Deprecated function } \keyword{internal} diff -Nru r-cran-marginaleffects-0.17.0/man/marginalmeans.Rd r-cran-marginaleffects-0.18.0/man/marginalmeans.Rd --- r-cran-marginaleffects-0.17.0/man/marginalmeans.Rd 2023-12-08 15:34:54.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/man/marginalmeans.Rd 2024-02-05 01:34:54.000000000 +0000 @@ -1,8 +1,8 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/marginal_means.R +% Please edit documentation in R/deprecated.R \name{marginalmeans} \alias{marginalmeans} -\title{\code{marginal_means()} is an alias to \code{marginal_means()}} +\title{Deprecated function} \usage{ marginalmeans( model, @@ -23,326 +23,7 @@ ... ) } -\arguments{ -\item{model}{Model object} - -\item{variables}{Focal variables -\itemize{ -\item Character vector of variable names: compute marginal means for each category of the listed variables. -\item \code{NULL}: calculate marginal means for all logical, character, or factor variables in the dataset used to fit \code{model}. Hint: Set \code{cross=TRUE} to compute marginal means for combinations of focal variables. -}} - -\item{newdata}{Grid of predictor values over which we marginalize. -\itemize{ -\item Warning: Please avoid modifying your dataset between fitting the model and calling a \code{marginaleffects} function. This can sometimes lead to unexpected results. -\item \code{NULL} create a grid with all combinations of all categorical predictors in the model. Warning: can be expensive. -\item Character vector: subset of categorical variables to use when building the balanced grid of predictors. Other variables are held to their mean or mode. -\item Data frame: A data frame which includes all the predictors in the original model. The full dataset is replicated once for every combination of the focal variables in the \code{variables} argument, using the \code{datagridcf()} function. -}} - -\item{vcov}{Type of uncertainty estimates to report (e.g., for robust standard errors). Acceptable values: -\itemize{ -\item FALSE: Do not compute standard errors. This can speed up computation considerably. -\item TRUE: Unit-level standard errors using the default \code{vcov(model)} variance-covariance matrix. -\item String which indicates the kind of uncertainty estimates to return. -\itemize{ -\item Heteroskedasticity-consistent: \code{"HC"}, \code{"HC0"}, \code{"HC1"}, \code{"HC2"}, \code{"HC3"}, \code{"HC4"}, \code{"HC4m"}, \code{"HC5"}. See \code{?sandwich::vcovHC} -\item Heteroskedasticity and autocorrelation consistent: \code{"HAC"} -\item Mixed-Models degrees of freedom: "satterthwaite", "kenward-roger" -\item Other: \code{"NeweyWest"}, \code{"KernHAC"}, \code{"OPG"}. See the \code{sandwich} package documentation. -} -\item One-sided formula which indicates the name of cluster variables (e.g., \code{~unit_id}). This formula is passed to the \code{cluster} argument of the \code{sandwich::vcovCL} function. -\item Square covariance matrix -\item Function which returns a covariance matrix (e.g., \code{stats::vcov(model)}) -}} - -\item{conf_level}{numeric value between 0 and 1. Confidence level to use to build a confidence interval.} - -\item{type}{string indicates the type (scale) of the predictions used to -compute marginal effects or contrasts. This can differ based on the model -type, but will typically be a string such as: "response", "link", "probs", -or "zero". When an unsupported string is entered, the model-specific list of -acceptable values is returned in an error message. When \code{type} is \code{NULL}, the -first entry in the error message is used by default.} - -\item{transform}{A function applied to unit-level adjusted predictions and confidence intervals just before the function returns results. For bayesian models, this function is applied to individual draws from the posterior distribution, before computing summaries.} - -\item{cross}{TRUE or FALSE -\itemize{ -\item \code{FALSE} (default): Marginal means are computed for each predictor individually. -\item \code{TRUE}: Marginal means are computed for each combination of predictors specified in the \code{variables} argument. -}} - -\item{hypothesis}{specify a hypothesis test or custom contrast using a numeric value, vector, or matrix, a string, or a string formula. -\itemize{ -\item Numeric: -\itemize{ -\item Single value: the null hypothesis used in the computation of Z and p (before applying \code{transform}). -\item Vector: Weights to compute a linear combination of (custom contrast between) estimates. Length equal to the number of rows generated by the same function call, but without the \code{hypothesis} argument. -\item Matrix: Each column is a vector of weights, as describe above, used to compute a distinct linear combination of (contrast between) estimates. The column names of the matrix are used as labels in the output. -} -\item String formula to specify linear or non-linear hypothesis tests. If the \code{term} column uniquely identifies rows, terms can be used in the formula. Otherwise, use \code{b1}, \code{b2}, etc. to identify the position of each parameter. The \verb{b*} wildcard can be used to test hypotheses on all estimates. Examples: -\itemize{ -\item \code{hp = drat} -\item \code{hp + drat = 12} -\item \code{b1 + b2 + b3 = 0} -\item \verb{b* / b1 = 1} -} -\item String: -\itemize{ -\item "pairwise": pairwise differences between estimates in each row. -\item "reference": differences between the estimates in each row and the estimate in the first row. -\item "sequential": difference between an estimate and the estimate in the next row. -\item "revpairwise", "revreference", "revsequential": inverse of the corresponding hypotheses, as described above. -} -\item See the Examples section below and the vignette: https://marginaleffects.com/vignettes/hypothesis.html -}} - -\item{equivalence}{Numeric vector of length 2: bounds used for the two-one-sided test (TOST) of equivalence, and for the non-inferiority and non-superiority tests. See Details section below.} - -\item{p_adjust}{Adjust p-values for multiple comparisons: "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", or "fdr". See \link[stats:p.adjust]{stats::p.adjust}} - -\item{df}{Degrees of freedom used to compute p values and confidence intervals. A single numeric value between 1 and \code{Inf}. When \code{df} is \code{Inf}, the normal distribution is used. When \code{df} is finite, the \code{t} distribution is used. See \link[insight:get_df]{insight::get_df} for a convenient function to extract degrees of freedom. Ex: \code{slopes(model, df = insight::get_df(model))}} - -\item{wts}{character value. Weights to use in the averaging. -\itemize{ -\item "equal": each combination of variables in \code{newdata} gets equal weight. -\item "cells": each combination of values for the variables in the \code{newdata} gets a weight proportional to its frequency in the original data. -\item "proportional": each combination of values for the variables in \code{newdata} -- except for those in the \code{variables} argument -- gets a weight proportional to its frequency in the original data. -}} - -\item{by}{Collapse marginal means into categories. Data frame with a \code{by} column of group labels, and merging columns shared by \code{newdata} or the data frame produced by calling the same function without the \code{by} argument.} - -\item{numderiv}{string or list of strings indicating the method to use to for the numeric differentiation used in to compute delta method standard errors. -\itemize{ -\item "fdforward": finite difference method with forward differences -\item "fdcenter": finite difference method with central differences (default) -\item "richardson": Richardson extrapolation method -\item Extra arguments can be specified by passing a list to the \code{numDeriv} argument, with the name of the method first and named arguments following, ex: \code{numderiv=list("fdcenter", eps = 1e-5)}. When an unknown argument is used, \code{marginaleffects} prints the list of valid arguments for each method. -}} - -\item{...}{Additional arguments are passed to the \code{predict()} method -supplied by the modeling package.These arguments are particularly useful -for mixed-effects or bayesian models (see the online vignettes on the -\code{marginaleffects} website). Available arguments can vary from model to -model, depending on the range of supported arguments by each modeling -package. See the "Model-Specific Arguments" section of the -\code{?marginaleffects} documentation for a non-exhaustive list of available -arguments.} -} -\value{ -Data frame of marginal means with one row per variable-value combination. -} \description{ -This alias is kept for backward compatibility and because some users may prefer that name. -} -\details{ -This function begins by calling the \code{predictions} function to obtain a -grid of predictors, and adjusted predictions for each cell. The grid -includes all combinations of the categorical variables listed in the -\code{variables} and \code{newdata} arguments, or all combinations of the -categorical variables used to fit the model if \code{newdata} is \code{NULL}. -In the prediction grid, numeric variables are held at their means. - -After constructing the grid and filling the grid with adjusted predictions, -\code{marginal_means} computes marginal means for the variables listed in the -\code{variables} argument, by average across all categories in the grid. - -\code{marginal_means} can only compute standard errors for linear models, or for -predictions on the link scale, that is, with the \code{type} argument set to -"link". - -The \code{marginaleffects} website compares the output of this function to the -popular \code{emmeans} package, which provides similar but more advanced -functionality: https://marginaleffects.com/ -} -\section{Standard errors using the delta method}{ - - -Standard errors for all quantities estimated by \code{marginaleffects} can be obtained via the delta method. This requires differentiating a function with respect to the coefficients in the model using a finite difference approach. In some models, the delta method standard errors can be sensitive to various aspects of the numeric differentiation strategy, including the step size. By default, the step size is set to \code{1e-8}, or to \code{1e-4} times the smallest absolute model coefficient, whichever is largest. - -\code{marginaleffects} can delegate numeric differentiation to the \code{numDeriv} package, which allows more flexibility. To do this, users can pass arguments to the \code{numDeriv::jacobian} function through a global option. For example: -\itemize{ -\item \code{options(marginaleffects_numDeriv = list(method = "simple", method.args = list(eps = 1e-6)))} -\item \code{options(marginaleffects_numDeriv = list(method = "Richardson", method.args = list(eps = 1e-5)))} -\item \code{options(marginaleffects_numDeriv = NULL)} -} - -See the "Standard Errors and Confidence Intervals" vignette on the \code{marginaleffects} website for more details on the computation of standard errors: - -https://marginaleffects.com/vignettes/uncertainty.html - -Note that the \code{inferences()} function can be used to compute uncertainty estimates using a bootstrap or simulation-based inference. See the vignette: - -https://marginaleffects.com/vignettes/bootstrap.html -} - -\section{Model-Specific Arguments}{ - - -Some model types allow model-specific arguments to modify the nature of -marginal effects, predictions, marginal means, and contrasts. Please report -other package-specific \code{predict()} arguments on Github so we can add them to -the table below. - -https://github.com/vincentarelbundock/marginaleffects/issues\tabular{llll}{ - Package \tab Class \tab Argument \tab Documentation \cr - \code{brms} \tab \code{brmsfit} \tab \code{ndraws} \tab \link[brms:posterior_predict.brmsfit]{brms::posterior_predict} \cr - \tab \tab \code{re_formula} \tab \link[brms:posterior_predict.brmsfit]{brms::posterior_predict} \cr - \code{lme4} \tab \code{merMod} \tab \code{re.form} \tab \link[lme4:predict.merMod]{lme4::predict.merMod} \cr - \tab \tab \code{allow.new.levels} \tab \link[lme4:predict.merMod]{lme4::predict.merMod} \cr - \code{glmmTMB} \tab \code{glmmTMB} \tab \code{re.form} \tab \link[glmmTMB:predict.glmmTMB]{glmmTMB::predict.glmmTMB} \cr - \tab \tab \code{allow.new.levels} \tab \link[glmmTMB:predict.glmmTMB]{glmmTMB::predict.glmmTMB} \cr - \tab \tab \code{zitype} \tab \link[glmmTMB:predict.glmmTMB]{glmmTMB::predict.glmmTMB} \cr - \code{mgcv} \tab \code{bam} \tab \code{exclude} \tab \link[mgcv:predict.bam]{mgcv::predict.bam} \cr - \code{robustlmm} \tab \code{rlmerMod} \tab \code{re.form} \tab \link[robustlmm:rlmerMod-class]{robustlmm::predict.rlmerMod} \cr - \tab \tab \code{allow.new.levels} \tab \link[robustlmm:rlmerMod-class]{robustlmm::predict.rlmerMod} \cr - \code{MCMCglmm} \tab \code{MCMCglmm} \tab \code{ndraws} \tab \cr -} -} - -\section{Bayesian posterior summaries}{ - - -By default, credible intervals in bayesian models are built as equal-tailed -intervals. This can be changed to a highest density interval by setting a global -option: - -\code{options("marginaleffects_posterior_interval" = "eti")} - -\code{options("marginaleffects_posterior_interval" = "hdi")} - -By default, the center of the posterior distribution in bayesian models is -identified by the median. Users can use a different summary function by setting a -global option: - -\code{options("marginaleffects_posterior_center" = "mean")} - -\code{options("marginaleffects_posterior_center" = "median")} - -When estimates are averaged using the \code{by} argument, the \code{tidy()} function, or -the \code{summary()} function, the posterior distribution is marginalized twice over. -First, we take the average \emph{across} units but \emph{within} each iteration of the -MCMC chain, according to what the user requested in \code{by} argument or -\code{tidy()/summary()} functions. Then, we identify the center of the resulting -posterior using the function supplied to the -\code{"marginaleffects_posterior_center"} option (the median by default). -} - -\section{Equivalence, Inferiority, Superiority}{ - - -\eqn{\theta} is an estimate, \eqn{\sigma_\theta} its estimated standard error, and \eqn{[a, b]} are the bounds of the interval supplied to the \code{equivalence} argument. - -Non-inferiority: -\itemize{ -\item \eqn{H_0}{H0}: \eqn{\theta \leq a}{\theta <= a} -\item \eqn{H_1}{H1}: \eqn{\theta > a} -\item \eqn{t=(\theta - a)/\sigma_\theta}{t=(\theta - a)/\sigma_\theta} -\item p: Upper-tail probability -} - -Non-superiority: -\itemize{ -\item \eqn{H_0}{H0}: \eqn{\theta \geq b}{\theta >= b} -\item \eqn{H_1}{H1}: \eqn{\theta < b} -\item \eqn{t=(\theta - b)/\sigma_\theta}{t=(\theta - b)/\sigma_\theta} -\item p: Lower-tail probability -} - -Equivalence: Two One-Sided Tests (TOST) -\itemize{ -\item p: Maximum of the non-inferiority and non-superiority p values. -} - -Thanks to Russell V. Lenth for the excellent \code{emmeans} package and documentation which inspired this feature. -} - -\section{Prediction types}{ - - -The \code{type} argument determines the scale of the predictions used to compute quantities of interest with functions from the \code{marginaleffects} package. Admissible values for \code{type} depend on the model object. When users specify an incorrect value for \code{type}, \code{marginaleffects} will raise an informative error with a list of valid \code{type} values for the specific model object. The first entry in the list in that error message is the default type. - -The \code{invlink(link)} is a special type defined by \code{marginaleffects}. It is available for some (but not all) models and functions. With this link type, we first compute predictions on the link scale, then we use the inverse link function to backtransform the predictions to the response scale. This is useful for models with non-linear link functions as it can ensure that confidence intervals stay within desirable bounds, ex: 0 to 1 for a logit model. Note that an average of estimates with \code{type="invlink(link)"} will not always be equivalent to the average of estimates with \code{type="response"}. - -Some of the most common \code{type} values are: - -response, link, E, Ep, average, class, conditional, count, cum.prob, cumprob, density, disp, ev, expected, expvalue, fitted, invlink(link), latent, linear.predictor, linpred, location, lp, mean, numeric, p, ppd, pr, precision, prediction, prob, probability, probs, quantile, risk, scale, survival, unconditional, utility, variance, xb, zero, zlink, zprob -} - -\examples{ -library(marginaleffects) - -# simple marginal means for each level of `cyl` -dat <- mtcars -dat$carb <- factor(dat$carb) -dat$cyl <- factor(dat$cyl) -dat$am <- as.logical(dat$am) -mod <- lm(mpg ~ carb + cyl + am, dat) - -marginal_means( - mod, - variables = "cyl") - -# collapse levels of cyl by averaging -by <- data.frame( - cyl = c(4, 6, 8), - by = c("4 & 6", "4 & 6", "8")) -marginal_means(mod, - variables = "cyl", - by = by) - -# pairwise differences between collapsed levels -marginal_means(mod, - variables = "cyl", - by = by, - hypothesis = "pairwise") - -# cross -marginal_means(mod, - variables = c("cyl", "carb"), - cross = TRUE) - -# collapsed cross -by <- expand.grid( - cyl = unique(mtcars$cyl), - carb = unique(mtcars$carb)) -by$by <- ifelse( - by$cyl == 4, - paste("Control:", by$carb), - paste("Treatment:", by$carb)) - - -# Convert numeric variables to categorical before fitting the model -dat <- mtcars -dat$am <- as.logical(dat$am) -dat$carb <- as.factor(dat$carb) -mod <- lm(mpg ~ hp + am + carb, data = dat) - -# Compute and summarize marginal means -marginal_means(mod) - -# Contrast between marginal means (carb2 - carb1), or "is the 1st marginal means equal to the 2nd?" -# see the vignette on "Hypothesis Tests and Custom Contrasts" on the `marginaleffects` website. -lc <- c(-1, 1, 0, 0, 0, 0) -marginal_means(mod, variables = "carb", hypothesis = "b2 = b1") - -marginal_means(mod, variables = "carb", hypothesis = lc) - -# Multiple custom contrasts -lc <- matrix(c( - -2, 1, 1, 0, -1, 1, - -1, 1, 0, 0, 0, 0 - ), - ncol = 2, - dimnames = list(NULL, c("A", "B"))) -marginal_means(mod, variables = "carb", hypothesis = lc) - -} -\references{ -\itemize{ -\item Greenland S. 2019. "Valid P-Values Behave Exactly as They Should: Some Misleading Criticisms of P-Values and Their Resolution With S-Values." The American Statistician. 73(S1): 106–114. -\item Cole, Stephen R, Jessie K Edwards, and Sander Greenland. 2020. "Surprise!" American Journal of Epidemiology 190 (2): 191–93. https://doi.org/10.1093/aje/kwaa136 -} +Deprecated function } \keyword{internal} diff -Nru r-cran-marginaleffects-0.17.0/man/meffects.Rd r-cran-marginaleffects-0.18.0/man/meffects.Rd --- r-cran-marginaleffects-0.17.0/man/meffects.Rd 2023-12-08 18:43:20.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/man/meffects.Rd 2024-02-05 01:34:54.000000000 +0000 @@ -1,12 +1,12 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slopes.R +% Please edit documentation in R/deprecated.R \name{meffects} \alias{meffects} -\title{\code{meffects()} is an alias to \code{slopes()}} +\title{Deprecated function} \usage{ meffects(...) } \description{ -This alias is kept for backward compatibility and because some users may prefer that name. +Deprecated function } \keyword{internal} diff -Nru r-cran-marginaleffects-0.17.0/man/plot_cap.Rd r-cran-marginaleffects-0.18.0/man/plot_cap.Rd --- r-cran-marginaleffects-0.17.0/man/plot_cap.Rd 2023-12-08 15:34:54.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/man/plot_cap.Rd 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/plot_predictions.R -\name{plot_cap} -\alias{plot_cap} -\title{\code{plot_predictions()} is an alias to \code{plot_predictions()}} -\usage{ -plot_cap(...) -} -\arguments{ -\item{...}{Additional arguments are passed to the \code{predict()} method -supplied by the modeling package.These arguments are particularly useful -for mixed-effects or bayesian models (see the online vignettes on the -\code{marginaleffects} website). Available arguments can vary from model to -model, depending on the range of supported arguments by each modeling -package. See the "Model-Specific Arguments" section of the -\code{?marginaleffects} documentation for a non-exhaustive list of available -arguments.} -} -\value{ -A \code{ggplot2} object or data frame (if \code{draw=FALSE}) -} -\description{ -This alias is kept for backward compatibility. -} -\section{Model-Specific Arguments}{ - - -Some model types allow model-specific arguments to modify the nature of -marginal effects, predictions, marginal means, and contrasts. Please report -other package-specific \code{predict()} arguments on Github so we can add them to -the table below. - -https://github.com/vincentarelbundock/marginaleffects/issues\tabular{llll}{ - Package \tab Class \tab Argument \tab Documentation \cr - \code{brms} \tab \code{brmsfit} \tab \code{ndraws} \tab \link[brms:posterior_predict.brmsfit]{brms::posterior_predict} \cr - \tab \tab \code{re_formula} \tab \link[brms:posterior_predict.brmsfit]{brms::posterior_predict} \cr - \code{lme4} \tab \code{merMod} \tab \code{re.form} \tab \link[lme4:predict.merMod]{lme4::predict.merMod} \cr - \tab \tab \code{allow.new.levels} \tab \link[lme4:predict.merMod]{lme4::predict.merMod} \cr - \code{glmmTMB} \tab \code{glmmTMB} \tab \code{re.form} \tab \link[glmmTMB:predict.glmmTMB]{glmmTMB::predict.glmmTMB} \cr - \tab \tab \code{allow.new.levels} \tab \link[glmmTMB:predict.glmmTMB]{glmmTMB::predict.glmmTMB} \cr - \tab \tab \code{zitype} \tab \link[glmmTMB:predict.glmmTMB]{glmmTMB::predict.glmmTMB} \cr - \code{mgcv} \tab \code{bam} \tab \code{exclude} \tab \link[mgcv:predict.bam]{mgcv::predict.bam} \cr - \code{robustlmm} \tab \code{rlmerMod} \tab \code{re.form} \tab \link[robustlmm:rlmerMod-class]{robustlmm::predict.rlmerMod} \cr - \tab \tab \code{allow.new.levels} \tab \link[robustlmm:rlmerMod-class]{robustlmm::predict.rlmerMod} \cr - \code{MCMCglmm} \tab \code{MCMCglmm} \tab \code{ndraws} \tab \cr -} -} - -\section{Prediction types}{ - - -The \code{type} argument determines the scale of the predictions used to compute quantities of interest with functions from the \code{marginaleffects} package. Admissible values for \code{type} depend on the model object. When users specify an incorrect value for \code{type}, \code{marginaleffects} will raise an informative error with a list of valid \code{type} values for the specific model object. The first entry in the list in that error message is the default type. - -The \code{invlink(link)} is a special type defined by \code{marginaleffects}. It is available for some (but not all) models and functions. With this link type, we first compute predictions on the link scale, then we use the inverse link function to backtransform the predictions to the response scale. This is useful for models with non-linear link functions as it can ensure that confidence intervals stay within desirable bounds, ex: 0 to 1 for a logit model. Note that an average of estimates with \code{type="invlink(link)"} will not always be equivalent to the average of estimates with \code{type="response"}. - -Some of the most common \code{type} values are: - -response, link, E, Ep, average, class, conditional, count, cum.prob, cumprob, density, disp, ev, expected, expvalue, fitted, invlink(link), latent, linear.predictor, linpred, location, lp, mean, numeric, p, ppd, pr, precision, prediction, prob, probability, probs, quantile, risk, scale, survival, unconditional, utility, variance, xb, zero, zlink, zprob -} - -\examples{ -mod <- lm(mpg ~ hp + wt, data = mtcars) -plot_predictions(mod, condition = "wt") - -mod <- lm(mpg ~ hp * wt * am, data = mtcars) -plot_predictions(mod, condition = c("hp", "wt")) - -plot_predictions(mod, condition = list("hp", wt = "threenum")) - -plot_predictions(mod, condition = list("hp", wt = range)) - -} -\keyword{internal} diff -Nru r-cran-marginaleffects-0.17.0/man/plot_cco.Rd r-cran-marginaleffects-0.18.0/man/plot_cco.Rd --- r-cran-marginaleffects-0.17.0/man/plot_cco.Rd 2023-12-08 15:34:54.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/man/plot_cco.Rd 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/plot_comparisons.R -\name{plot_cco} -\alias{plot_cco} -\title{\code{plot_comparisons()} is an alias to \code{plot_comparisons()}} -\usage{ -plot_cco(...) -} -\arguments{ -\item{...}{Additional arguments are passed to the \code{predict()} method -supplied by the modeling package.These arguments are particularly useful -for mixed-effects or bayesian models (see the online vignettes on the -\code{marginaleffects} website). Available arguments can vary from model to -model, depending on the range of supported arguments by each modeling -package. See the "Model-Specific Arguments" section of the -\code{?marginaleffects} documentation for a non-exhaustive list of available -arguments.} -} -\value{ -A \code{ggplot2} object or data frame (if \code{draw=FALSE}) -} -\description{ -This alias is kept for backward compatibility. -} -\section{Model-Specific Arguments}{ - - -Some model types allow model-specific arguments to modify the nature of -marginal effects, predictions, marginal means, and contrasts. Please report -other package-specific \code{predict()} arguments on Github so we can add them to -the table below. - -https://github.com/vincentarelbundock/marginaleffects/issues\tabular{llll}{ - Package \tab Class \tab Argument \tab Documentation \cr - \code{brms} \tab \code{brmsfit} \tab \code{ndraws} \tab \link[brms:posterior_predict.brmsfit]{brms::posterior_predict} \cr - \tab \tab \code{re_formula} \tab \link[brms:posterior_predict.brmsfit]{brms::posterior_predict} \cr - \code{lme4} \tab \code{merMod} \tab \code{re.form} \tab \link[lme4:predict.merMod]{lme4::predict.merMod} \cr - \tab \tab \code{allow.new.levels} \tab \link[lme4:predict.merMod]{lme4::predict.merMod} \cr - \code{glmmTMB} \tab \code{glmmTMB} \tab \code{re.form} \tab \link[glmmTMB:predict.glmmTMB]{glmmTMB::predict.glmmTMB} \cr - \tab \tab \code{allow.new.levels} \tab \link[glmmTMB:predict.glmmTMB]{glmmTMB::predict.glmmTMB} \cr - \tab \tab \code{zitype} \tab \link[glmmTMB:predict.glmmTMB]{glmmTMB::predict.glmmTMB} \cr - \code{mgcv} \tab \code{bam} \tab \code{exclude} \tab \link[mgcv:predict.bam]{mgcv::predict.bam} \cr - \code{robustlmm} \tab \code{rlmerMod} \tab \code{re.form} \tab \link[robustlmm:rlmerMod-class]{robustlmm::predict.rlmerMod} \cr - \tab \tab \code{allow.new.levels} \tab \link[robustlmm:rlmerMod-class]{robustlmm::predict.rlmerMod} \cr - \code{MCMCglmm} \tab \code{MCMCglmm} \tab \code{ndraws} \tab \cr -} -} - -\section{Prediction types}{ - - -The \code{type} argument determines the scale of the predictions used to compute quantities of interest with functions from the \code{marginaleffects} package. Admissible values for \code{type} depend on the model object. When users specify an incorrect value for \code{type}, \code{marginaleffects} will raise an informative error with a list of valid \code{type} values for the specific model object. The first entry in the list in that error message is the default type. - -The \code{invlink(link)} is a special type defined by \code{marginaleffects}. It is available for some (but not all) models and functions. With this link type, we first compute predictions on the link scale, then we use the inverse link function to backtransform the predictions to the response scale. This is useful for models with non-linear link functions as it can ensure that confidence intervals stay within desirable bounds, ex: 0 to 1 for a logit model. Note that an average of estimates with \code{type="invlink(link)"} will not always be equivalent to the average of estimates with \code{type="response"}. - -Some of the most common \code{type} values are: - -response, link, E, Ep, average, class, conditional, count, cum.prob, cumprob, density, disp, ev, expected, expvalue, fitted, invlink(link), latent, linear.predictor, linpred, location, lp, mean, numeric, p, ppd, pr, precision, prediction, prob, probability, probs, quantile, risk, scale, survival, unconditional, utility, variance, xb, zero, zlink, zprob -} - -\examples{ -mod <- lm(mpg ~ hp + wt, data = mtcars) -plot_predictions(mod, condition = "wt") - -mod <- lm(mpg ~ hp * wt * am, data = mtcars) -plot_predictions(mod, condition = c("hp", "wt")) - -plot_predictions(mod, condition = list("hp", wt = "threenum")) - -plot_predictions(mod, condition = list("hp", wt = range)) - -} -\keyword{internal} diff -Nru r-cran-marginaleffects-0.17.0/man/plot_cme.Rd r-cran-marginaleffects-0.18.0/man/plot_cme.Rd --- r-cran-marginaleffects-0.17.0/man/plot_cme.Rd 2023-12-08 15:34:54.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/man/plot_cme.Rd 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/plot_slopes.R -\name{plot_cme} -\alias{plot_cme} -\title{\code{plot_slopes()} is an alias to \code{plot_slopes()}} -\usage{ -plot_cme(...) -} -\arguments{ -\item{...}{Additional arguments are passed to the \code{predict()} method -supplied by the modeling package.These arguments are particularly useful -for mixed-effects or bayesian models (see the online vignettes on the -\code{marginaleffects} website). Available arguments can vary from model to -model, depending on the range of supported arguments by each modeling -package. See the "Model-Specific Arguments" section of the -\code{?marginaleffects} documentation for a non-exhaustive list of available -arguments.} -} -\value{ -A \code{ggplot2} object or data frame (if \code{draw=FALSE}) -} -\description{ -This alias is kept for backward compatibility. -} -\section{Model-Specific Arguments}{ - - -Some model types allow model-specific arguments to modify the nature of -marginal effects, predictions, marginal means, and contrasts. Please report -other package-specific \code{predict()} arguments on Github so we can add them to -the table below. - -https://github.com/vincentarelbundock/marginaleffects/issues\tabular{llll}{ - Package \tab Class \tab Argument \tab Documentation \cr - \code{brms} \tab \code{brmsfit} \tab \code{ndraws} \tab \link[brms:posterior_predict.brmsfit]{brms::posterior_predict} \cr - \tab \tab \code{re_formula} \tab \link[brms:posterior_predict.brmsfit]{brms::posterior_predict} \cr - \code{lme4} \tab \code{merMod} \tab \code{re.form} \tab \link[lme4:predict.merMod]{lme4::predict.merMod} \cr - \tab \tab \code{allow.new.levels} \tab \link[lme4:predict.merMod]{lme4::predict.merMod} \cr - \code{glmmTMB} \tab \code{glmmTMB} \tab \code{re.form} \tab \link[glmmTMB:predict.glmmTMB]{glmmTMB::predict.glmmTMB} \cr - \tab \tab \code{allow.new.levels} \tab \link[glmmTMB:predict.glmmTMB]{glmmTMB::predict.glmmTMB} \cr - \tab \tab \code{zitype} \tab \link[glmmTMB:predict.glmmTMB]{glmmTMB::predict.glmmTMB} \cr - \code{mgcv} \tab \code{bam} \tab \code{exclude} \tab \link[mgcv:predict.bam]{mgcv::predict.bam} \cr - \code{robustlmm} \tab \code{rlmerMod} \tab \code{re.form} \tab \link[robustlmm:rlmerMod-class]{robustlmm::predict.rlmerMod} \cr - \tab \tab \code{allow.new.levels} \tab \link[robustlmm:rlmerMod-class]{robustlmm::predict.rlmerMod} \cr - \code{MCMCglmm} \tab \code{MCMCglmm} \tab \code{ndraws} \tab \cr -} -} - -\section{Prediction types}{ - - -The \code{type} argument determines the scale of the predictions used to compute quantities of interest with functions from the \code{marginaleffects} package. Admissible values for \code{type} depend on the model object. When users specify an incorrect value for \code{type}, \code{marginaleffects} will raise an informative error with a list of valid \code{type} values for the specific model object. The first entry in the list in that error message is the default type. - -The \code{invlink(link)} is a special type defined by \code{marginaleffects}. It is available for some (but not all) models and functions. With this link type, we first compute predictions on the link scale, then we use the inverse link function to backtransform the predictions to the response scale. This is useful for models with non-linear link functions as it can ensure that confidence intervals stay within desirable bounds, ex: 0 to 1 for a logit model. Note that an average of estimates with \code{type="invlink(link)"} will not always be equivalent to the average of estimates with \code{type="response"}. - -Some of the most common \code{type} values are: - -response, link, E, Ep, average, class, conditional, count, cum.prob, cumprob, density, disp, ev, expected, expvalue, fitted, invlink(link), latent, linear.predictor, linpred, location, lp, mean, numeric, p, ppd, pr, precision, prediction, prob, probability, probs, quantile, risk, scale, survival, unconditional, utility, variance, xb, zero, zlink, zprob -} - -\examples{ -mod <- lm(mpg ~ hp + wt, data = mtcars) -plot_predictions(mod, condition = "wt") - -mod <- lm(mpg ~ hp * wt * am, data = mtcars) -plot_predictions(mod, condition = c("hp", "wt")) - -plot_predictions(mod, condition = list("hp", wt = "threenum")) - -plot_predictions(mod, condition = list("hp", wt = range)) - -} -\keyword{internal} diff -Nru r-cran-marginaleffects-0.17.0/man/plot_comparisons.Rd r-cran-marginaleffects-0.18.0/man/plot_comparisons.Rd --- r-cran-marginaleffects-0.17.0/man/plot_comparisons.Rd 2023-12-08 15:34:54.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/man/plot_comparisons.Rd 2024-02-02 23:46:58.000000000 +0000 @@ -110,7 +110,7 @@ \code{marginaleffects} website). Available arguments can vary from model to model, depending on the range of supported arguments by each modeling package. See the "Model-Specific Arguments" section of the -\code{?marginaleffects} documentation for a non-exhaustive list of available +\code{?slopes} documentation for a non-exhaustive list of available arguments.} } \value{ @@ -121,9 +121,8 @@ The \code{by} argument is used to plot marginal comparisons, that is, comparisons made on the original data, but averaged by subgroups. This is analogous to using the \code{by} argument in the \code{comparisons()} function. -The \code{condition} argument is used to plot conditional comparisons, that is, comparisons made on a user-specified grid. This is analogous to using the \code{newdata} argument and \code{datagrid()} function in a \code{comparisons()} call. +The \code{condition} argument is used to plot conditional comparisons, that is, comparisons made on a user-specified grid. This is analogous to using the \code{newdata} argument and \code{datagrid()} function in a \code{comparisons()} call. All variables whose values are not specified explicitly are treated as usual by \code{datagrid()}, that is, they are held at their mean or mode (or rounded mean for integers). This includes grouping variables in mixed-effects models, so analysts who fit such models may want to specify the groups of interest using the \code{condition} argument, or supply model-specific arguments to compute population-level estimates. See details below. -All unspecified variables are held at their mean or mode. This includes grouping variables in mixed-effects models, so analysts who fit such models may want to specify the groups of interest using the \code{variables} argument, or supply model-specific arguments to compute population-level estimates. See details below. See the "Plots" vignette and website for tutorials and information on how to customize plots: \itemize{ \item https://marginaleffects.com/vignettes/plot.html diff -Nru r-cran-marginaleffects-0.17.0/man/plot_predictions.Rd r-cran-marginaleffects-0.18.0/man/plot_predictions.Rd --- r-cran-marginaleffects-0.17.0/man/plot_predictions.Rd 2023-12-08 15:34:54.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/man/plot_predictions.Rd 2024-02-02 23:46:58.000000000 +0000 @@ -92,7 +92,7 @@ \code{marginaleffects} website). Available arguments can vary from model to model, depending on the range of supported arguments by each modeling package. See the "Model-Specific Arguments" section of the -\code{?marginaleffects} documentation for a non-exhaustive list of available +\code{?slopes} documentation for a non-exhaustive list of available arguments.} } \value{ @@ -103,9 +103,7 @@ The \code{by} argument is used to plot marginal predictions, that is, predictions made on the original data, but averaged by subgroups. This is analogous to using the \code{by} argument in the \code{predictions()} function. -The \code{condition} argument is used to plot conditional predictions, that is, predictions made on a user-specified grid. This is analogous to using the \code{newdata} argument and \code{datagrid()} function in a \code{predictions()} call. - -All unspecified variables are held at their mean or mode. This includes grouping variables in mixed-effects models, so analysts who fit such models may want to specify the groups of interest using the \code{variables} argument, or supply model-specific arguments to compute population-level estimates. See details below. +The \code{condition} argument is used to plot conditional predictions, that is, predictions made on a user-specified grid. This is analogous to using the \code{newdata} argument and \code{datagrid()} function in a \code{predictions()} call. All variables whose values are not specified explicitly are treated as usual by \code{datagrid()}, that is, they are held at their mean or mode (or rounded mean for integers). This includes grouping variables in mixed-effects models, so analysts who fit such models may want to specify the groups of interest using the \code{condition} argument, or supply model-specific arguments to compute population-level estimates. See details below. See the "Plots" vignette and website for tutorials and information on how to customize plots: \itemize{ @@ -146,7 +144,7 @@ Some of the most common \code{type} values are: -response, link, E, Ep, average, class, conditional, count, cum.prob, cumprob, density, disp, ev, expected, expvalue, fitted, invlink(link), latent, linear.predictor, linpred, location, lp, mean, numeric, p, ppd, pr, precision, prediction, prob, probability, probs, quantile, risk, scale, survival, unconditional, utility, variance, xb, zero, zlink, zprob +response, link, E, Ep, average, class, conditional, count, cum.prob, cumprob, density, detection, disp, ev, expected, expvalue, fitted, invlink(link), latent, latent_N, linear.predictor, linpred, location, lp, mean, numeric, p, ppd, pr, precision, prediction, prob, probability, probs, quantile, risk, scale, survival, unconditional, utility, variance, xb, zero, zlink, zprob } \examples{ diff -Nru r-cran-marginaleffects-0.17.0/man/plot_slopes.Rd r-cran-marginaleffects-0.18.0/man/plot_slopes.Rd --- r-cran-marginaleffects-0.17.0/man/plot_slopes.Rd 2023-12-08 15:34:54.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/man/plot_slopes.Rd 2024-02-02 23:46:58.000000000 +0000 @@ -103,7 +103,7 @@ \code{marginaleffects} website). Available arguments can vary from model to model, depending on the range of supported arguments by each modeling package. See the "Model-Specific Arguments" section of the -\code{?marginaleffects} documentation for a non-exhaustive list of available +\code{?slopes} documentation for a non-exhaustive list of available arguments.} } \value{ @@ -114,9 +114,7 @@ The \code{by} argument is used to plot marginal slopes, that is, slopes made on the original data, but averaged by subgroups. This is analogous to using the \code{by} argument in the \code{slopes()} function. -The \code{condition} argument is used to plot conditional slopes, that is, slopes made on a user-specified grid. This is analogous to using the \code{newdata} argument and \code{datagrid()} function in a \code{slopes()} call. - -All unspecified variables are held at their mean or mode. This includes grouping variables in mixed-effects models, so analysts who fit such models may want to specify the groups of interest using the \code{variables} argument, or supply model-specific arguments to compute population-level estimates. See details below. +The \code{condition} argument is used to plot conditional slopes, that is, slopes computed on a user-specified grid. This is analogous to using the \code{newdata} argument and \code{datagrid()} function in a \code{slopes()} call. All variables whose values are not specified explicitly are treated as usual by \code{datagrid()}, that is, they are held at their mean or mode (or rounded mean for integers). This includes grouping variables in mixed-effects models, so analysts who fit such models may want to specify the groups of interest using the \code{condition} argument, or supply model-specific arguments to compute population-level estimates. See details below. See the "Plots" vignette and website for tutorials and information on how to customize plots: \itemize{ \item https://marginaleffects.com/vignettes/plot.html diff -Nru r-cran-marginaleffects-0.17.0/man/predictions.Rd r-cran-marginaleffects-0.18.0/man/predictions.Rd --- r-cran-marginaleffects-0.17.0/man/predictions.Rd 2023-12-08 15:34:54.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/man/predictions.Rd 2024-01-24 03:02:07.000000000 +0000 @@ -187,7 +187,7 @@ \code{marginaleffects} website). Available arguments can vary from model to model, depending on the range of supported arguments by each modeling package. See the "Model-Specific Arguments" section of the -\code{?marginaleffects} documentation for a non-exhaustive list of available +\code{?slopes} documentation for a non-exhaustive list of available arguments.} } \value{ @@ -337,11 +337,12 @@ Some of the most common \code{type} values are: -response, link, E, Ep, average, class, conditional, count, cum.prob, cumprob, density, disp, ev, expected, expvalue, fitted, invlink(link), latent, linear.predictor, linpred, location, lp, mean, numeric, p, ppd, pr, precision, prediction, prob, probability, probs, quantile, risk, scale, survival, unconditional, utility, variance, xb, zero, zlink, zprob +response, link, E, Ep, average, class, conditional, count, cum.prob, cumprob, density, detection, disp, ev, expected, expvalue, fitted, invlink(link), latent, latent_N, linear.predictor, linpred, location, lp, mean, numeric, p, ppd, pr, precision, prediction, prob, probability, probs, quantile, risk, scale, survival, unconditional, utility, variance, xb, zero, zlink, zprob } \examples{ -\dontrun{ +\dontshow{if (interactive() || isTRUE(Sys.getenv("R_DOC_BUILD") == "true")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{\}) # examplesIf} # Adjusted Prediction for every row of the original dataset mod <- lm(mpg ~ hp + factor(cyl), data = mtcars) pred <- predictions(mod) @@ -437,7 +438,6 @@ by = c("4,6", "4,6", "8"), group = as.character(c(4, 6, 8))) predictions(mod, newdata = "mean", byfun = sum, by = by) -} } \references{ diff -Nru r-cran-marginaleffects-0.17.0/man/print.marginaleffects.Rd r-cran-marginaleffects-0.18.0/man/print.marginaleffects.Rd --- r-cran-marginaleffects-0.17.0/man/print.marginaleffects.Rd 2023-11-24 16:54:37.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/man/print.marginaleffects.Rd 2024-02-05 01:34:54.000000000 +0000 @@ -18,7 +18,7 @@ ) } \arguments{ -\item{x}{An object produced by one of the \code{\link{marginaleffects}} package functions.} +\item{x}{An object produced by one of the \code{marginaleffects} package functions.} \item{digits}{The number of digits to display.} @@ -39,7 +39,7 @@ \item{...}{Other arguments are currently ignored.} } \description{ -This function controls the text which is printed to the console when one of the core \code{marginalefffects} functions is called and the object is returned: \code{predictions()}, \code{comparisons()}, \code{slopes()}, \code{marginal_means()}, \code{hypotheses()}, \code{avg_predictions()}, \code{avg_comparisons()}, \code{avg_slopes()}. +This function controls the text which is printed to the console when one of the core \code{marginalefffects} functions is called and the object is returned: \code{predictions()}, \code{comparisons()}, \code{slopes()}, \code{hypotheses()}, \code{avg_predictions()}, \code{avg_comparisons()}, \code{avg_slopes()}. All of those functions return standard data frames. Columns can be extracted by name, \code{predictions(model)$estimate}, and all the usual data manipulation functions work out-of-the-box: \code{colnames()}, \code{head()}, \code{subset()}, \code{dplyr::filter()}, \code{dplyr::arrange()}, etc. diff -Nru r-cran-marginaleffects-0.17.0/man/sanitize_model_specific.Rd r-cran-marginaleffects-0.18.0/man/sanitize_model_specific.Rd --- r-cran-marginaleffects-0.17.0/man/sanitize_model_specific.Rd 2023-11-24 16:54:37.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/man/sanitize_model_specific.Rd 2024-01-24 02:04:41.000000000 +0000 @@ -2,7 +2,8 @@ % Please edit documentation in R/methods_aod.R, R/methods_betareg.R, % R/sanity_model.R, R/methods_brms.R, R/methods_dbarts.R, R/methods_glmmTMB.R, % R/methods_inferences_simulation.R, R/methods_mclogit.R, R/methods_mlogit.R, -% R/methods_ordinal.R, R/methods_plm.R, R/methods_quantreg.R +% R/methods_ordinal.R, R/methods_plm.R, R/methods_quantreg.R, +% R/methods_survey.R \name{sanitize_model_specific.glimML} \alias{sanitize_model_specific.glimML} \alias{sanitize_model_specific.betareg} @@ -17,6 +18,8 @@ \alias{sanitize_model_specific.clm} \alias{sanitize_model_specific.plm} \alias{sanitize_model_specific.rqs} +\alias{sanitize_model_specific.svyolr} +\alias{sanitize_model_specific.svyglm} \title{Method to raise model-specific warnings and errors} \usage{ \method{sanitize_model_specific}{glimML}(model, ...) @@ -56,6 +59,10 @@ \method{sanitize_model_specific}{plm}(model, ...) \method{sanitize_model_specific}{rqs}(model, ...) + +\method{sanitize_model_specific}{svyolr}(model, wts = NULL, ...) + +\method{sanitize_model_specific}{svyglm}(model, wts = NULL, ...) } \arguments{ \item{model}{Model object} @@ -66,7 +73,7 @@ \code{marginaleffects} website). Available arguments can vary from model to model, depending on the range of supported arguments by each modeling package. See the "Model-Specific Arguments" section of the -\code{?marginaleffects} documentation for a non-exhaustive list of available +\code{?slopes} documentation for a non-exhaustive list of available arguments.} \item{vcov}{Type of uncertainty estimates to report (e.g., for robust standard errors). Acceptable values: @@ -103,6 +110,12 @@ \item "grid": Marginal Effects on a grid of representative numbers (Tukey's 5 numbers and unique values of categorical predictors). } }} + +\item{wts}{string or numeric: weights to use when computing average contrasts or slopes. These weights only affect the averaging in \verb{avg_*()} or with the \code{by} argument, and not the unit-level estimates themselves. Internally, estimates and weights are passed to the \code{weighted.mean()} function. +\itemize{ +\item string: column name of the weights variable in \code{newdata}. When supplying a column name to \code{wts}, it is recommended to supply the original data (including the weights variable) explicitly to \code{newdata}. +\item numeric: vector of length equal to the number of rows in the original data or in \code{newdata} (if supplied). +}} } \value{ A warning, an error, or nothing diff -Nru r-cran-marginaleffects-0.17.0/man/slopes.Rd r-cran-marginaleffects-0.18.0/man/slopes.Rd --- r-cran-marginaleffects-0.17.0/man/slopes.Rd 2023-12-08 15:34:54.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/man/slopes.Rd 2024-01-24 03:02:07.000000000 +0000 @@ -173,7 +173,7 @@ \code{marginaleffects} website). Available arguments can vary from model to model, depending on the range of supported arguments by each modeling package. See the "Model-Specific Arguments" section of the -\code{?marginaleffects} documentation for a non-exhaustive list of available +\code{?slopes} documentation for a non-exhaustive list of available arguments.} } \value{ @@ -336,14 +336,12 @@ Some of the most common \code{type} values are: -response, link, E, Ep, average, class, conditional, count, cum.prob, cumprob, density, disp, ev, expected, expvalue, fitted, invlink(link), latent, linear.predictor, linpred, location, lp, mean, numeric, p, ppd, pr, precision, prediction, prob, probability, probs, quantile, risk, scale, survival, unconditional, utility, variance, xb, zero, zlink, zprob +response, link, E, Ep, average, class, conditional, count, cum.prob, cumprob, density, detection, disp, ev, expected, expvalue, fitted, invlink(link), latent, latent_N, linear.predictor, linpred, location, lp, mean, numeric, p, ppd, pr, precision, prediction, prob, probability, probs, quantile, risk, scale, survival, unconditional, utility, variance, xb, zero, zlink, zprob } \examples{ -\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (interactive() || isTRUE(Sys.getenv("R_DOC_BUILD") == "true")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} \dontshow{\}) # examplesIf} -\dontrun{ - # Unit-level (conditional) Marginal Effects mod <- glm(am ~ hp * wt, data = mtcars, family = binomial) mfx <- slopes(mod) @@ -412,7 +410,6 @@ hypothesis = lc) } -} \references{ \itemize{ \item Greenland S. 2019. "Valid P-Values Behave Exactly as They Should: Some Misleading Criticisms of P-Values and Their Resolution With S-Values." The American Statistician. 73(S1): 106–114. diff -Nru r-cran-marginaleffects-0.17.0/tests/tinytest.R r-cran-marginaleffects-0.18.0/tests/tinytest.R --- r-cran-marginaleffects-0.17.0/tests/tinytest.R 2023-09-27 13:52:23.000000000 +0000 +++ r-cran-marginaleffects-0.18.0/tests/tinytest.R 2024-02-05 01:34:54.000000000 +0000 @@ -1,5 +1,7 @@ if (requireNamespace("tinytest", quietly = TRUE) && isTRUE(Sys.getenv("R_NOT_CRAN") == "true") && - isTRUE(Sys.info()["sysname"] != "Windows")) { + isTRUE(Sys.info()["sysname"] != "Windows") && + # do not run test when checking package because .Rbuildignore excludes the modelarchive directory + dir.exists("inst/tinytest/modelarchive")) { tinytest::test_package("marginaleffects") }