1
$\begingroup$

I want to test for differences of the known proportion of the population vs. the proportion of a sample. The sample is weighted by sampling weights. The sum of weights is equal to the size of the population.

Consider the following example (coded in R):

set.seed(12345)

theta <- 0.7 # True population value

N <- 100000 # Sample size
samp_values <- rbinom(N, 1, 0.69) # Sample values
weights <- runif(N, 0, 20) # Sampling weights (summing up to the population size)

According to this thread, I could test for differences by applying a z-test:

theta_hat <- sum((samp_values * weights)) / sum(weights) # Weighted proportion

(theta_hat - theta) / sqrt((theta * (1 - theta)) / N) # z-test
# [1] -7.101598

To me the result seems to be fine. However, the other thread is not taking weights into account and surprisingly I did not find any other sources about the topic.

Question: How could weights be incorporated into a test for differences between population proportion and weighted sample proportion?

$\endgroup$
  • 1
    $\begingroup$ It rather depends on what the weights represent. The key question is how they translate into an effective sample size $\endgroup$ – Henry Jan 9 '18 at 8:09
  • $\begingroup$ @Henry Thanks for your comment. I updated the question in order to explain the weights better. The weights where created by calibrating to the population, i.e. the sum of weights is equal to the size of the population. $\endgroup$ – JSP Jan 9 '18 at 8:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.