Skip to content

Commit

Permalink
Prepare CRAN release (#1009)
Browse files Browse the repository at this point in the history
* Prepare CRAN release

* cran comments

* docs

* test

* submitted
  • Loading branch information
strengejacke authored Sep 4, 2024
1 parent 706179b commit 9ec6d4e
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 15 deletions.
6 changes: 3 additions & 3 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 0.22.1
Date: 2024-07-21 11:02:42 UTC
SHA: 109a438b12d4893ae5b2b86aa058923798a6045a
Version: 0.22.2
Date: 2024-09-03 21:16:57 UTC
SHA: 367dcec5489ffa53d5b768af6cfaadf1afe69666
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: parameters
Title: Processing of Model Parameters
Version: 0.22.1.99
Version: 0.22.2
Authors@R:
c(person(given = "Daniel",
family = "Lüdecke",
Expand Down
7 changes: 6 additions & 1 deletion R/p_significance.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ bayestestR::p_significance
#' m <- lm(mpg ~ gear + wt + cyl + hp, data = mtcars)
#' m2 <- brm(mpg ~ gear + wt + cyl + hp, data = mtcars)
#' # probability of significance (ps) for frequentist model
#' p_significance(m, threshold = 0.6) # ROPE for mpg as outcome
#' p_significance(m)
#' # similar to ps of Bayesian models
#' p_significance(m2)
#' # similar to ps of simulated draws / bootstrap samples
Expand Down Expand Up @@ -102,6 +102,11 @@ p_significance.lm <- function(x, threshold = "default", ci = 0.95, verbose = TRU
}))
colnames(posterior) <- out$Parameter

# calculate the ROPE range
if (all(threshold == "default")) {
threshold <- bayestestR::rope_range(x, verbose = verbose)
}

out$ps <- as.numeric(bayestestR::p_significance(
posterior,
threshold = threshold,
Expand Down
2 changes: 1 addition & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Maintainance release. Furthermore, this release also fixes an issue with the _datawizard_ dependency on Mac OS X with R (old-release).
Maintainance release.
10 changes: 6 additions & 4 deletions man/p_significance.lm.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions tests/testthat/_snaps/p_significance.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
Code
print(x)
Output
Practical Significance (threshold: -0.10, 0.10)
Practical Significance (threshold: -0.60, 0.60)
Parameter | 95% CI | ps
-----------------------------------------
(Intercept) | [24.44, 48.94] | ps > .999
gear | [-1.69, 2.41] | ps = 0.600
wt | [-4.77, -1.28] | ps > .999
cyl | [-2.17, 0.55] | ps = 0.851
gear | [-1.69, 2.41] | ps = 0.408
wt | [-4.77, -1.28] | ps = 0.997
cyl | [-2.17, 0.55] | ps = 0.620
hp | [-0.05, 0.01] | ps < .001

2 changes: 1 addition & 1 deletion tests/testthat/test-p_significance.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test_that("p_significance", {

set.seed(123)
x <- p_significance(m, ci = 0.8)
expect_equal(x$ps, c(1, 0.6025, 0.9997, 0.8561, 0), tolerance = 1e-4)
expect_equal(x$ps, c(1, 0.4061, 0.9975, 0.6229, 0), tolerance = 1e-4)

set.seed(123)
x <- p_significance(m, threshold = 0.5)
Expand Down

0 comments on commit 9ec6d4e

Please sign in to comment.