BLE_Categorical {BayesSampling} | R Documentation |
Bayes Linear Method for Categorical Data
Description
Creates the Bayes Linear Estimator for Categorical Data
Usage
BLE_Categorical(ys, n, N, m = NULL, rho = NULL)
Arguments
ys |
k-vector of sample proportion for each category. |
n |
sample size. |
N |
total size of the population. |
m |
k-vector with the prior proportion of each strata. If |
rho |
matrix with the prior correlation coefficients between two different units within categories. It must be a symmetric square matrix of dimension k (or k-1). If |
Value
A list containing the following components:
-
est.prop
- BLE for the sample proportion of each category -
Vest.prop
- Variance associated with the above -
Vs.Matrix
- Vs matrix, as defined by the BLE method (should be a positive-definite matrix) -
R.Matrix
- R matrix, as defined by the BLE method (should be a positive-definite matrix)
Source
https://www150.statcan.gc.ca/n1/en/catalogue/12-001-X201400111886
References
Gonçalves, K.C.M, Moura, F.A.S and Migon, H.S.(2014). Bayes Linear Estimation for Finite Population with emphasis on categorical data. Survey Methodology, 40, 15-28.
Examples
# 2 categories
ys <- c(0.2614, 0.7386)
n <- 153
N <- 15288
m <- c(0.7, 0.3)
rho <- matrix(0.1, 1)
Estimator <- BLE_Categorical(ys,n,N,m,rho)
Estimator
ys <- c(0.2614, 0.7386)
n <- 153
N <- 15288
m <- c(0.7, 0.3)
rho <- matrix(0.5, 1)
Estimator <- BLE_Categorical(ys,n,N,m,rho)
Estimator
# 3 categories
ys <- c(0.2, 0.5, 0.3)
n <- 100
N <- 10000
m <- c(0.4, 0.1, 0.5)
mat <- c(0.4, 0.1, 0.1, 0.1, 0.2, 0.1, 0.1, 0.1, 0.6)
rho <- matrix(mat, 3, 3)