MoE_Y: Margin of error for count

Description Usage Arguments Value See Also Examples

View source: R/MoE_Y.R

Description

The function computes margin of error for count. The calculation takes into proportion, expected response rate and design effect.

Usage

1
MoE_Y(P = 0.5, n, pop, confidence = 0.95, R = 1, deff_sam = 1, deff_est = 1)

Arguments

P

The expected proportion for variable of interest.

n

The expected sample size.

pop

Population size.

confidence

Optional positive value for confidence interval. This variable by default is 0.95.

R

The expected response rate (optional). If not defined, it is assumed to be 1 (full-response).

deff_sam

The expected design effect of sample design for the estimates (optional). If not defined, it is assumed to be 1.

deff_est

The estimated design effect of estimator for the estimates (optional). If not defined, it is assumed to be 1.

Value

The estimate of margin of error for count.

See Also

expvar, optsize, MoE_P

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library("data.table")
n <- 100
pop <- 1000

MoE_Y(P = 0.5, n = n, pop = pop)

DT <- data.table(P = seq(0, 1, 0.01))
DT[, Y := round(pop * P)]
DT[, AMoE := MoE_Y(P, n = 100, pop = 1000)]
DT[Y > 0, RMoE := AMoE / Y]
DT

surveyplanning documentation built on July 1, 2020, 10:38 p.m.