b4m: Statistical power for a hyphotesis testing on a single mean

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

View source: R/b4m.R

Description

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

Usage

1
b4m(N, n, mu, sigma, D, DEFF = 1, conf = 0.95, plot = FALSE)

Arguments

N

The population size.

n

The sample size.

mu

The value of the estimated mean of the variable of interest.

sigma

The value of the standard deviation of the variable of interest.

D

The value of the null effect. Note that D must be strictly greater than mu.

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 - μ)}{√{\frac{1}{n}(1-\frac{n}{N})S^2}})

where

S^2 = DEFF σ^2

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
b4m(N = 100000, n = 400, mu = 3, sigma = 1, D = 3.1)
b4m(N = 100000, n = 400, mu = 5, sigma = 10, D = 7, plot = TRUE)
b4m(N = 100000, n = 400, mu = 50, sigma = 100, D = 100, DEFF = 3.4, conf = 0.99, plot = TRUE)

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