wilcoxtestfordf: Wilcoxon Test for Two Groups in a DataFrame

View source: R/wilcoxtestfordf.R

wilcoxtestfordfR Documentation

Wilcoxon Test for Two Groups in a DataFrame

Description

Performs a Wilcoxon test on two groups within a dataframe based on a grouping variable and returns the p-value.

Usage

wilcoxtestfordf(
  dataframe,
  groupvar1,
  groupvar2,
  groupname_var,
  value_var,
  alternative_var,
  round_var = 2,
  sciformat_var = FALSE
)

Arguments

dataframe

A data frame containing the data.

groupvar1

The first group to be compared.

groupvar2

The second group to be compared.

groupname_var

The column name in dataframe that represents the grouping variable.

value_var

The column name in dataframe representing the values on which the Wilcoxon test is performed.

alternative_var

A character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less".

Value

A data frame with the p-value of the Wilcoxon test. If there's insufficient data for either group, the result will be "Insufficient data".

Examples

## Not run: 
df <- data.frame(group = c("A", "A", "B", "B"), value = c(1,2,3,4))
wilcoxtestfordf(df, "A", "B", "group", "value", "less")

## End(Not run)


chris-hsiung/bears01 documentation built on April 9, 2024, 2:01 a.m.