empirical_pvalue: Calculates an empirical p-value based on the data

View source: R/utils.R

empirical_pvalueR Documentation

Calculates an empirical p-value based on the data

Description

This function takes a vector of statistics and calculates the empirical p-value, that is, how many fall on the other side of zero. It calculates a two-tailed p-value.

Usage

empirical_pvalue(x, na.rm = TRUE)

Arguments

x

a data vector to operate on

na.rm

Logical whether to remove NA values. Defaults to TRUE

Value

a named vector with the number of values falling at or below zero, above zero, and the empirical p-value.

Author(s)

Joshua F. Wiley <josh@elkhartgroup.com>

Examples


empirical_pvalue(rnorm(100))

JWiley/JWileymisc documentation built on Feb. 15, 2024, 12:23 p.m.