Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

pv

Format p-values


Description

This is a function that format p-values for publication.

Usage

pv(p, style = 1)

Arguments

p

A vector of p-values

style

By default (1), formatting according to APA style guide version 6

Details

  • (1) APA: 2 digits of significance except if p is <0.05. If p < 0.05 we use 3 digits of significance except if p < 0.001 when we print "<0.001".

  • (2) Other: 4 digits of significance except if p < 0.0001 when we print "<0.0001".

Value

returns a character vector of formatted p-value.

Author(s)

Charles-Édouard Giguère

Examples

p <- c(0.1563,0.0122,0.00001) 
pv(p)

CUFF

Charles's Utility Function using Formula

v1.7
GPL (>= 2)
Authors
Charles-Édouard Giguère
Initial release
2020-09-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.