diff_vec: Calculate vector of differences between desired targets and...

Description Usage Arguments Details Value Examples

View source: R/poisson_functions.r

Description

targets_mat calculates vector of differences of length s * k

Usage

1
diff_vec(betavec, wh, xmat, targets, dweights = rep(1, length(targets)))

Arguments

betavec

vector parameters to poisson model, length s * k (see h, s, k definitions below)

wh

vector of household total weights, length h

xmat

h x k matrix of data for households

targets

s x k matrix of desired target values

dweights

optional length s * k vector of weights to multiply the vector of targets

Details

See (Khitatrakun, Mermin, Francis, 2016)

h

number of households (or individuals, records, tax returns, etc.)

s

number of states (or other geographies or subgroups)

k

number of characteristics each household has

Value

vector of differences of length s * k

Examples

1
2
3
4
p <- make_problem(h=10, s=3, k=2)
dw <- get_dweights(p$targets)
betavec <- rep(0, p$s * p$k)
diff_vec(betavec, p$wh, p$xmat, p$targets, dw)

donboyd5/geoWeight documentation built on July 5, 2020, 8:55 p.m.