Home / Science / Health and medicine / Public health / Survey weighting calculator (raking and post-stratification)Tool #494

Survey weighting calculator: raking, post-stratification, design effect and effective sample size

Weight survey respondents to match population figures for up to three variables by post-stratification or raking (iterative proportional fitting), starting from design weights if you have them. Get the weights, weighted percentages, Kish's design effect and the effective sample size.

Keep it one tap away for everyday use.

Bookmark Survey weighting calculator (raking and post-stratification)?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. Respondents
  2. Population
  3. Rake
  4. Weights
Nothing is uploadedWorks offline once open

For study and teaching, not medical advice. Check with a qualified professional. The example respondents and population figures are made up.

Respondents

Design weights come from how the sample was drawn (for example, people in a small region sampled at twice the rate get half the weight). Leave it at None if everyone had the same chance.

Population figures

Post-stratification scales each group of one variable to its population share in one step. Raking adjusts the weights to two or three variables' shares in turn, again and again, until all of them match (iterative proportional fitting).

What it does

Surveys rarely reach people in the same mix as the population: more women than men may answer, or too few young people. Weighting counts under-represented respondents a bit more and over-represented ones a bit less, so the weighted sample matches known population figures. This tool:

  • starts from design weights (or selection probabilities) if your sample design had them,
  • post-stratifies to one variable, or rakes to two or three variables at once,
  • shows weighted percentages for every column, next to the plain sample percentages and the population targets,
  • gives Kish’s design effect and the effective sample size, which tell you how much precision the weighting costs,
  • downloads your data with a weight column as CSV.

Everything runs in your browser: your respondents never leave your device.

How to use it

  1. Paste the respondent table with a header row, or open a CSV or Excel file. One row per respondent.
  2. If your sample design gave people different chances of selection, choose the design weight column and say whether it holds weights or selection probabilities (weight = 1/p).
  3. Choose the method and up to three variables. For each, type the population figure for every category, as counts or per cent: “Female, 51 %”. Choosing a variable lists its categories for you.
  4. Choose whether the weights add up to the sample size (handy for percentages) or to the population size (so weighted counts estimate population totals).

Every category in the data must have a population figure, and every category with a population figure must have at least one respondent. Merge small categories if not.

The methods

Post-stratification multiplies each respondent’s weight by (population share × total) ÷ (current weighted total of their group), in one step. Raking does this for each variable in turn and repeats until every weighted share matches its population share to within 10⁻¹³ (Deming and Stephan, 1940). The result is the raking-ratio calibration estimator of Deville and Särndal (1992). With one variable, raking and post-stratification give the same weights.

Design effect (Kish): deff = n Σw² ÷ (Σw)² = 1 + CV², the factor by which unequal weights inflate the variance of a mean. Effective sample size = (Σw)² ÷ Σw² = n ÷ deff.

Worked example

The page opens with 40 made-up respondents (27 women, 13 men) raked to made-up figures: 51 % female, age 30 / 35 / 35 %, and 40 % North. Raking settles in 14 rounds. The design effect is 1.258 and the effective sample size is 31.8 out of 40. The weights run from 0.4816 to 2.177. The share who smoke moves from 27.5 % unweighted to 28.4 % weighted. Switch to post-stratification and only sex is used: the women’s weight is 0.7556 and the men’s 1.508, with a design effect of 1.124.

Tips

  • A design effect much above 2, or a largest weight more than 10 times the smallest, means a few people count a lot. Merge small categories or use fewer variables.
  • Raking matches each variable’s total, not every combination: the share of young women is not forced to match.
  • Population figures from a census or official statistics carry their own date and source; check the official source.

Frequently asked questions

Were the weights checked? Yes: against a separate raking routine written with NumPy and pandas, and against the calibration equations solved with SciPy, to better than one part in a billion.

Is my data stored or uploaded? No. Nothing leaves your browser.

Where the numbers come from

  • Raking (iterative proportional fitting): Deming and Stephan (1940), Annals of Mathematical Statistics 11: 427-444; as calibration: Deville and Särndal (1992), Journal of the American Statistical Association 87: 376-382.
  • Post-stratification: Holt and Smith (1979), Journal of the Royal Statistical Society A 142: 33-46.
  • Design effect from unequal weights: Kish (1965), Survey Sampling, Wiley; Kish (1992), Journal of Official Statistics 8: 183-200.
  • Example respondents and population figures are made up.

Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

Last updated 2026-11-09.

Related tools

Reliability and agreement #40 Check a questionnaire scale with Cronbach's alpha and item statistics, or rater agreement with Cohen's kappa (weighted too), Fleiss' kappa and all six intraclass correlations with 95 % intervals. Matches R's psych package. Sample size and power calculator #32 How many subjects, samples or survey responses do you need? Sample size for comparing two means, paired data, two proportions, or a survey's margin of error, with power curves. Matches R and G*Power. Publication plot maker #27 Paste columns or open a CSV or Excel file and get a clean scientific figure with error bars, sized for a journal column. Download vector SVG or PDF, or PNG at 300 or 600 dpi. Your data stays in your browser. DALY and QALY calculator with ICER #492 Work out disability-adjusted life years (DALY = YLL + YLD) with optional discounting, QALYs from utilities you enter, and the incremental cost-effectiveness ratio per QALY gained and per DALY averted. Herd immunity threshold calculator #493 Work out the herd immunity threshold from R0, the vaccine coverage needed for a vaccine of a given effectiveness, and the effective R at your coverage, with a chart of the threshold against R0. 1D Schrödinger solver #923 Choose a textbook potential, type a formula or draw your own, and get the lowest energy levels and wavefunctions of the one-dimensional Schrödinger equation by the matrix (finite-difference) method, with the exact levels alongside for the box, harmonic oscillator, finite well, Morse, linear and Pöschl–Teller potentials.