proptests: Many 2 sample proportions tests

View source: R/proptest.R

Many 2 sample proportions testsR Documentation

Many 2 sample proportions tests

Description

It performs very many 2 sample proportions tests.

Usage

proptests(x1, x2, n1, n2) 

Arguments

x1

A vector with the successes of the one group.

x2

A vector with the successes of the one group.

n1

A vector with the number of trials of the one group.

n2

A vector with the number of trials of the one group.

Details

The 2-sample proportions test is performed for each pair of proportions of teh two groups.

Value

A matrix with the proportions of each group (two columns), the test statistic and the p-value of each test.

Author(s)

Michail Tsagris

R implementation and documentation: Michail Tsagris <mtsagris@uoc.gr> and Manos Papadakis <papadakm95@gmail.com>.

References

B. L. Welch (1951). On the comparison of several mean values: an alternative approach. Biometrika, 38(3/4), 330-336.

See Also

ttests, ftests, colVars

Examples

## 10000 variables, hence 10000 t-tests will be performed
set.seed(12345)
x1 <- rpois(500, 5)
x2 <- rpois(500, 5)
n1 <- rpois(1000, 40)
n2 <- rpois(1000, 40)
a <- proptests(x1, x2, n1, n2)
mean(a[, 4]<0.05)

x1 <- rbinom(500, 500, 0.6)
x2 <- rbinom(500, 500, 0.6)
b <- proptests(x1, x2, 500, 500)
mean(b[, 4]<0.05)

Rfast documentation built on Nov. 9, 2023, 5:06 p.m.