Rounds a vector of values to whole numbers while preserving the sum (rounded if it is not a whole number) using the largest remainder method (Gallagher, 1991).
A vector of values with decimal values and a whole number sum to round.
If the sum of the values in v is not a whole number, choose a rounding method to ensure it is a whole number.
out A vector of v with the values rounded to whole numbers but with the whole number sum preserved.
Gallagher M. Proportionality, disproportionality and electoral systems. Electoral Studies. 1991;10(1)33-51. doi:10.1016/0261-3794(91)90004-C.
Other data functions:
1 2 3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.