I have a sample of people which is biased in age, gender, geography. I am trying to measure various continuous outcomes out of them. I have the census data to tell me the reality of the population distribution at the zipcode level/county/state level and I cannot change my biased sample. How can I alter my sample to be a good representation of the population?

I guess I would like to have a set of weights for each one of the people in my sample, to alter the outcome according to these weights, determined by the mismatch between my sample and the population. These weights should be normalized to 1 to make sure the full aggregated outcome remains the same.

Another idea would be to sub-sample to match the population distribution, but I would potentially lose a lot of data so I'd rather not go that way.

I started reading about the Heckman correction. Is it the place to start? Is there a standard method which can help me achieve that goal? Do you know of any good book that treats this question?


The Heckman model is for a different problem. You were right to look at weighting. Your problem looks very suitable for raking, see e.g. https://www.stata-journal.com/article.html?article=st0323

  • $\begingroup$ Ah! This is closely related to the iterative raking algorithm and iterative proportional fitting! Thanks for the answer, this is what I was looking for! $\endgroup$ – Damien Mar 12 '16 at 20:33
  • $\begingroup$ @Maarten Buis, the link is not working anymore, could you please give another link $\endgroup$ – Gaurav Singhal Dec 18 '18 at 9:48

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.