Learn R Programming

easynem (version 1.0.3)

WilcoxTest2: Perform wilcoxon-test on easynem meta-table by treatment (two-factor)

Description

The WilcoxTest2() is used to perform wilcoxon-test for grouped data and create compare2-class. This function is only applicable to two-factor analysis, see WilcoxTest for a single factor version of the function.

Usage

WilcoxTest2(data, .group1, .group2, y, ...)

Value

An compare2-class object.

Arguments

data

An easynem-class data.

.group1

Grouping variables factor 1 (supports only two groups).

.group2

Grouping variables factor 2 (supports only two groups).

y

Dependent variable (numeric data).

...

Other parameters for wilcox.test.

Details

Note: The wilcoxon-test is only applicable to comparisons between two groups of data. To facilitate code interpretation, It is recommended to use this function in conjunction with the calc_compare function:

nem_compare <- nem |> calc_compare2(.group1 = con_crop, .group2 = season, y = pH, method = WilcoxTest2)

See Also

Other functions related to differential analysis methods: TTest2, TTest, WilcoxTest, KruskalTest, KruskalTest2, LSD, LSD2, HSD, HSD2.

Examples

Run this code
nem <- read_nem(tab = easynem_example("nemtab1.csv"),
                tax = easynem_example("nemtax1.csv"),
                meta = easynem_example("nemmeta1.csv"))
nem_test <- nem |>
              filter_name(meta, con_crop %in% c("Y2", "Y11")) |>
              calc_compare2(.group1 = con_crop, .group2 = season, y = pH, method = WilcoxTest2)
nem_test

Run the code above in your browser using DataLab