wght_calc function

Compute IPW weight

Compute IPW weight

Calculates the IPW for a single group. Used by wght_matrix to create a matrix of weights for each group and allocation scheme.

wght_calc(parameters, integrand, allocation, integrate_allocation = TRUE, ...)

Arguments

  • parameters: vector of parameter values
  • integrand: function to pass to the argument 'f' of integrate.
  • allocation: the allocation ratio for which to compute the weight
  • integrate_allocation: Indicator of whether the integrand function uses the allocation parameter. Defaults to TRUE.
  • ...: other arguments passed to integrand.

Returns

scalar result of the integral

Details

If allocation is an argument in the integrand function and integrate_allocation == TRUE, then the weight is calcuated as:

1Pr(AX)1/integrate(integrand) \frac{1}{Pr(A|X)}1 / integrate(integrand)

Otherwise, the weight is computed by:

j=1nαjA(1α)(1Aj)Pr(AX)prod(allocationA(1allocation)A)/integrate(integrand) \frac{\prod_{j=1}^n \alpha^A_j (1 - \alpha)^(1-A_j)}{Pr(A|X)}prod(allocation^A(1 - allocation)^A) / integrate(integrand)
  • Maintainer: Bradley Saul
  • License: GPL (>= 2)
  • Last published: 2021-04-21

Useful links