survey_sample: Compute proportion in the survey sample

Description Usage Arguments Value Author(s) Examples

View source: R/estimation.R

Description

Proportion estimated using the survey sample and confidence intervals based on the Clopper–Pearson approach.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
survey_sample(
  R,
  n,
  alpha = 0,
  beta = 0,
  gamma = 0.05,
  pi0 = 0,
  simulation = FALSE,
  ...
)

Arguments

R

A numeric that provides the people of positive people in the sample.

n

A numeric that provides the sample size.

alpha

A numeric that provides the False Negative (FN) rate for the sample R. Default value is 0.

gamma

A numeric that used to compute a (1 - gamma) confidence region for the proportion. Default value is 0.05.

...

Additional arguments.

beta0

A numeric that provides the False Positive (FP) rate for the sample R. Default value is 0.

Value

A CPreval object with the structure:

Author(s)

Stephane Guerrier

Examples

1
2
3
4
5
6
7
8
9
# Samples without measurement error
X = sim_Rs(p = 30/1000, pi0 = 10/1000, n = 1500, seed = 18)
survey_sample(X$R, X$n)

# With measurement error
X = sim_Rs(p = 30/1000, pi0 = 10/1000, n = 1500, alpha0 = 0.01,
alpha = 0.01, beta0 = 0.05, beta = 0.05, seed = 18)
survey_sample(X$R, X$n)
survey_sample(X$R, X$n, alpha = 0.01, beta = 0.05)

stephaneguerrier/CPreval documentation built on June 6, 2020, 2:28 a.m.