make_srswor_matrix function

Create a quadratic form's matrix to represent the basic variance estimator for a total under simple random sampling without replacement

Create a quadratic form's matrix to represent the basic variance estimator for a total under simple random sampling without replacement

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)

Arguments

  • n: Sample size
  • f: A single number between 0 and 1, representing the sampling fraction. Default value is 0.

Returns

A symmetric matrix of dimension n

Details

The basic variance estimator of a total for simple random sampling without replacement is as follows:

v^(Y^)=(1f)nn1i=1n(yiyˉ)2 \hat{v}(\hat{Y}) = (1 - f)\frac{n}{n - 1} \sum_{i=1}^{n} (y_i - \bar{y})^2

where ff is the sampling fraction nN\frac{n}{N}.

If f=0f=0, then the matrix of the quadratic form has all non-diagonal elements equal to (n1)1-(n-1)^{-1}, and all diagonal elements equal to 11. If f>0f > 0, then each element is multiplied by (1f)(1-f).

If n=1n=1, then this function returns a 1×11 \times 1 matrix whose sole element equals 00

(essentially treating the sole sampled unit as a selection made with probability 11).