b4ddp: Statistical power for a hyphotesis testing on a difference of...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/b4ddp.R

Description

This function computes the power for a (right tail) test of difference of proportions.

Usage

1
b4ddp(N, n, P1, P2, P3, P4, D, DEFF = 1, conf = 0.95, plot = FALSE)

Arguments

N

The population size.

n

The sample size.

P1

The value of the first estimated proportion.

P2

The value of the second estimated proportion.

P3

The value of the third estimated proportion.

P4

The value of the fourth estimated proportion.

D

The value of the null effect.

DEFF

The design effect of the sample design. By default DEFF = 1, which corresponds to a simple random sampling design.

conf

The statistical confidence. By default conf = 0.95.

plot

Optionally plot the power achieved for an specific sample size.

Details

We note that the power is defined as:

1-Φ(Z_{1-α} - \frac{(D - [(P_1 - P_2) - (P_3 - P_4)])}{√{\frac{DEFF}{n}(1-\frac{n}{N})(P_1Q_1+P_2Q_2+P_3Q_3+P_4Q_4)}})

Value

The power of the test.

Author(s)

Hugo Andres Gutierrez Rojas <hagutierrezro at gmail.com>

References

Gutierrez, H. A. (2009), Estrategias de muestreo: Diseno de encuestas y estimacion de parametros. Editorial Universidad Santo Tomas

See Also

ss4p

Examples

1
2
3
4
b4ddp(N = 10000, n = 400, P1 = 0.5, P2 = 0.5, P3 = 0.5, P4 = 0.5, D = 0.03)
b4ddp(N = 10000, n = 400, P1 = 0.5, P2 = 0.5, P3 = 0.5, P4 = 0.5, D = 0.03, plot = TRUE)
b4ddp(N = 10000, n = 4000, P1 = 0.5, P2 = 0.5, P3 = 0.5, P4 = 0.5, 
D = 0.05, DEFF = 2, conf = 0.99, plot = TRUE)

samplesize4surveys documentation built on Jan. 18, 2020, 1:11 a.m.