knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of piercer is to provide a set of functions and files written for use in my personal research and statistical collaboration and consulting work. Packaging them is a learning experience, a way to shorten my other scripts, and a way to increase quality, reproducibility, and efficiency.
This package is not yet available from CRAN. Releasing it there is a long-term goal. Meanwhile, the development version of piercer can be installed from the source stored in a public GitHub repository using the devtools package. Precompiled binary installer files are not available at this time, so installing from the source code is the only option.
Before installing piercer, make sure you have:
If you only need piercer because a script you want to run loads the package and uses one of its functions, then type the following code in the R console to install the package to your package library. You will need internet access for this to work.
devtools::install_github("sjpierce/piercer")
That should enable you to use the functions built into the package. Depending on how your computer and R installation are configured, that may either install R to the main R package library, or to a personal package library. If you do not have write permissions to the main R package library, then R will ask if you want to use a personal package library instead.
One thing I have been contemplating recently is how to implement some of the American Statistical Association's recent recommendations on moving away from interpreting p-values in terms of statistical significance (Wasserstein, Schirm, & Lazar, 2019). I found the suggestions to convert p-values into s-values (Greenland, 2019), Bayes Factor Bounds (BFBs; Benjamin & Berger, 2019), and posterior probabilities that H1 is true (Benjamin & Berger, 2019) interesting, so I wrote some functions to do those conversions.
The example below shows how to apply my convertp function. I use one of the examples for the base R ttest function to demonstrate it.
library(piercer) tresult <- t.test(1:10, y = c(7:20)) tresult # Convert p-value into s-value, BFB, & posterior probability that H1 is true. convertp(p = tresult$p.value, digits = 3)
Benjamin, D. J., & Berger, J. O. (2019). Three recommendations for improving the use of p-values. The American Statistician, 73(Supplement 1), 186-191. doi:10.1080/00031305.2018.1543135
Bryan, J., & Hester, J. (n.d.). What they forgot to teach you about R. https://rstats.wtf
Greenland, S. (2019). Valid p-values behave exactly as they should: Some misleading criticisms of p-values and their resolution with s-values. The American Statistician, 73(Supplement 1), 106-114. doi:10.1080/00031305.2018.1529625
Wasserstein, R. L., Schirm, A. L., & Lazar, N. A. (2019). Moving to a world beyond "p < .05". The American Statistician, 73(Supplement 1), 1-19. doi:10.1080/00031305.2019.1583913
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.