Skip to content

Commit 40dc7fd

Browse files
authored
Merge branch 'main' into support_coxme_ranef
2 parents 246412e + 4c01573 commit 40dc7fd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1353
-495
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
^vignettes/p.
2121
^vignettes/s.
2222
^tests/_snaps/.
23+
^tests/testthat/_snaps/.
2324
^cran-comments\.md$
2425
^revdep$
2526
^CODE_OF_CONDUCT\.md$

DESCRIPTION

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Type: Package
22
Package: parameters
33
Title: Processing of Model Parameters
4-
Version: 0.24.2.15
4+
Version: 0.26.0.2
55
Authors@R:
66
c(person(given = "Daniel",
77
family = "Lüdecke",
88
role = c("aut", "cre"),
9-
email = "[email protected]",
9+
email = "[email protected]",
1010
comment = c(ORCID = "0000-0002-8895-3206")),
1111
person(given = "Dominique",
1212
family = "Makowski",
@@ -78,9 +78,9 @@ BugReports: https://github.com/easystats/parameters/issues
7878
Depends:
7979
R (>= 3.6)
8080
Imports:
81-
bayestestR (>= 0.15.2),
82-
datawizard (>= 1.0.2),
83-
insight (>= 1.1.0),
81+
bayestestR (>= 0.16.0),
82+
datawizard (>= 1.1.0),
83+
insight (>= 1.3.0),
8484
graphics,
8585
methods,
8686
stats,
@@ -112,6 +112,7 @@ Suggests:
112112
coda,
113113
coxme,
114114
cplm,
115+
curl,
115116
dbscan,
116117
did,
117118
distributional,
@@ -155,7 +156,7 @@ Suggests:
155156
logspline,
156157
lqmm,
157158
M3C,
158-
marginaleffects (>= 0.25.0),
159+
marginaleffects (>= 0.26.0),
159160
modelbased (>= 0.9.0),
160161
MASS,
161162
Matrix,
@@ -182,7 +183,7 @@ Suggests:
182183
panelr,
183184
pbkrtest,
184185
PCDimension,
185-
performance (>= 0.12.0),
186+
performance (>= 0.14.0),
186187
plm,
187188
PMCMRplus,
188189
poorman,
@@ -224,5 +225,6 @@ Roxygen: list(markdown = TRUE)
224225
Config/testthat/edition: 3
225226
Config/testthat/parallel: true
226227
Config/Needs/website: easystats/easystatstemplate
228+
Config/Needs/check: stan-dev/cmdstanr
227229
Config/rcmdcheck/ignore-inconsequential-notes: true
228230
Remotes: easystats/insight, easystats/bayestestR

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ S3method(model_parameters,pairwise.htest)
310310
S3method(model_parameters,pam)
311311
S3method(model_parameters,parameters_efa)
312312
S3method(model_parameters,parameters_pca)
313+
S3method(model_parameters,pb2)
313314
S3method(model_parameters,pgmm)
314315
S3method(model_parameters,poissonirr)
315316
S3method(model_parameters,poissonmfx)

NEWS.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
1-
# parameters (devel)
1+
# parameters 0.26.0
2+
3+
## Changes
4+
5+
* The `effects` argument in `model_parameters()` for classes `merMod`, `glmmTMB`,
6+
`brmsfit` and `stanreg` gets an additional `"grouplevel"` option, to return
7+
the group-level estimates for random effects.
8+
9+
* `model_parameters()` for Anova-objects gains a `p_adjust` argument, to apply
10+
p-adjustment where possible. Furthermore, for models from package *afex*, where
11+
p-adjustment was applied during model-fitting, the correct p-values are now
12+
returned (before, unadjusted p-values were returned in some cases).
13+
14+
* Revised code-base to address changes in latest *insight* update. Dealing with
15+
larger models (many parameters, many posterior samples) from packages *brms*
16+
and *rstanarm* is more efficient now. Furthermore, the options for the
17+
`effects` argument have a new behaviour. `"all"` only returns fixed effects
18+
and random effects variance components, but no longer the group level
19+
estimates. Use `effects = "full"` to return all parameters. This change is
20+
mainly to be more flexible and gain more efficiency for models with many
21+
parameters and / or many posterior draws.
22+
23+
* `model_parameters()` for Anova objects gains an `include_intercept` argument,
24+
to include intercepts in the Anova table, where possible.
25+
26+
# parameters 0.25.0
227

328
## Changes
429

@@ -9,11 +34,18 @@
934
* `model_parameters()` now shows a more informative coefficient name for binomial
1035
models with probit-link.
1136

37+
* Argument `wb_component` now defaults to `FALSE`.
38+
39+
* Improved support and printing for tests from package *WRS2*.
40+
1241
## Bug fixes
1342

1443
* Fixed printing issue with `model_parameters()` for `htest` objects when
1544
printing into markdown or HTML format.
1645

46+
* Fixed printing issue with `model_parameters()` for mixed models when
47+
`include_reference = TRUE`.
48+
1749
# parameters 0.24.2
1850

1951
## Changes

R/1_model_parameters.R

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
#'
130130
#' - **pseudo** (*for 2-level (G)LMMs only*): In this (post-hoc) method, the
131131
#' response and the predictor are standardized based on the level of prediction
132-
#' (levels are detected with [performance::check_heterogeneity_bias()]): Predictors
132+
#' (levels are detected with [performance::check_group_variation()]): Predictors
133133
#' are standardized based on their SD at level of prediction (see also
134134
#' [datawizard::demean()]); The outcome (in linear LMMs) is standardized based
135135
#' on a fitted random-intercept-model, where `sqrt(random-intercept-variance)`
@@ -438,14 +438,17 @@ parameters <- model_parameters
438438
#' `"pseudo"`. See 'Details' in [`standardize_parameters()`].
439439
#' **Importantly**:
440440
#' - The `"refit"` method does *not* standardize categorical predictors (i.e.
441-
#' factors), which may be a different behaviour compared to other R packages
442-
#' (such as **lm.beta**) or other software packages (like SPSS). to mimic
443-
#' such behaviours, either use `standardize="basic"` or standardize the data
444-
#' with `datawizard::standardize(force=TRUE)` *before* fitting the model.
441+
#' factors), which may be a different behaviour compared to other R packages
442+
#' (such as **lm.beta**) or other software packages (like SPSS). to mimic
443+
#' such behaviours, either use `standardize="basic"` or standardize the data
444+
#' with `datawizard::standardize(force=TRUE)` *before* fitting the model.
445+
#' - By default, the response (dependent) variable is also standardized, *if
446+
#' applicable*. Set `include_response = FALSE` to avoid standardization of
447+
#' the response variable. See details in [`datawizard::standardize.default()`].
445448
#' - For mixed models, when using methods other than `"refit"`, only the fixed
446-
#' effects will be standardized.
449+
#' effects will be standardized.
447450
#' - Robust estimation (i.e., `vcov` set to a value other than `NULL`) of
448-
#' standardized parameters only works when `standardize="refit"`.
451+
#' standardized parameters only works when `standardize="refit"`.
449452
#' @param exponentiate Logical, indicating whether or not to exponentiate the
450453
#' coefficients (and related confidence intervals). This is typical for
451454
#' logistic regression, or more generally speaking, for models with log or

R/compare_parameters.R

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ compare_parameters <- function(...,
169169
dat <- model
170170
} else {
171171
# set default-ci_type for Bayesian models
172-
if (.is_bayesian_model(model, exclude = c("bmerMod", "bayesx", "blmerMod", "bglmerMod")) && !ci_method %in% c("hdi", "quantile", "ci", "eti", "si", "bci", "bcai")) { # nolint
172+
if (insight::is_bayesian_model(model, exclude = c("bmerMod", "bayesx", "blmerMod", "bglmerMod")) && !ci_method %in% c("hdi", "quantile", "ci", "eti", "si", "bci", "bcai")) { # nolint
173173
ci_method_tmp <- "eti"
174174
} else {
175175
ci_method_tmp <- ci_method
@@ -305,19 +305,3 @@ compare_models <- compare_parameters
305305
}
306306
x
307307
}
308-
309-
310-
.is_bayesian_model <- function(x, exclude = NULL) {
311-
bayes_classes <- c(
312-
"brmsfit", "stanfit", "MCMCglmm", "stanreg",
313-
"stanmvreg", "bmerMod", "BFBayesFactor", "bamlss",
314-
"bayesx", "mcmc", "bcplm", "bayesQR", "BGGM",
315-
"meta_random", "meta_fixed", "meta_bma", "blavaan",
316-
"blrm", "blmerMod"
317-
)
318-
# if exclude is not NULL, remove elements in exclude from bayes_class
319-
if (!is.null(exclude)) {
320-
bayes_classes <- bayes_classes[!bayes_classes %in% exclude]
321-
}
322-
inherits(x, bayes_classes)
323-
}

R/display.R

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ display.parameters_model <- function(object,
105105
include_reference = FALSE,
106106
verbose = TRUE,
107107
...) {
108-
if (identical(format, "html")) {
108+
format <- insight::validate_argument(format, c("markdown", "html", "md", "tt"))
109+
110+
if (format %in% c("html", "tt")) {
109111
print_html(
110112
x = object, pretty_names = pretty_names, split_components = split_components,
111113
select = select, digits = digits, caption = caption, subtitle = subtitle,
@@ -151,7 +153,9 @@ display.compare_parameters <- function(object,
151153
line_padding = 4,
152154
zap_small = FALSE,
153155
...) {
154-
if (identical(format, "html")) {
156+
format <- insight::validate_argument(format, c("markdown", "html", "md", "tt"))
157+
158+
if (format %in% c("html", "tt")) {
155159
print_html(
156160
x = object, digits = digits, ci_digits = ci_digits, p_digits = p_digits,
157161
select = select, column_labels = column_labels, font_size = font_size,

0 commit comments

Comments
 (0)