wilcoxFunc: Format for printing p-value from wilcoxon rank sum test

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/wilcoxFunc.R

Description

Meant to be used in creating R matrix to be exported as a table

Usage

1
wilcoxFunc(data, nvar, gvar)

Arguments

data

Data frame where nvar and gvar can be found

nvar

Character string of column in data of numeric data

gvar

Character string of column in data of grouping data

Details

If the p-value is less than 0.0005 then '< 0.001' is returned otherwise p-value rounded to 3 decimals is returned

Value

Returns a string of the p-value from a wilcoxon rank sum test or kruskal wallis test if gvar has more than 2 levels

Author(s)

University of Wisconsin-Madison Biostatistics and Medical Informatics Department, Scott Hetzel M.S.

See Also

medianFunc

Examples

1
2
3
4
5
outcome <- rnorm(20)
group <- factor(rep(c("A", "B"), each = 10))
d.frame <- data.frame(outcome, group)

wilcoxFunc(d.frame, "outcome", "group")

jbirstler/biostatrpts documentation built on May 7, 2020, 12:10 a.m.