Learn R Programming

utile.tools (version 0.2.8)

test_hypothesis: Test the null hypothesis

Description

Produces a p-value from parametric or non-parametric testing of the null hypothesis for stratified data.

Usage

test_hypothesis(x, y, parametric, digits, p.digits)

Value

A character formatted p-value.

Arguments

x

A numeric or factor. Observations.

y

A factor or logical. Categorical variable to stratify by.

parametric

A logical. Indicates parametric testing should be used. See note detailing statistical tests. Defaults to FALSE.

digits

An integer. Number of digits to round to. Defaults to 1.

p.digits

An integer. Number of p-value digits to print. Note that p-values are still rounded using 'digits'. Defaults to 4.

Examples

Run this code
# Numeric data
test_hypothesis(mtcars$mpg, as.factor(mtcars$gear))

# Logical data
test_hypothesis(as.logical(mtcars$vs), as.factor(mtcars$gear))

# Factor data
test_hypothesis(as.factor(mtcars$carb), as.factor(mtcars$gear))

Run the code above in your browser using DataLab