Skip to content

Commit

Permalink
Added truncated beta selection model.
Browse files Browse the repository at this point in the history
  • Loading branch information
wviechtb committed Nov 21, 2024
1 parent 02056a0 commit 646f295
Show file tree
Hide file tree
Showing 144 changed files with 293 additions and 249 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: metafor
Version: 4.7-53
Date: 2024-11-20
Version: 4.7-54
Date: 2024-11-21
Title: Meta-Analysis Package for R
Authors@R: person(given = "Wolfgang", family = "Viechtbauer", role = c("aut","cre"), email = "[email protected]", comment = c(ORCID = "0000-0003-3463-4063"))
Depends: R (>= 4.0.0), methods, Matrix, metadat, numDeriv
Expand Down
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# metafor 4.7-53 (2024-11-20)
# metafor 4.7-54 (2024-11-21)

- some general changes to the various `forest()` functions: argument `header` is now `TRUE` by default, the y-axis is now created with `yaxs="i"`, and the y-axis limits have been tweaked slightly in accordance

Expand Down Expand Up @@ -38,7 +38,7 @@

- `permutest.rma.uni()` gains a `btt` argument and `permutest.rma.ls()` gains `btt` and `att` arguments

- `selmodel()` gains a `subset` argument (to specify a subset of studies to which the selection function should apply)
- `selmodel()` gains a `subset` argument (to specify a subset of studies to which the selection function should apply); for the beta selection model, one can now also specify two `steps` values to fit a truncated beta selection model

- `nobs()` now just returns the number of estimates, not the effective number of observations

Expand Down
16 changes: 8 additions & 8 deletions R/selmodel.rma.uni.r
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ selmodel.rma.uni <- function(x, type, alternative="greater", prec, subset, delta

steps <- unique(sort(steps))

if (type != "trunc") {
if (!is.element(type, c("trunc","beta"))) {
if (steps[1] == 0)
stop(mstyle$stop("Lowest 'steps' value must be > 0."))
if (steps[length(steps)] != 1)
Expand All @@ -212,7 +212,6 @@ selmodel.rma.uni <- function(x, type, alternative="greater", prec, subset, delta
verbose <- 2
}


if (missing(subset)) {
subset <- rep(TRUE, k)
subset.spec <- FALSE
Expand Down Expand Up @@ -403,11 +402,12 @@ selmodel.rma.uni <- function(x, type, alternative="greater", prec, subset, delta

if (type == "beta") {

if (stepsspec)
warning(mstyle$warning("Argument 'steps' ignored (not applicable to this type of selection model)."), call.=FALSE)

stepsspec <- FALSE
steps <- NA_real_
if (stepsspec) {
if (length(steps) != 2L) # steps should be c(alpha1,alpha2)
stop(mstyle$stop("The 'steps' argument for this type of selection model should be of length 2."))
} else {
steps <- c(0,1)
}

if (precspec) # [b]
warning(mstyle$warning("Argument 'prec' ignored (not applicable to this type of selection model)."), call.=FALSE)
Expand All @@ -426,7 +426,7 @@ selmodel.rma.uni <- function(x, type, alternative="greater", prec, subset, delta
delta.LRT <- c(TRUE, TRUE)
pval.min <- 1e-5
wi.fun <- function(x, delta, yi, vi, preci, alternative, steps)
x^(delta[1]-1) * (1-x)^(delta[2]-1)
pmin(pmax(steps[1],x),steps[2])^(delta[1]-1) * (1-pmin(pmax(steps[1],x),steps[2]))^(delta[2]-1)
.selmodel.ll <- ".selmodel.ll.cont"

}
Expand Down
2 changes: 1 addition & 1 deletion R/zzz.r
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.onAttach <- function(libname, pkgname) {

ver <- "4.7-53"
ver <- "4.7-54"

loadmsg <- paste0("\nLoading the 'metafor' package (version ", ver, "). For an\nintroduction to the package please type: help(metafor)\n")

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metafor: A Meta-Analysis Package for R
[![R build status](https://github.com/wviechtb/metafor/workflows/R-CMD-check/badge.svg)](https://github.com/wviechtb/metafor/actions)
[![Code Coverage](https://codecov.io/gh/wviechtb/metafor/branch/master/graph/badge.svg)](https://app.codecov.io/gh/wviechtb/metafor)
[![CRAN Version](https://www.r-pkg.org/badges/version/metafor)](https://cran.r-project.org/package=metafor)
[![devel Version](https://img.shields.io/badge/devel-4.7--53-brightgreen.svg)](https://www.metafor-project.org/doku.php/installation#development_version)
[![devel Version](https://img.shields.io/badge/devel-4.7--54-brightgreen.svg)](https://www.metafor-project.org/doku.php/installation#development_version)
[![Monthly Downloads](https://cranlogs.r-pkg.org/badges/metafor)](https://cranlogs.r-pkg.org/badges/metafor)
[![Total Downloads](https://cranlogs.r-pkg.org/badges/grand-total/metafor)](https://cranlogs.r-pkg.org/badges/grand-total/metafor)

Expand Down
2 changes: 1 addition & 1 deletion docs/404.html

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

2 changes: 1 addition & 1 deletion docs/ISSUE_TEMPLATE.html

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

2 changes: 1 addition & 1 deletion docs/articles/index.html

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

2 changes: 1 addition & 1 deletion docs/articles/pkgdown/diagram.html

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

2 changes: 1 addition & 1 deletion docs/authors.html

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

4 changes: 2 additions & 2 deletions docs/index.html

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

6 changes: 3 additions & 3 deletions docs/news/index.html

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

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pkgdown: 2.1.1.9000
pkgdown_sha: 0a18bc718640aee7160a0ebbcdef5ecaae2ac4a4
articles:
pkgdown/diagram: pkgdown/diagram.html
last_built: 2024-11-19T18:22Z
last_built: 2024-11-21T16:31Z
urls:
reference: https://wviechtb.github.io/metafor/reference
article: https://wviechtb.github.io/metafor/articles
2 changes: 1 addition & 1 deletion docs/reference/addpoly.default.html

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

2 changes: 1 addition & 1 deletion docs/reference/addpoly.html

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

2 changes: 1 addition & 1 deletion docs/reference/addpoly.predict.rma.html

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

2 changes: 1 addition & 1 deletion docs/reference/addpoly.rma.html

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

Loading

0 comments on commit 646f295

Please sign in to comment.