# BLE_SSRS

library(BayesSampling)

# Application of the BLE to the Stratified Simple Random Sample design

### (From Section 2.3.2 of the “Gonçalves, Moura and Migon: Bayes linear estimation for finite population with emphasis on categorical data”)

In a simple model, where there is no auxiliary variable, and a Stratified Simple Random Sample was taken from the population, we can calculate the Bayes Linear Estimator for the individuals of each strata of the population with the BLE_SSRS() function, which receives the following parameters:

• $$y_s$$ - a vector containing the observed values (aggregated by strata);
• $$h$$ - a vector containing the number of observations of each strata in the sample;
• $$N$$ - a vector containing the total size of each strata;
• $$m$$ - a vector containing the prior mean of each strata. If NULL, sample mean for each strata will be used (non-informative prior);
• $$v$$ - a vector containing the prior variance of an element from each strata ($$v_i> \sigma_i^2$$ for each strata $$i$$). If NULL, it will tend to infinity (non-informative prior);
• $$\sigma$$ - a vector containing the prior estimate of variability (standard deviation) within each strata. If NULL, sample variance of each strata will be used.

### Examples

1. We will use the TeachingSampling’s BigCity dataset for this example (actually we have to take a sample of size $$10000$$ from this dataset so that R can perform the calculations). Imagine that we want to estimate the mean or the total Expenditure of this population, but we know that there is a difference between the rural individuals expenditure mean and the urban ones. After taking a stratified simple random sample of 30 individuals from each area, we want to estimate the real expenditure means, conjugating the sample information with an expert expectation (a priori mean will be $$280$$ for the rural area and $$420$$ for the urban).

The real expenditure means will be the values we want to estimate. In this example we know their real values:

Our design-based estimator for the mean will be the sample mean for each strata:

Applying the prior information about the population we can get a better estimate, especially in cases when only a small sample is available:

Our Bayes Linear Estimator for the mean expenditure of each strata:

1. Example from the help page