50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

SUMMER (version 1.4.0)

calibrateByRegion: Calibrate the point level totals so their sum matches the regional totals

Description

Calibrate/normalize the point level totals so their sum matches the regional totals. Technically, the totals can be at any level smaller than the region level specified.

Usage

calibrateByRegion(pointTotals, pointRegions, regions, regionTotals)

Value

A vector of same length as pointTotals and pointRegions containing the calibrated/normalized point totals that sum to the correct regional totals

Vector of updated point level totals, calibrated to match region totals

Arguments

pointTotals

Vector of point level totals that will be calibrated/normalized

pointRegions

Vector of regions associated with each point

regions

Vector of region names

regionTotals

Vector of desired region level totals associated with `regions`

Author

John Paige

Examples

Run this code
pointTotals = c(1, 1, 1, 2)
pointRegions = c("a", "a", "b", "b")
regionTotals = c(10, 20)
regions = c("a", "b")
calibrateByRegion(pointTotals, pointRegions, regions, regionTotals)

Run the code above in your browser using DataLab