Learn R Programming

CUFF (version 1.9)

pv: Format p-values

Description

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

Usage

pv(p, style = 1)

Value

returns a character vector of formatted p-value.

Arguments

p

A vector of p-values

style

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

Author

Charles-Édouard Giguère

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".

Examples

Run this code
p <- c(0.1563,0.0122,0.00001) 
pv(p)

Run the code above in your browser using DataLab