zcurve

zcurve R package for assessing the reliability and trustworthiness of published literature with the z-curve method

https://github.com/fbartos/zcurve

Science Score: 39.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 8 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.6%) to scientific vocabulary

Keywords

edr err replicability z-cruve
Last synced: 6 months ago · JSON representation

Repository

zcurve R package for assessing the reliability and trustworthiness of published literature with the z-curve method

Basic Info
Statistics
  • Stars: 13
  • Watchers: 3
  • Forks: 2
  • Open Issues: 0
  • Releases: 13
Topics
edr err replicability z-cruve
Created over 6 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# zcurve


[![R-CRAN-check](https://github.com/FBartos/zcurve/workflows/R-CMD-check/badge.svg)](https://github.com/FBartos/zcurve/actions)
[![R-tests](https://github.com/FBartos/zcurve/workflows/R-CMD-tests/badge.svg)](https://github.com/FBartos/zcurve/actions)
[![CRAN status](https://www.r-pkg.org/badges/version/zcurve)](https://CRAN.R-project.org/package=zcurve)


This package implements z-curves - methods for estimating expected discovery 
and replicability rates on bases of test-statistics of published studies. The package 
provides functions for fitting the censored EM version (Schimmack & Bartoš, 2023), 
the EM version (Bartoš & Schimmack, 2022) as well as the original density z-curve (Brunner & Schimmack, 2020). 
Furthermore, the package provides summarizing and plotting functions for the 
fitted z-curve objects. See the aforementioned articles for more information about 
z-curve, expected discovery rate (EDR), expected replicability rate (ERR), 
maximum false discovery rate (FDR), as well as validation studies, and limitations.

## Installation

You can install the current version of zcurve from CRAN with:

``` r
install.packages("zcurve")
```

or the development version from [GitHub](https://github.com/) with:

``` r
# install.packages("devtools")
devtools::install_github("FBartos/zcurve")
```

## Example

Z-curve can be used to estimate expected replicability rate (ERR), expected discovery rate (EDR), and 
maximum false discovery rate (Soric FDR) using z-scores from a set of significant findings. 
This is a reproduction of an example in Bartoš and Schimmack 
(2022) where the z-curve is used to estimate ERR and EDR on a subset of studies used in 
reproducibility project (OSC, 2015). Only studies with non-ambiguous original outcomes are used 
- excluding studies with "marginally significant" original findings, leading to 90 studies. Out of these
90 studies, 35 were successfully replicated.

We included the recoded z-scores from the 90 OSC studies as a dataset in the package ('OSC.z'). The 
expectation-maximization (EM) version of the z-curve is implemented as the default method and can be
fitted (with 1000 bootstraps) and summarized using 'zcurve and 'summary' functions.

The first argument to the function call is a vector of z-scores. Alternatively, a vector of two-sided 
p-values can be also used, by specifying "zcurve(p = p.values)".

```{r}
set.seed(666)
library(zcurve)

fit <- zcurve(OSC.z)

summary(fit)
```

More details from the fitted object can be extracted from the fitted object. For more statistics, as 
expected number of conducted studies, the file drawer ratio or Sorić's FDR specify 'all = TRUE' (see Schimmack & Bartoš, 2023) .

```{r}
summary(fit, all = TRUE)
```

For more information regarding the fitted model weights add 'type = "parameters"'.

```{r}
summary(fit, type = "parameters")
```

The package also provides a convenient plotting method for the z-curve fits. 

```{r}
plot(fit)
```

The default plot can be further modified by using classic R plotting arguments as 'xlab', 'ylab',
'main', 'cex.axis', 'cex.lab'. Furthermore, an annotation with the main test statistics can be 
added to the plot by specifying 'annotation = TRUE' and the pointwise confidence intervals of the
plot by specifying "CI = TRUE". For more options regarding the annotation see '?plot.zcurve". 

```{r}
plot(fit, CI = TRUE, annotation = TRUE, main = "OSC 2015")
```

Other versions of the z-curves may be fitted by changing the method argument in the 'zcurve' function.
Set 'method = "density"' to fit the new version of z-curve using density method (KD2). The original 
version of the density method as implemented in Brunner and Schimmack (2020) can be fitted by adding
'list(model = "KD1")' to the 'control' argument of 'zcurve'.

(We omit bootstrapping to speed the fitting process in this case)

```{r}
fit.KD2 <- zcurve(OSC.z, method = "density", bootstrap = FALSE)
fit.KD1 <- zcurve(OSC.z, method = "density", control = list(model = "KD1"), bootstrap = FALSE)

summary(fit.KD2)

summary(fit.KD1)
```

The 'control' argument can be used to change the number of iterations or reducing the convergence 
criterion in cases of non-convergence. It can be also used for constructing custom z-curves by 
changing the location of the mean components, their number or many other settings. However, it is 
important to bear in mind that those custom models need to be validated first on simulation studies 
prior to their usage. For more information about the control settings see '?control_EM', '?control_density', 
and '?control_density_v1'.

If you encounter any problems or bugs, please, contact me at f.bartos96[at]gmail.com or submit an issue at
https://github.com/FBartos/zcurve/issues. If you like the package and use it in your work, please, cite it
as:
```{r}
citation(package = "zcurve")
```


## Sources
Schimmack, U., & Bartoš, F. (2023). Estimating the false discovery risk of (randomized) clinical trials in medical journals based on published p-values. _PLoS ONE, 18_(8), e0290084. https://doi.org/10.1371/journal.pone.0290084

Bartoš, F., & Schimmack, U. (2022). Z-curve 2.0: Estimating replication rates and discovery rates. _Meta-Psychology_, 6. https://doi.org/10.15626/MP.2021.2720

Brunner, J., & Schimmack, U. (2020). Estimating population mean power under conditions of heterogeneity and selection for significance. _Meta-Psychology_, 4. https://doi.org/10.15626/MP.2018.874

Open Science Collaboration. (2015). Estimating the reproducibility of psychological science. _Science, 349_(6251), aac4716. https://doi.org/10.1126/science.aac4716

Owner

  • Name: František Bartoš
  • Login: FBartos
  • Kind: user

A (Psych Methods) PhD Candidate at the University of Amsterdam. I’m interested in meta-analyses, publication bias, replicability, and Bayesian inference.

GitHub Events

Total
  • Create event: 7
  • Release event: 3
  • Issues event: 2
  • Watch event: 1
  • Delete event: 3
  • Issue comment event: 1
  • Push event: 9
  • Pull request event: 7
  • Fork event: 2
Last Year
  • Create event: 7
  • Release event: 3
  • Issues event: 2
  • Watch event: 1
  • Delete event: 3
  • Issue comment event: 1
  • Push event: 9
  • Pull request event: 7
  • Fork event: 2

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 31
  • Total Committers: 3
  • Avg Commits per committer: 10.333
  • Development Distribution Score (DDS): 0.323
Past Year
  • Commits: 2
  • Committers: 1
  • Avg Commits per committer: 2.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
FBartos 3****s@u****m 21
Frantisek Bartos f****6@g****m 9
DominikVogel p****t@v****o 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 14
  • Total pull requests: 19
  • Average time to close issues: 6 months
  • Average time to close pull requests: 27 days
  • Total issue authors: 9
  • Total pull request authors: 4
  • Average comments per issue: 2.36
  • Average comments per pull request: 0.16
  • Merged pull requests: 18
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 6
  • Average time to close issues: N/A
  • Average time to close pull requests: about 10 hours
  • Issue authors: 0
  • Pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 5
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • Yefeng0920 (4)
  • limegreen (2)
  • LukasWallrich (2)
  • Prodiona (1)
  • DominikVogel (1)
  • socialresearchist (1)
  • peclayson (1)
  • cbh2132 (1)
  • Lakens (1)
Pull Request Authors
  • FBartos (15)
  • olivroy (2)
  • richarddmorey (1)
  • DominikVogel (1)
Top Labels
Issue Labels
enhancement (2) question (2) bug (1) documentation (1)
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • cran 611 last-month
  • Total docker downloads: 20,358
  • Total dependent packages: 1
    (may contain duplicates)
  • Total dependent repositories: 2
    (may contain duplicates)
  • Total versions: 15
  • Total maintainers: 1
cran.r-project.org: zcurve

An Implementation of Z-Curves

  • Versions: 14
  • Dependent Packages: 1
  • Dependent Repositories: 2
  • Downloads: 611 Last month
  • Docker Downloads: 20,358
Rankings
Docker downloads count: 12.5%
Dependent packages count: 18.1%
Stargazers count: 18.3%
Dependent repos count: 19.2%
Average: 19.8%
Downloads: 22.7%
Forks count: 27.8%
Maintainers (1)
Last synced: 6 months ago
conda-forge.org: r-zcurve
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 34.0%
Average: 49.9%
Dependent packages count: 51.2%
Stargazers count: 53.5%
Forks count: 61.1%
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • Rcpp >= 1.0.2 imports
  • Rdpack * imports
  • evmix * imports
  • graphics * imports
  • nleqslv * imports
  • stats * imports
  • spelling * suggests
  • testthat * suggests
  • vdiffr * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/upload-artifact main composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
.github/workflows/R-CMD-tests.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
.github/workflows/pkgdown.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v4 composite
  • actions/upload-artifact v4 composite
  • codecov/codecov-action v4 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite