Skip to contents

$$sw_i = \prod_t f(A_{it}|A_{i,t-1}) / f(A_{it}|H_{it})$$ The marginal numerator keeps the weights centred near one instead of letting one small conditional probability blow the weight up. Correctly specified stabilized weights have mean close to 1, so mean_weight is the diagnostic to look at.

Usage

Gstabwt(
  treatment = NULL,
  history = NULL,
  numerator_model = NULL,
  denominator_model = NULL
)

Arguments

treatment, history

Accepted for signature compatibility; used only to check shapes.

numerator_model

Fitted \(f(A_t|A_{t-1})\), subjects by time.

denominator_model

Fitted \(f(A_t|H_t)\), subjects by time.

Value

Named list with estimate, weights, unstabilized, mean_weight, max_weight, n, n_times, method.

References

Robins, Hernan & Brumback (2000) Epidemiology 11:550-560.

Examples

Gstabwt(denominator_model = matrix(c(0.3, 0.6, 0.7, 0.2), nrow = 2))
#> $estimate
#> [1] 6.547619
#> 
#> $weights
#> [1] 4.761905 8.333333
#> 
#> $unstabilized
#> [1] 4.761905 8.333333
#> 
#> $mean_weight
#> [1] 6.547619
#> 
#> $max_weight
#> [1] 8.333333
#> 
#> $n
#> [1] 2
#> 
#> $n_times
#> [1] 2
#> 
#> $method
#> [1] "stabilized IPT weights (Robins, Hernan & Brumback 2000)"
#>