Sample size calculation

sample_size(
  type,
  err_mean = 2,
  sd_mean = 10,
  err_prop = 0.1,
  p_prop = 0.5,
  conf_lev = 0.95,
  incidence = 1,
  response = 1,
  pop_correction = "no",
  pop_size = 1e+06
)

Arguments

type

Choose "mean" or "proportion"

err_mean

Acceptable Error for Mean

sd_mean

Standard deviation for Mean

err_prop

Acceptable Error for Proportion

p_prop

Initial proportion estimate for Proportion

conf_lev

Confidence level

incidence

Incidence rate (i.e., fraction of valid respondents)

response

Response rate

pop_correction

Apply correction for population size ("yes","no")

pop_size

Population size

Value

A list of variables defined in sample_size as an object of class sample_size

Details

See https://radiant-rstats.github.io/docs/design/sample_size.html for an example in Radiant

See also

summary.sample_size to summarize results

Examples

sample_size(type = "mean", err_mean = 2, sd_mean = 10)
#> $n #> [1] 97 #> #> $zval #> [1] 1.959964 #> #> $type #> [1] "mean" #> #> $err_mean #> [1] 2 #> #> $sd_mean #> [1] 10 #> #> $conf_lev #> [1] 0.95 #> #> $incidence #> [1] 1 #> #> $response #> [1] 1 #> #> $pop_correction #> [1] "no" #> #> attr(,"class") #> [1] "sample_size" "list"