Research Workbench

Rake a table to target margins

Iteratively fit a positive seed table to specified row and column totals.

Your entries stay in this page’s memory and are not submitted to us. Downloads are generated locally. Reloading or leaving the page clears your entries. Do not enter patient information.

Use 2–20 rows and columns, all strictly positive target totals and seed cells. Row and column grand totals must match within relative tolerance 1e−10. Structural zeros are unsupported.

The starting values are hypothetical. Results update as you edit. Use aggregate or synthetic inputs only.

Calculation results

Fitted rows
17.576507, 22.423493 | 32.423493, 27.576507
Iterations
6
Maximum relative margin error
2.3629099e-12

How to interpret the output

Iterative proportional fitting alternates row and column scaling until relative margin error is below 1e−10 or 10,000 iterations. Fitted counts need not be integers. Matching margins does not remove unmeasured selection bias or validate survey weights. Structural zeros and incompatible targets require specialist methods.

Method reference

Source checked 2026-11-06. Read the reproducible calculator validation report.