nPilot: Calculates the remaing sample size when using pilot sample

Description Usage Arguments Value References Examples

View source: R/nPilot.R

Description

Based on a pilot sample, this function calculates the remain elements to the final sample given the variance considered.

Usage

1
nPilot(s2 = NULL, pq = NULL, n1, alpha, moe, N)

Arguments

s2

The variance, as σ^2. Not necessary if pq is not NULL.

pq

The variance, as P(1-P). Not necessary if s2 is not NULL.

n1

The size of the pilot sample.

alpha

1 - confidence level.

moe

Margin of error.

N

Population size.

Value

The final sample is

n = n_1 + n_2

Where n_2 is the value returned by this function.

References

COCHRAN, William Gemmell. Sampling techniques-3. 1977.

Examples

1
2
3
4
nPilot(s2=13.5,n1=30,alpha=0.05,moe=5, N = 306)
nPilot(s2=13.5,n1=30,alpha=0.05,moe=5, N = 5000)
nPilot(pq=0.15,n1=30,alpha=0.1,moe=0.05, N = 306)
nPilot(pq=0.15,n1=30,alpha=0.1,moe=0.05, N = 5000)

cgu-dados/auditsampling documentation built on March 24, 2021, 9:38 a.m.