Skip to contents

Given vectors x1, n1, x2 and n2, return a vector of p-values that test whether x1 / n1 is the same proportion as x2 / n2.

Usage

vct_prop_test_pval(x1, n1, x2, n2)

Arguments

x1

Number of successes in first condition.

n1

Total number of cases in first condition.

x2

Number of successes in second condition.

n2

Total number of cases in second condition.

Value

A vector of two-sided p-values. Comparisons with a zero base or zero standard error return NA.

Details

All credit to David Robinson.

Examples

vct_prop_test_pval(20, 100, 30, 100)
#> [1] 0.1024704