View source: R/calculateSSQR.R
calcSSQR | R Documentation |
SSQ_R is the ratio of the within-network sum of squares to the total sum of squares. The adaptive cluster sampling (ACS) design becomes more efficient relative to simple random sampling (SRS) as the within-network variation increases relative to overall variation [@thompson1996adaptive]. We calculate
SSQ_R = SSQ_w/SSQ_tau
as the ratio of the within-network sum of squares
SSQ_w = ∑_{j=1}^{κ} ∑_{i \in j} (y_{j,i} - \bar{y_{j}})^2
, to the total sum of squares
SSQ_τ= ∑_{i=1}^{N} (y_i - μ)^2
. Thus, an increase in SSQ_R
indicates an increase in the efficiency of the ACS design relative to SRS.
calcSSQR(popdata, variable, popvar = NULL)
popdata |
Information about the populations of interest. MORE DETAIL ABOUT STRUCTURE OF THIS. |
variable |
Variable for which to calculate SSQr. |
popvar |
A character string (OR VECTOR??) used to identify different populations. The default value is NULL. |
Dataframe including original data and RE estimates.
su2003estimatorACSampling
library(magrittr) library(dplyr) data(Thompson1990Fig1Pop) temp <- Thompson1990Fig1Pop %>% mutate(pop = 1) popdata <- temp variable <- "y_value" popvar <- "pop" # calcSSQR(popdata, variable, popvar) popvar <- NA # calcSSQR(popdata, variable, popvar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.