Learn R Programming

Gmisc (version 3.0.3)

getPvalWilcox: 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)

Value

numeric Returns the p-value from that particular test

Arguments

x

The main variable of interest

by

The variable for the stratification

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

Run this code
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)
)

Run the code above in your browser using DataLab