Precision of the average of several occasions of a repeated survey
Source:R/prec_pooled.R
prec_pooled.RdCompute the sampling error (SE, margin of error, CV) for the average of
several occasions of a repeated survey, the equal-weight mean of the
occasion estimates, given the size of each occasion and how far
consecutive occasions overlap. An annual average from quarterly rounds is
the ordinary case, and that average is what "pooled" names here. This is
the inverse of n_pooled().
Usage
prec_pooled(var = NULL, ...)
# Default S3 method
prec_pooled(
var = NULL,
n,
occasions,
...,
sd = NULL,
p = NULL,
r = NULL,
cv_num = NULL,
cv_den = NULL,
component_cor = NULL,
mu = NULL,
alpha = 0.05,
N = Inf,
deff = 1,
resp_rate = 1,
eligibility_rate = 1,
overlap = 0,
overlap_cor = NULL,
cor_decay = NULL,
overlap_draw = c("fixed", "independent"),
df = NULL,
plan = NULL
)
# S3 method for class 'svyplan_n'
prec_pooled(var, ...)Arguments
- var
For the default method: the population variance \(S^2\) on one occasion, taken to be the same on each. Supply this,
porr. Forsvyplan_nobjects: a sample size result fromn_pooled().- ...
Additional arguments passed to methods. Unused arguments are rejected.
- n
Sample size per occasion, gross units drawn.
- occasions
Number of occasions entering the average, at least 2.
- sd
Population standard deviation on one occasion, an alternative spelling of
var. Supply exactly one ofvarorsd.- p
The proportion being averaged, as an alternative to
var. The occasion variance is then \(Np(1-p)/(N-1)\), the same finite population varianceprec_prop()uses, andmuis determined and must not be supplied.- r
The ratio of totals being averaged,
mean(y) / mean(x)as inn_ratio(), taken to be the same on each occasion, as an alternative tovarandp.muis thenrand must not be supplied. See the section on a ratio of totals.- cv_num
Coefficient of variation of the ratio's numerator variable. Used with
ronly.- cv_den
Coefficient of variation of the ratio's denominator variable. Used with
ronly.- component_cor
Correlation between the ratio's numerator and denominator on one unit, in \([-1, 1]\). Used with
ronly. It is notoverlap_cor, which correlates the occasions.- mu
The level being averaged, on the
varscale. Required only for the relative measures:cvandrmoeare defined against it and areNAwithout it. Determined bypon the proportion scale.- alpha
Significance level, default 0.05.
- N
Population size.
Inf(default) means no finite population correction.- deff
Design effect multiplier (> 0), applied to the variance of the pooled estimate rather than to any one occasion. See Details.
- resp_rate
Expected response rate among eligible units, in (0, 1]. Default 1 (no adjustment). It applies to every occasion and with
eligibility_ratenets each size down ton * resp_rate * eligibility_ratebefore the covariance is formed. It is a single round's response, not attrition across a panel. See the nonresponse section of svyplan-package for what the rate counts.- eligibility_rate
Share of issued units in scope, in (0, 1]. Default 1. It applies to every occasion, and with a finite
Nthe population in scope isN * eligibility_rate. See the nonresponse section of svyplan-package.- overlap
Fraction of one occasion's responding sample carried into a later one, in \([0, 1]\). One number, meaning the same overlap at every lag, or one per lag, so
overlap[1]is the consecutive-occasion figure. Adesign_overlap()result is accepted directly atresp_rate = 1. See Details on why not below it.0(default) makes the occasions independent, and the pooled variance is then a single occasion's divided byoccasions.- overlap_cor
Correlation between two occasions among the units they share, in \([0, 1]\). One number for every lag, or one per lag. Default 0, which makes overlap irrelevant, since it is the product
overlap * overlap_corthat moves the variance. Supply this orcor_decay, not both. For a ratio it is the correlation of the ratio's linearized variable.- cor_decay
Correlation at lag \(m\) taken as \(\rho^m\), an alternative to stating
overlap_corlag by lag. It is the shape most panels have, a correlation falling away with distance, and a single number is rarely the right one over a long horizon.- overlap_draw
How the shared units are drawn,
"fixed"(default) for a fixed count drawn with the rest of each occasion's sample, or"independent"for a retained panel topped up on each occasion by a fresh sample drawn independently of it from the whole frame. The second is defined for two occasions, or for more when no lag overlaps. See Details.- df
Degrees of freedom of the variance estimator the planned design will have, typically sampled PSUs minus strata, and available from
design_df(). It switches the interval quantile from normal to t.NULL(default) applies no adjustment.- plan
Optional
svyplan()object providing design defaults.
Value
A svyplan_prec object with type = "pooled":
seStandard error of the pooled estimate, computed on the net sizes
n * resp_rate * eligibility_rate.moeMargin of error,
q * se, withqdefined in Details.cvStandard error relative to the level,
se / abs(mu).NAwhenmuis neither supplied nor determined byp, or is zero.rmoeMargin of error relative to the level,
moe / abs(mu),NAexactly whencvis.paramsThe validated inputs. Dispersion is always stored as
var, andoverlapandoverlap_coras resolved vectors of one entry per lag, whatever form they were supplied in, alongside theoverlap_basisthey were resolved under and, whenoverlapwas adesign_overlap()object, that object asoverlap_rotation. A ratio keepsr, its three moments and itsunit_relvar,varthen being the variance of its linearized variable.
Nothing here is rounded, so passing a continuous n back from
n_pooled() reproduces its se, moe, cv and rmoe exactly.
The print shows n per occasion as evaluated, and for a fit it says
that n is the continuous optimum. For a fit res, the whole sample
to field on each occasion is ceiling(res$n), and prec_pooled(res, n = ceiling(res$n))
gives its precision.
Details
Here q is qnorm(1 - alpha / 2) by default and
qt(1 - alpha / 2, df) when df is supplied.
The estimand is the equal-weight mean of the occasion estimates,
\(\bar y = T^{-1}\sum_t \bar y_t\). Three
things share that name and this is none of the other two. It is not a
pooled variance, and it is not the pooling of the rotating cohorts that
make up one occasion, which n_panel() describes.
Writing \(T\) for occasions, \(n\) for the size net of response and
eligibility, \(N\) for the population in scope, N * eligibility_rate,
\(o_m\) for the overlap at lag \(m\) and \(\rho_m\) for the
correlation there, the occasions carry
$$Var(\bar y_t) = \frac{S^2}{n}\Big(1 - \frac{n}{N}\Big), \qquad Cov(\bar y_t, \bar y_s) = \rho_m S^2 \Big(\frac{o_m}{n} - \frac{1}{N}\Big),$$
the same kernel prec_change() takes a difference on, and the average of
them has
$$V = \frac{1}{T^2}\Big[\,T\,Var(\bar y_t) + 2\sum_{m=1}^{T-1}(T-m)\,Cov_m\Big].$$
Two boundaries fix the whole. A fresh sample each occasion pools to \(Var(\bar y_t)/T\), independent averaging, and a full panel measured with correlation 1 pools to \(Var(\bar y_t)\), the same units every time and averaging buys nothing.
deff multiplies the assembled variance. It is the design effect of the
pooled estimate, which is not in general any one occasion's.
A rotation against a bare overlap
A lag that shares no unit enters according to the type of overlap,
never its values. A bare number describes overlap only, and a zero lag
contributes exactly zero, population term included, as for independent
draws. This is the rule prec_change() applies at overlap = 0, and
under it a fresh sample each occasion pools to
\(Var(\bar y_t)/T\). A design_overlap() object
describes a rotation, whose cohorts are drawn without replacement from
each other. Under overlap_draw = "fixed" its lags that share no unit
keep the population term \(-\rho_m S^2/N\) of two
disjoint samples, whatever the horizon, which covers the gap of a
rotation such as "2-2-2", lags past a cohort's life, and a horizon so
short that no lag shares a unit. No unit is then taken twice within the
horizon.
The two readings differ on a small frame. With N = 8, n = 4, three
occasions and overlap_cor = 1, the object design_overlap("2-2-2")
gives a pooled variance of 1/12, the value an enumeration of the rotation
gives under this sampling and covariance model, while the bare
c(0.5, 0) it resolves to gives 0.25. as.numeric() on the object
discards the rotation, and the result is then the bare reading. The
object is stored as params$overlap_rotation and passed back by
n_pooled(), prec_pooled() and predict() unless overlap is
replaced, in which case the replacement's type decides.
A ratio of totals
A ratio \(R = \bar Y / \bar X\) enters through its
linearized variable \(z = (y - Rx)/\bar X\),
whose variance is \(R^2 L\), with \(L\) the unit relative variance
n_ratio() reports. That variance takes the place of var here and is
what params$var records, and overlap_cor and cor_decay describe the
correlation of \(z\) between occasions. A ratio whose level moves
between occasions is outside the model, as a moving mean is.
What is sized is the equal-weight average of the occasion ratios. A ratio of the pooled totals, \(\sum_t \hat Y_t / \sum_t \hat X_t\), is a different estimator even at one level. To first order its error is \(\sum_t w_t(\hat R_t - R)\), with \(w_t\) the occasion's share of the denominator total, so it has the variance computed here only when the denominator totals are equal across occasions. Otherwise its variance differs, and over independent occasions it is larger, equal weights being the ones that minimize it there. Over two independent occasions whose denominator totals stand 1 to 3, it is 25 percent larger than the equal-weight average's. Sizing an annual rate defined on pooled totals with this function treats the denominator totals as equal, which is close for a stable population and is an approximation to state where it is not.
Overlap works against a pooled estimate, when it works at all
A covariance is subtracted in a difference and added in a sum, so whichever sign it carries, it moves a change and a pooled average in opposite directions. When the covariance is positive, which is the ordinary case, overlap improves a change and inflates a pooled average, and planners routinely get that backwards.
The covariance is positive exactly when
\(o_m > n/N\): shared units above what independent draws
from the same finite population would already give the two occasions.
Without a finite population correction any positive overlap qualifies,
so the ordinary case is the only case there. With one, an overlap
below the sampling fraction means the occasions are negatively
coordinated, sharing fewer units than chance, and the directions
reverse: at N = 1000, n = 500, overlap = 0.25 and
overlap_cor = 0.8, two occasions have a pooled variance of 0.030
against 0.050 for independent ones, while the change variance rises from
0.200 to 0.280. The kernel is a valid covariance throughout.
The level at a single occasion is unaffected either way, being a function
of that occasion's size alone, so it is a reference line rather than a
third position. What trades off is the change against the pooled
estimate. prec_change() and this page size the two arms.
Issued overlap and respondent overlap
A bare number is the overlap between the responding samples, matching
prec_change(). design_overlap() reports the overlap between the
issued ones, and the two coincide only at full response, so its
result is accepted here at resp_rate = 1 and refused below it. The
conversion needs an assumption about how response at one occasion depends
on response at another, which this function does not make. Under
independent response the responding overlap is about resp_rate times
the issued one, and stating it is the planner's decision rather than this
function's.
eligibility_rate does not enter this check. Eligibility is a fixed
attribute of a unit, so a unit out of scope at one occasion is out of
scope at the others, and the share of the eligible sample carried over
is the issued share whenever eligibility does not depend on the rotation
group. A design_overlap() result is therefore accepted at
resp_rate = 1 whatever the eligibility rate.
When the inputs do not describe a covariance
Each positive-overlap lag must also satisfy
(2 - overlap[lag]) * n * resp_rate <= N: the two responding samples
cannot require more distinct units than the frame contains. This bound
applies even at zero outcome correlation, and not at all under
overlap_draw = "independent", where each part fits the frame on its
own. A lag of a rotation object that shares no unit is checked too, its
two disjoint samples needing 2 * n * resp_rate <= N. These
pairwise bounds and the covariance check below are necessary conditions,
not a proof that an arbitrary overlap vector can be realized by a
complete multi-occasion schedule.
A lag's covariance changes sign once its overlap falls below the sampling
fraction n / N, and a covariance whose sign varies across lags need not
be a valid covariance at all. This is checked on the assembled matrix,
because a kernel that fails it can still return a positive pooled
variance, and a design refused here is one whose stated overlap,
correlation and sampling fraction cannot hold together. High sampling
fractions are where it bites, from about n / N = 0.6 upwards over a
long horizon, and much of that region is also a rotation that would
exhaust its own population, and the message says so when it does.
What the overlap covariance assumes
As in prec_change(), the covariance is a model form, a correlation
between occasions among the units they share and simple random sampling
otherwise. It is not the design-based covariance of a complex master
sample, which carries its own pairwise inclusion probabilities.
How the shared units are drawn
Under overlap_draw = "fixed" the shared units are a fixed count drawn
with the rest of the sample. Under "independent" a retained panel is
drawn once and each occasion adds a fresh sample drawn from the whole
frame independently of it, each occasion's mean pooling all its units
with equal weight. With \(w\) the lag-1 overlap, an occasion's
population term becomes \((w^2 + (1 - w)^2)/N\) and the covariance's
\(w^2/N\), the factors prec_change() gives at equal sizes. Beyond two
occasions those terms depend on how each occasion's sample splits into
independently drawn panels, which the lag overlaps do not determine, so
"independent" is refused there unless no lag overlaps.
The average moves more than the change. At equal variances, half the
units retained and overlap_cor = 0.8, the variance of the two-occasion
average under "independent" is 4.2% higher than under "fixed" at a
sampling fraction of 5% and 9.0% higher at 10%.
See also
n_pooled() for the inverse (compute n from a precision
target), prec_change() for the other arm of the trade-off,
design_overlap() for the overlap a rotation schedule gives,
prec_mean() and prec_prop() for a single occasion.
Other repeated survey functions:
design_overlap(),
design_rotation(),
design_schedule(),
n_change(),
n_panel(),
n_pooled(),
prec_change(),
prec_panel()
Examples
# Four independent quarterly rounds averaged into an annual figure
prec_pooled(var = 100, n = 500, occasions = 4)
#> Sampling precision for pooled estimate (mean scale)
#> n = 500 per occasion, 4 occasions (var = 100, deff = 1)
#> No between-occasion covariance (overlap x overlap_cor = 0)
#> se = 0.2236, moe = 0.4383
# The same rounds from a rotating panel: overlap inflates the average
prec_pooled(var = 100, n = 500, occasions = 4, overlap = 0.75,
cor_decay = 0.8)
#> Sampling precision for pooled estimate (mean scale)
#> n = 500 per occasion, 4 occasions (var = 100, deff = 1)
#> overlap = 0.75, overlap_cor = 0.8 at lag 1, shared out to lag 3
#> se = 0.3586, moe = 0.7029
# An annual average of a proportion measured monthly
prec_pooled(p = 0.3, n = 1200, occasions = 12, overlap = 0.75,
cor_decay = 0.9)
#> Sampling precision for pooled estimate (proportion scale)
#> n = 1200 per occasion, 12 occasions (p = 0.3, deff = 1)
#> overlap = 0.75, overlap_cor = 0.9 at lag 1, shared out to lag 11
#> se = 0.009682, moe = 0.01898, cv = 0.03227, rmoe = 0.06325
# An annual unemployment rate averaged over four quarters
prec_pooled(r = 0.0615, cv_num = 4.9, cv_den = 0.73, component_cor = 0.15,
n = 16000, occasions = 4, overlap = 0.75, cor_decay = 0.8)
#> Sampling precision for pooled estimate (ratio of totals)
#> n = 16000 per occasion, 4 occasions (r = 0.0615, deff = 1)
#> overlap = 0.75, overlap_cor = 0.8 at lag 1, shared out to lag 3
#> se = 0.001889, moe = 0.003702, cv = 0.03071, rmoe = 0.06019
# Overlap read off a rotation schedule, at full response
prec_pooled(var = 100, n = 500, occasions = 8,
overlap = design_overlap("4", max_lag = 7), cor_decay = 0.8)
#> Sampling precision for pooled estimate (mean scale)
#> n = 500 per occasion, 8 occasions (var = 100, deff = 1)
#> overlap = 0.75, overlap_cor = 0.8 at lag 1, shared out to lag 3
#> se = 0.2593, moe = 0.5083
# A year of four quarters under a 2-2-2 rotation, below full response.
# The issued overlap is refused here, so the respondent overlap is
# stated, under response independent between occasions
prec_pooled(p = 0.3, n = 1600, occasions = 4, resp_rate = 0.8,
overlap = 0.8 * as.double(design_overlap("2-2-2"))[1:3],
cor_decay = 0.8)
#> Sampling precision for pooled estimate (proportion scale)
#> n = 1600 per occasion (net: 1280), 4 occasions (p = 0.3, deff = 1)
#> overlap = 0.4, overlap_cor = 0.8 at lag 1, shared out to lag 3
#> se = 0.007925, moe = 0.01553, cv = 0.02642, rmoe = 0.05177
# Round-trip from n_pooled
res <- n_pooled(var = 100, moe = 1, occasions = 4, overlap = 0.5,
cor_decay = 0.7)
prec_pooled(res)
#> Sampling precision for pooled estimate (mean scale, continuous optimum)
#> n = 178.2197 per occasion, 4 occasions (var = 100, deff = 1)
#> overlap = 0.5, overlap_cor = 0.7 at lag 1, shared out to lag 3
#> se = 0.5102, moe = 1
prec_pooled(res, n = ceiling(res$n))
#> Sampling precision for pooled estimate (mean scale)
#> n = 179 per occasion, 4 occasions (var = 100, deff = 1)
#> overlap = 0.5, overlap_cor = 0.7 at lag 1, shared out to lag 3
#> se = 0.5091, moe = 0.9978
# Two occasions on a small frame, a retained panel plus independent draws
prec_pooled(var = 100, n = 40, occasions = 2, N = 400, overlap = 0.5,
overlap_cor = 0.78, overlap_draw = "independent")
#> Sampling precision for pooled estimate (mean scale)
#> n = 40 per occasion, 2 occasions (var = 100, deff = 1)
#> overlap = 0.5, overlap_cor = 0.78 at lag 1, shared out to lag 1, independent draws
#> se = 1.285, moe = 2.518