View source: R/quadratic_forms.R
make_srswor_matrix | R Documentation |
The usual variance estimator for simple random sampling without replacement can be represented as a quadratic form. This function determines the matrix of the quadratic form.
make_srswor_matrix(n, f = 0)
n |
Sample size |
f |
A single number between |
The basic variance estimator of a total for simple random sampling without replacement is as follows:
\hat{v}(\hat{Y}) = (1 - f)\frac{n}{n - 1} \sum_{i=1}^{n} (y_i - \bar{y})^2
where f
is the sampling fraction \frac{n}{N}
.
If f=0
, then the matrix of the quadratic form has all non-diagonal elements equal to -(n-1)^{-1}
,
and all diagonal elements equal to 1
. If f > 0
, then each element
is multiplied by (1-f)
.
If n=1
, then this function returns a 1 \times 1
matrix whose sole element equals 0
(essentially treating the sole sampled unit as a selection made with probability 1
).
A symmetric matrix of dimension n
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.