Skip to content

Commit d1c52ae

Browse files
authored
Prepare CRAN release (#1106)
* Test on latest marginaleffects * fix * fix * use latest CRAN versions * Update .Rbuildignore * docs * add option to include intercept * Test with effectsize dev * remove remotes
1 parent 39530aa commit d1c52ae

13 files changed

+82
-27
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: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: parameters
33
Title: Processing of Model Parameters
4-
Version: 0.25.0.6
4+
Version: 0.26.0
55
Authors@R:
66
c(person(given = "Daniel",
77
family = "Lüdecke",
@@ -78,9 +78,9 @@ BugReports: https://github.com/easystats/parameters/issues
7878
Depends:
7979
R (>= 3.6)
8080
Imports:
81-
bayestestR (>= 0.15.3),
81+
bayestestR (>= 0.16.0),
8282
datawizard (>= 1.0.2),
83-
insight (>= 1.2.0),
83+
insight (>= 1.3.0),
8484
graphics,
8585
methods,
8686
stats,
@@ -156,7 +156,7 @@ Suggests:
156156
logspline,
157157
lqmm,
158158
M3C,
159-
marginaleffects (>= 0.25.0),
159+
marginaleffects (>= 0.26.0),
160160
modelbased (>= 0.9.0),
161161
MASS,
162162
Matrix,
@@ -227,4 +227,3 @@ Config/testthat/parallel: true
227227
Config/Needs/website: easystats/easystatstemplate
228228
Config/Needs/check: stan-dev/cmdstanr
229229
Config/rcmdcheck/ignore-inconsequential-notes: true
230-
Remotes: easystats/insight, easystats/bayestestR

NEWS.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# parameters (devel)
1+
# parameters 0.26.0
22

33
## Changes
44

@@ -11,6 +11,18 @@
1111
p-adjustment was applied during model-fitting, the correct p-values are now
1212
returned (before, unadjusted p-values were returned in some cases).
1313

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+
1426
# parameters 0.25.0
1527

1628
## Changes

R/extract_parameters_anova.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
.extract_parameters_anova <- function(model,
33
test = "multivariate",
44
p_adjust = NULL,
5+
include_intercept = FALSE,
56
verbose = TRUE) {
67
# Processing
78
if (inherits(model, "manova")) {
@@ -24,7 +25,7 @@
2425

2526
# remove intercept
2627
intercepts <- parameters$Parameter %in% c("Intercept", "(Intercept)")
27-
if (any(intercepts)) {
28+
if (any(intercepts) && !include_intercept) {
2829
parameters <- parameters[!intercepts, ]
2930
}
3031

R/methods_aov.R

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44

55
#' Parameters from ANOVAs
66
#'
7-
#' @param model Object of class [aov()], [anova()],
8-
#' `aovlist`, `Gam`, [manova()], `Anova.mlm`,
9-
#' `afex_aov` or `maov`.
7+
#' @param model Object of class [aov()], [anova()], `aovlist`, `Gam`,
8+
#' [manova()], `Anova.mlm`, `afex_aov` or `maov`.
109
#' @param es_type The effect size of interest. Not that possibly not all
1110
#' effect sizes are applicable to the model object. See 'Details'. For Anova
1211
#' models, can also be a character vector with multiple effect size names.
@@ -29,6 +28,8 @@
2928
#' @param table_wide Logical that decides whether the ANOVA table should be in
3029
#' wide format, i.e. should the numerator and denominator degrees of freedom
3130
#' be in the same row. Default: `FALSE`.
31+
#' @param include_intercept Logical, if `TRUE`, includes the intercept
32+
#' (`(Intercept)`) in the anova table.
3233
#' @param alternative A character string specifying the alternative hypothesis;
3334
#' Controls the type of CI returned: `"two.sided"` (default, two-sided CI),
3435
#' `"greater"` or `"less"` (one-sided CI). Partial matching is allowed
@@ -108,6 +109,7 @@ model_parameters.aov <- function(model,
108109
es_type = NULL,
109110
keep = NULL,
110111
drop = NULL,
112+
include_intercept = FALSE,
111113
table_wide = FALSE,
112114
verbose = TRUE,
113115
...) {
@@ -139,7 +141,13 @@ model_parameters.aov <- function(model,
139141
}
140142

141143
# extract standard parameters
142-
params <- .extract_parameters_anova(model, test, p_adjust = p_adjust, verbose = verbose)
144+
params <- .extract_parameters_anova(
145+
model,
146+
test,
147+
p_adjust = p_adjust,
148+
include_intercept = include_intercept,
149+
verbose = verbose
150+
)
143151

144152
# add effect sizes, if available
145153
params <- .effectsizes_for_aov(
@@ -252,6 +260,7 @@ model_parameters.afex_aov <- function(model,
252260
type = NULL,
253261
keep = NULL,
254262
drop = NULL,
263+
include_intercept = FALSE,
255264
p_adjust = NULL,
256265
verbose = TRUE,
257266
...) {
@@ -260,11 +269,23 @@ model_parameters.afex_aov <- function(model,
260269
with_df_and_p <- summary(model$Anova)$univariate.tests
261270
params$`Sum Sq` <- with_df_and_p[-1, 1]
262271
params$`Error SS` <- with_df_and_p[-1, 3]
263-
out <- .extract_parameters_anova(params, test = NULL, p_adjust = NULL, verbose)
272+
out <- .extract_parameters_anova(
273+
params,
274+
test = NULL,
275+
include_intercept = include_intercept,
276+
p_adjust = NULL,
277+
verbose
278+
)
264279
p_adjust <- .extract_p_adjust_afex(model, p_adjust)
265280
} else {
266281
p_adjust <- .extract_p_adjust_afex(model, p_adjust)
267-
out <- .extract_parameters_anova(model$Anova, test = NULL, p_adjust, verbose)
282+
out <- .extract_parameters_anova(
283+
model$Anova,
284+
test = NULL,
285+
include_intercept = include_intercept,
286+
p_adjust,
287+
verbose
288+
)
268289
}
269290

270291
out <- .effectsizes_for_aov(

R/methods_brms.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
#' @param ci Credible Interval (CI) level. Default to `0.95` (`95%`). See
1313
#' [bayestestR::ci()] for further details.
1414
#' @param group_level Logical, for multilevel models (i.e. models with random
15-
#' effects) and when `effects = "all"` or `effects = "random"`, include the
16-
#' parameters for each group level from random effects. If `group_level = FALSE`
17-
#' (the default), only information on SD and COR are shown.
15+
#' effects) and when `effects = "random"`, return the parameters for each group
16+
#' level from random effects only. If `group_level = FALSE` (the default), also
17+
#' information on SD and COR are returned. Note that this argument is superseded
18+
#' by the new options for the `effects` argument. `effects = "grouplevel"` should
19+
#' be used instead of `group_level = TRUE`.
1820
#' @param component Which type of parameters to return, such as parameters for the
1921
#' conditional model, the zero-inflation part of the model, the dispersion
2022
#' term, or other auxiliary parameters be returned? Applies to models with

R/methods_glmmTMB.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
#' computed by default, for simpler models or fewer observations, confidence
4141
#' intervals will be included. Set explicitly to `TRUE` or `FALSE` to enforce
4242
#' or omit calculation of confidence intervals.
43+
#' @param group_level Logical, for multilevel models (i.e. models with random
44+
#' effects) and when `effects = "random"`, include the parameters for each
45+
#' group level from random effects. If `group_level = FALSE` (the default),
46+
#' only information on SD and COR are shown.
4347
#' @param ... Arguments passed to or from other methods. For instance, when
4448
#' `bootstrap = TRUE`, arguments like `type` or `parallel` are passed down to
4549
#' `bootstrap_model()`.

man/model_parameters.aov.Rd

Lines changed: 6 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/model_parameters.brmsfit.Rd

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/model_parameters.glmmTMB.Rd

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)