welch.t.tests: Perform rowwise Welch t-tests. In AEBilgrau/Bmisc: Biostatistical miscellaneous functions

Description

This function performs rowwise Welch two-sample t-test in two matrices with the same height in a fast manner.

Usage

 `1` ```welch.t.tests(x, y) ```

Arguments

 `x` A numeric matrix of the values of the first group. Usually the expression matrix of the first group. `y` A numeric matrix of the values in the second group with the same number of rows as `x`.

Details

A Welch t-test is performed for each row in `x` and `y`. The i'th row of `x` is tested against the i'th row of `y` and the result is seen in the i'th row of the output.

Value

A `data.frame` with the same number of rows as x containing the means, variances, pooled stadard deviations, estimated difference, the standard error of the difference, the t statistic, the degrees of freedom, and the p-values.

Author(s)

Anders Ellern Bilgrau <anders.ellern.bilgrau (at) gmail.com>

Examples

 ``` 1 2 3 4 5 6 7 8 9 10``` ```# Create some toy data x <- replicate(10, rnorm(20, 0, 1)) y <- replicate(11, c(rnorm(10, 1, 1), rnorm(10, 0, 1))) rownames(x) <- rownames(y) <- paste0("Gene", 1:20) welch.t.tests(x, y) # To perform a single t test t.test(x[1,], y[1, ]) welch.t.tests(x[1, , drop = FALSE], y[1, , drop = FALSE]) ```

AEBilgrau/Bmisc documentation built on May 5, 2019, 11:28 a.m.