new_y_HT | R Documentation |
This calculate the Horvitz-Thompson mean of an adaptive cluster sample done by sampling without replacement.
where $v$ is the number of distinct units in the sample and $J_k$ is an indicator variable, equalling 0 if the $k$ th unit in the sample does not satisfy the condition and was not selected in the initial sample; otherwise, $J_k = 1$.
new_y_HT( y, N, n1, m_threshold, pi_i_values = NULL, m_vec = NULL, sampling = NULL, criterion = NULL )
y |
The variable of interest, y. Must be a numeric vector. The criterion that determines whether adaptive cluster sampling takes place is based on this variable. |
N |
Population size. |
n1 |
An integer giving the initial sample size (e.g., a simple random sample). |
m_threshold |
threshold value above which to calculate pi_i and pi_j differently. |
pi_i_values |
vector of inclusion probabilities, if not calculated using this function. Default is |
m_vec |
Vector of values m for the set of units in a sample, of length n1. Each m value within the vector |
sampling |
A vector ( |
criterion |
Numeric threshold value of the variable of interest y (whose name in the dataframe $popdata$ is supplied via the |
The Horvitz-Thompson mean.
saubyadaptiveACSampling \insertRefthompson1990adaptiveACSampling
# Ch. 24, Exercise #2, p. 307, from Thompson (2002) N = 1000 n1 = 100 m_vec = c(2,3, rep(1,98)) y = c(3,6, rep(0, 98)) sampling = "SRSWOR" criterion = 0 round( y_HT(N,n1,m_vec,y,sampling,criterion)*1000, 0 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.