View source: R/variance_wo_jointinclusionprobabilities.R
var_pi | R Documentation |
This gives equation 9 on page 10 in Berger and Tille 2009.
var_pi(n, y, pi_i_values, estimator)
n |
sample size (an integer value). |
y |
need description |
pi_i_values |
vector of inclusion probabilities, if not calculated using this function. Default is |
estimator |
Options include "Hajek". |
hajek1964asymptoticACSampling \insertRefberger2009samplingACSampling
# Hajek Approximation library(dplyr) library(magrittr) Z = createACS(Thompson1990Fig1Pop, seed=3, n1=30, "y_value", criterion=0) Z_summary <- Z %>% dplyr::filter(Sampling!="Edge") %>% group_by(NetworkID) %>% filter(NetworkID > 0) %>% dplyr::summarise( m = m[1], y_total = sum(y_value, na.rm=TRUE) ) var_y_HT( N = dim(Thompson1990Fig1Pop)[1], n1 = dim(Thompson1990Figure1Sample)[1], m = Z_summary$m, y = Z_summary$y_total ) pi_i_values <- pi_i(N=900,n1=30, m=Z_summary$m) Hajek_b(pi_i=pi_i_values, n=30) var_pi( n = 30, y = Z_summary$y_total, pi_i_values = pi_i_values, estimator = "Hajek" )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.