pv: Format p-values

View source: R/pv.R

pvR Documentation

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 documentation built on March 31, 2023, 6:46 p.m.

Related to pv in CUFF...