Evaluate the standard error, margin of error, and coefficient of variation a planned design achieves for a ratio of two population totals.
Usage
prec_ratio(r = NULL, ...)
# Default S3 method
prec_ratio(
r = NULL,
n = NULL,
...,
cv_num = NULL,
cv_den = NULL,
component_cor = NULL,
alpha = 0.05,
N = Inf,
deff = 1,
resp_rate = 1,
df = NULL,
plan = NULL
)
# S3 method for class 'svyplan_n'
prec_ratio(r, ...)Arguments
- r
For the default method: the anticipated ratio,
mean(y) / mean(x). May be negative, but not zero. Forsvyplan_nobjects: a sample size result fromn_ratio().- ...
Additional arguments passed to methods. Unused arguments are rejected.
- n
Sample size to evaluate, gross of nonresponse. The responding sample is
n * resp_rate.- cv_num
Coefficient of variation of the numerator variable, strictly positive.
- cv_den
Coefficient of variation of the denominator variable, strictly positive.
- component_cor
Correlation between numerator and denominator across units, in [-1, 1].
- alpha
Significance level, default 0.05.
- N
Population size.
Inf(default) means no finite population correction.- deff
Design effect of the ratio estimator (> 0). See
n_ratio()for what this is the design effect of.- resp_rate
Expected response rate, in (0, 1]. Default 1.
- df
Degrees of freedom of the variance estimator, switching the interval quantile from normal to t.
NULL(default) applies none.- plan
Optional
svyplan()object providing design defaults.
Value
A svyplan_prec object with type = "ratio" and
method = "linearization":
seStandard error of the estimated ratio, on the ratio scale.
moeHalf-width of the confidence interval,
q * se.cvRelative standard error,
se / abs(r).rmoeMargin of error relative to
r,moe / abs(r).paramsThe inputs, plus
unit_relvarandn.
Details
At a gross sample n, with n_net = n * resp_rate and
n_eff = n_net / deff,
$$SE(\hat{R}) = |R| \sqrt{L_R (1 - n_{net}/N) / n_{eff}}$$
where \(L_R\) is the unit relative variance defined in n_ratio(). The
interval is the symmetric first-order one and is not a Fieller interval.
The method omits the ratio estimator's bias and assumes a denominator
safely away from zero.
Why there is no solve-for-level mode
prec_mean() accepts a target cv and solves for the smallest detectable
mu, because the standard error of a mean does not involve the mean. That
inverse does not exist here. The relative standard error of a ratio,
$$CV(\hat{R}) = \sqrt{\mathrm{deff} \cdot L_R (1/n_{net} - 1/N)}$$
does not involve the magnitude of R at all, so either every non-zero
ratio with those component moments meets a cv target or none does.
A moe target is algebraically invertible, giving
\(|R| = \mathrm{moe} / (q \sqrt{L_R \cdot fpc / n_{eff}})\), and is still
not offered. It recovers only the magnitude, so it cannot return the
estimand that was asked for, and the question it answers, the largest
ratio whose absolute margin of error stays inside a bound at a fixed
sample size, is not one survey planning asks.
See also
n_ratio() for the inverse, prec_mean() for a mean,
prec_cluster() for a multistage design.
Other proportion, mean and ratio functions:
n_mean(),
n_prop(),
n_ratio(),
prec_mean(),
prec_prop()
Examples
# Precision of an issued sample of 1200
prec_ratio(r = 420, n = 1200, cv_num = 1.20, cv_den = 0.45,
component_cor = 0.65)
#> Sampling precision for ratio (linearization)
#> n = 1200
#> se = 11.7581, moe = 23.0455, cv = 0.0280, rmoe = 0.0549
# With a design effect and nonresponse
prec_ratio(r = 420, n = 1200, cv_num = 1.20, cv_den = 0.45,
component_cor = 0.65, deff = 1.3, resp_rate = 0.85)
#> Sampling precision for ratio (linearization)
#> n = 1200 (net: 1020)
#> se = 14.5412, moe = 28.5002, cv = 0.0346, rmoe = 0.0679
# Round trip: a size and the precision it buys agree exactly
size <- n_ratio(r = 2, cv_num = 1.1, cv_den = 0.6, component_cor = 0.7,
cv = 0.05)
prec_ratio(size)$cv
#> [1] 0.05