getPval: P-value extractors for 'getDescriptionStatsBy'

getPvalWilcoxR Documentation

P-value extractors for getDescriptionStatsBy

Description

These functions are the base functions for getting the description p-values. You can provide your own functions but all functions should take two arguments and return a p-value (numeric, non-formatted)

Usage

getPvalWilcox(x, by)

getPvalAnova(x, by)

getPvalFisher(x, by)

getPvalChiSq(x, by)

getPvalKruskal(x, by)

Arguments

x

The main variable of interest

by

The variable for the stratification

Value

numeric Returns the p-value from that particular test

getPvalWilcox

Performs a two-sample two-sided Wilcoxon test (also known as the Mann-Whitney test), see wilcox.test.

getPvalAnova

Performs a standard Analysis of Variance model through anova(lm(x ~ by))

getPvalFisher

Performs Fisher's exact test through the fisher.test.

getPvalChiSq

Performs a standard Chi-Squares analysis through chisq.test

getPvalKruskal

Performs a Kruskal-Wallis rank sum test through kruskal.test

See Also

Other descriptive functions: describeFactors(), describeMean(), describeMedian(), describeProp(), getDescriptionStatsBy()

Examples

set.seed(123)
getPvalFisher(
  sample(letters[1:3], size = 100, replace = TRUE),
  sample(LETTERS[1:3], size = 100, replace = TRUE)
)
getPvalWilcox(
  rnorm(100),
  sample(LETTERS[1:2], size = 100, replace = TRUE)
)

Gmisc documentation built on Aug. 26, 2023, 1:07 a.m.