new_y_HT: Calculate the Horvitz-Thompson mean of an adaptive cluster...

View source: R/y_HT.R

new_y_HTR Documentation

Calculate the Horvitz-Thompson mean of an adaptive cluster sample, NEW FORMULA.

Description

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$.

Usage

new_y_HT(
  y,
  N,
  n1,
  m_threshold,
  pi_i_values = NULL,
  m_vec = NULL,
  sampling = NULL,
  criterion = NULL
)

Arguments

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 NULL.

m_vec

Vector of values m for the set of units in a sample, of length n1. Each m value within the vector m_vec denotes the number of units satisfying the ACS criterion for the network i to which the unit belongs.

sampling

A vector (character format) describing whether units were included in the initial sample or subsequent ACS sample. Units selected in the initial sample should be given the value "Initial_Sample" in the sampling vector.

criterion

Numeric threshold value of the variable of interest y (whose name in the dataframe $popdata$ is supplied via the yvar argument) that initiates ACS. Defaults to 0 (ie., anything greater than 0 initiates adaptive cluster sampling).

Value

The Horvitz-Thompson mean.

References

\insertRef

saubyadaptiveACSampling \insertRefthompson1990adaptiveACSampling

Examples

# 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
)

ksauby/ACS documentation built on Aug. 18, 2022, 3:33 a.m.