test_p2: Power for a Two Sample Test of Proportions Using the Normal...

Description Usage Arguments

View source: R/test_p2.R

Description

The two sample test of proportions based on the normal approximation is a method commonly taught in introductory statistics tests.

Usage

1
2
3
test_p2(delta = NULL, n = NULL, pbar = NULL, alpha = 0.05,
  power = NULL, delta0 = 0, weights = list(c(1, 1)), two_tail = TRUE,
  p1_null, p2_null, p1_alt, p2_alt, x1, n1, x2, n2)

Arguments

delta

The difference to be observed between the proportions of two groups. This may also be interpreted as the difference under the alternative hypothesis.

n

The total sample size between the two groups. Unequal sample sizes may be accommodated using the weights argument.

pbar

Theh average proportion.

alpha

The significance level for the test.

power

The power of the test.

delta0

The difference of proportions under the null hypothesis. Typically, this is set to 0 (equal proportions), but can be altered if desired.

weights

A list of weights for the two sample sizes.

two_tail

Will this be a two tailed test? A vector may be given.

p1_null,p2_null

The proportions of p1 and p2 under the null hypothesis. If both of these values are given, their difference will replace the default value of delta0.

p1_alt,p2_alt

The proportions of p1 and p2 under the alternative hypothesis. If these are both provided and delta = NULL, the difference of these vectors will be used as delta.

x1,x2,n1,n2

Values of the frequencies and samples sizes from preliminary data to be used to calculate sd. If All four of these values are given and pbar=NULL, pbar will be calculated from the preliminary values. The arguments n1 and n2 have no influence over the sample size values in the resulting data frame. Note: these values are assumed to be integers and are quietly coerced to integers.


nutterb/StudyPlanning documentation built on May 24, 2019, 10:51 a.m.