one_sample_test_by_col: Perform one sample test by column

Description Usage Arguments Details Examples

View source: R/lipidome_comparison_hypothesis_testing.R

Description

'p_values_by_column' takes a data frame and a grouping vector and returns a data frame with the p-values of a given method.

Usage

1
2
3
4
5
6
7
one_sample_test_by_col(
  input_df,
  group_vector,
  alternative = "two.sided",
  method = t.test,
  confidence_level = 0.95
)

Arguments

input_df

data frame. Contains at least one numeric variable.

group_vector

vector. Vector containing the groups to be compared. group_vector = input_df$group (or other vector of length nrow(input_df))

alternative

string. Specifies the alternative hypothesis. c("two.sided" (default), "greater", "less")

method

function. Options: t.test (default), wilcox.test

confidence_level

numeric. Confidence level of the interval. Default = 0.95

Details

This function takes a data frame ans a grouping vector and performs a given hypothesis test on all numeric variables. The results are returned in a new data frame.

Examples

1
2
3
my_iris <- subset(x = iris, Species == "setosa" | Species == "versicolor")
one_sample_test_by_col(my_iris, my_iris$Species)
one_sample_test_by_col(my_iris, my_iris$Species, method = wilcox.test)

lisaschneider0509/lipidomeComparisonR documentation built on Aug. 12, 2020, 12:52 a.m.