nPlan: Returns a data.frame with total resources to be spend in...

Description Usage Arguments Value Examples

View source: R/nPlan.R

Description

This function returns a data.frame with the calculations of time to be spend on sampling process, listing respectives sampling parameters, like confidence levels and margin of errors. Need a sample size function to work.

Usage

1
2
nPlan(hh, max.hh = NULL, max.n = NULL, max.alpha = NULL,
  max.beta = NULL, fun = "nSRS", ...)

Arguments

hh

The cost, measured in time (HH), for collecting data for each sample unit.

max.hh

The cost threshold from which results and their parameters will be excluded.

max.n

The sample size threshold from which results and their parameters will be excluded.

max.alpha

The maximum z-value of α from which results and their parameters will be excluded.

max.beta

The maximum z-value of β from which results and their parameters will be excluded. Applicable only to nPowerSample function.

fun

Function used to calculate samplesize. Can be nSRS, nStrata or nSampleSize.

...

Others parameters passed to be used with the sample size functions. See examples.

Value

A data.frame with

alpha

The α.

moe

The margin of error, when using nSRS or nStrata.

beta

The α, when using nSampleSize.

n

Respective sample size.

hh

Cost, in time, as the argument passed to the function.

hh_total

Total cost, in time.

Examples

1
2
3
4
5
6
7
################### nSRS
nPlan(hh = (10/60), fun = "nSRS", max.alpha = 0.1, max.n = 176, max.hh = 60,
      moe = seq(0.01,0.1,by=0.01), pq = 0.25, N = 16548)

################### nPowerSample
nPlan(hh = (5/60), fun = "nPowerSample", max.hh = 40, max.alpha = 0.1, max.beta = 0.2,
      p=0.02, p0=0.05, alternative = 1)

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