Description Usage Arguments Value References Examples
The Data Defect Correlation (ddc) is the correlation between response and group membership. It quantifies the correlation between the outcome of interest and the selection into the sample; when the sample selection is independent across members of the population, the ddc is zero. Currently both variables are binary. The data defect index (ddi) is the square of ddc. Squaring the d.d.c. is more useful for characterizing the asymptotics of ' MSE.
1 
mu 
Vector of population quantity of interest 
muhat 
Vector for sample estimate 
N 
Vector of population size 
n 
Vector of sample size 
cv 
Coefficient of variation of the weights, if survey weights exist and

A vector of d.d.c. of the same length of the input, or a scalar if all input variables are scalars.
Meng, XiaoLi (2018) <doi:10.1214/18AOAS1161SF>, "Statistical Paradises and Paradoxes in Big Data (I): Law of Large Populations, Big Data Paradox, and the 2016 US Presidential Election." Annals of Applied Statistics 12:2, 685–726.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18  library(tibble)
library(dplyr)
data(g2016)
# 1. scalar input
select(g2016, cces_pct_djt_vv, cces_n_vv, tot_votes, votes_djt) %>%
summarize_all(sum)
## plug those numbers in
ddc(mu = 62984824/136639786, muhat = 12284/35829, N = 136639786, n = 35829)
# 2. vector input using "with"
with(g2016, ddc(mu = pct_djt_voters, muhat = cces_pct_djt_vv, N = tot_votes, n = cces_n_vv))
# 3. vector input in tidy tibble
transmute(g2016, st,
ddc = ddc(mu = pct_djt_voters, muhat = cces_pct_djt_vv, N = tot_votes, n = cces_n_vv))

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.