Learn R Programming

easynem (version 1.0.3)

TTest: Perform t-test on easynem meta-table by treatment (single factor)

Description

The TTest() is used to perform t-test for grouped data and create compare-class. This function is only applicable to single factor analysis, see TTest2 for a two factor version of the function.

Usage

TTest(data, .group, y, ...)

Value

An compare-class object.

Arguments

data

An easynem-class data.

.group

Grouping variables (supports only two groups).

y

Dependent variable (numeric data).

...

Other parameters for t.test.

Details

Note: The t-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_compare(.group = con_crop, y = pH, method = TTest)

See Also

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

Examples

Run this code
nem <- read_nem2(tab = nemtab, tax = nemtax, meta = nemmeta)
nem_ttest <- nem |>
              filter_name(meta, Treatments %in% c("CK", "C8")) |>
              calc_compare(.group = Treatments, y = Mesorhabditis, method = TTest)
nem_ttest

Run the code above in your browser using DataLab