hypothesis_test: Performs Mann-Witney U test on each group vs. control, each...

Description Usage Arguments Details Value

View source: R/hypothesis_test.R

Description

hypothesis_test performs Mann-Witney U test, using wilcox.test for each OTU in the data frame d. Each level of group, excluding the base_group level, is tested against the base_group level at an alpha level of 0.05 for evidence against the null hypothesis that distributions of the the normalized counts for base_group and the tested group do not differ by a location shift. The alternative is two-sided.

Usage

1
2
hypothesis_test(d, group, otuname_col = "bug", value_col = "value",
  base_group = "Control", alpha = 0.05)

Arguments

d

Data frame of data.

group

Name of data frame column containing the group information.

otuname_col

Name of data frame column containing OTU names.

value_col

Name of column containing normalized proportions for each of the otunames.

base_group

Name of the level in group indicating baseline measurements.

alpha

alpha level to conduct the Mann-Witney U test.

Details

The data frame d is assumed to be in long format.

Value

the same input data frame d, but with a new column called "changed". This column is a factor with three levels: "no change" if the hypothesis test was not significant, and either "decreased" or "increased" if the test was significant. The sign of the change is calculated by the difference in means for data from the tested group and data from the base_group.


sagun98/mpuri documentation built on Dec. 23, 2019, 6:32 p.m.