From b6386c8ccc1104fef63c1c8de5d04461b26e22b7 Mon Sep 17 00:00:00 2001 From: Vincent Arel-Bundock Date: Wed, 8 May 2024 06:18:50 -0400 Subject: [PATCH 1/7] marginaleffects 0.20.1: minor change in labels --- R/methods_marginaleffects.R | 3 +++ tests/testthat/test-marginaleffects.R | 6 ++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/R/methods_marginaleffects.R b/R/methods_marginaleffects.R index 87a6eae3f..803970fa1 100644 --- a/R/methods_marginaleffects.R +++ b/R/methods_marginaleffects.R @@ -23,6 +23,9 @@ model_parameters.marginaleffects <- function(model, attr(out, "object_name") <- insight::safe_deparse_symbol(substitute(model)) + # do not print or report these columns + out <- out[, !colnames(out) %in% c("predicted_lo", "predicted_hi"), drop = FALSE] + if (inherits(model, "marginalmeans")) { attr(out, "coefficient_name") <- "Marginal Means" } else if (inherits(model, "comparisons")) { diff --git a/tests/testthat/test-marginaleffects.R b/tests/testthat/test-marginaleffects.R index 22853e264..6e7184485 100644 --- a/tests/testthat/test-marginaleffects.R +++ b/tests/testthat/test-marginaleffects.R @@ -8,10 +8,8 @@ test_that("marginaleffects()", { model <- marginaleffects::avg_slopes(x, newdata = insight::get_datagrid(x, at = "Species"), variables = "Petal.Length") out <- parameters(model) expect_identical(nrow(out), 1L) - expect_named(out, c( - "Parameter", "Coefficient", "SE", "Statistic", - "p", "S", "CI", "CI_low", "CI_high" - )) + cols <- c("Parameter", "Comparison", "Coefficient", "SE", "Statistic", "p", "S", "CI", "CI_low", "CI_high") + expect_true(all(cols %in% colnames(out))) out <- model_parameters(model, exponentiate = TRUE) expect_equal(out$Coefficient, 1.394, tolerance = 1e-3) From eec1cd763911d7bf4170deae4e30b485058bed2a Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 12 May 2024 22:58:37 +0200 Subject: [PATCH 2/7] trigger CI --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0b8d8ccf0..2ab5124f9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: parameters Title: Processing of Model Parameters -Version: 0.21.6.6 +Version: 0.21.6.7 Authors@R: c(person(given = "Daniel", family = "Lüdecke", From cdf896fbf11cd7637eca405f77a01fef05c99d68 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 13 May 2024 08:36:23 +0200 Subject: [PATCH 3/7] update test --- DESCRIPTION | 1 - tests/testthat/test-model_parameters.coxme.R | 28 +++++++++++--------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 2ab5124f9..6bde69d41 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -218,4 +218,3 @@ Config/Needs/website: r-lib/pkgdown, easystats/easystatstemplate Config/rcmdcheck/ignore-inconsequential-notes: true -Remotes: easystats/insight diff --git a/tests/testthat/test-model_parameters.coxme.R b/tests/testthat/test-model_parameters.coxme.R index 6c2f1000b..142129701 100644 --- a/tests/testthat/test-model_parameters.coxme.R +++ b/tests/testthat/test-model_parameters.coxme.R @@ -1,18 +1,22 @@ skip_on_cran() skip_if_not_installed("coxme") skip_if_not_installed("survival") +skip_if_not_installed("withr") # modelparameters ---------------------------------- -test_that("model_parameters.coxme", { - data(eortc, package = "coxme") - d <- coxme::eortc - d$surv <- survival::Surv(d$y, d$uncens) - m1 <- coxme::coxme(surv ~ trt + (1 | center), data = d) - out <- model_parameters(m1) - expect_named( - out, - c("Parameter", "Coefficient", "SE", "CI", "CI_low", "CI_high", "z", "df_error", "p") - ) - expect_equal(out$Coefficient, 0.7086127, tolerance = 1e-4) -}) +withr::with_environment( + new.env(), + test_that("model_parameters.coxme", { + data(eortc, package = "coxme") + d <- coxme::eortc + d$surv <- survival::Surv(d$y, d$uncens) + m1 <- coxme::coxme(surv ~ trt + (1 | center), data = d) + out <- model_parameters(m1) + expect_named( + out, + c("Parameter", "Coefficient", "SE", "CI", "CI_low", "CI_high", "z", "df_error", "p") + ) + expect_equal(out$Coefficient, 0.7086127, tolerance = 1e-4) + }) +) From 2aabd48d15219ebbc500f759035e73318e1d3cf1 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 13 May 2024 08:37:01 +0200 Subject: [PATCH 4/7] bump required version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 6bde69d41..ef780a305 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -151,7 +151,7 @@ Suggests: logspline, lqmm, M3C, - marginaleffects (>= 0.16.0), + marginaleffects (>= 0.20.1), MASS, Matrix, mclogit, From ce81a27f1c4114e7290c10020e4e3bd136a19c23 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 13 May 2024 19:29:48 +0200 Subject: [PATCH 5/7] Prepare CRAN release --- DESCRIPTION | 2 +- NEWS.md | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index ef780a305..fc22b094a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: parameters Title: Processing of Model Parameters -Version: 0.21.6.7 +Version: 0.21.7 Authors@R: c(person(given = "Daniel", family = "Lüdecke", diff --git a/NEWS.md b/NEWS.md index 0cbf77db6..35dfb457c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # parameters 0.21.7 +## Changes + +* Fixed issues related to latest release from _marginaleffects_. + ## Bug fixes * Fixes issue in `compare_parameters()` for models from package *blme*. From 3198c2e40dc549809671836f7fa44968840fa851 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 13 May 2024 19:30:27 +0200 Subject: [PATCH 6/7] cran comments --- cran-comments.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cran-comments.md b/cran-comments.md index f15e10657..88b6f9530 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1 +1 @@ -This release addresses errors in CRAN checks related to the last *insight* update. +This release addresses errors in CRAN checks related to the last *marginaleffects* update. From 688e31286ed673a3e8885ff4ea7fea198e15c4e0 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 13 May 2024 19:50:49 +0200 Subject: [PATCH 7/7] submitted --- CRAN-SUBMISSION | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CRAN-SUBMISSION b/CRAN-SUBMISSION index 6e4648664..ff774c869 100644 --- a/CRAN-SUBMISSION +++ b/CRAN-SUBMISSION @@ -1,3 +1,3 @@ -Version: 0.21.6 -Date: 2024-03-17 15:06:23 UTC -SHA: fa0a2223f09a2b641762866e202cd54ddc65b3b3 +Version: 0.21.7 +Date: 2024-05-13 17:50:43 UTC +SHA: 5c707ee00026cae0f4439eb8514e2537275344cc