wt_comp is a helper function that computes different types of treatment weight given a treatment and estimated propensity score.

wt_comp(ps, treat, wt_type = "i")

Arguments

ps

The estimated propensity score.

treat

A factor variable containing the treatment assignment

wt_type

The type of weight to compute, "i"=IPTW (default), "s"= stabilized IPTW, "n" = normalized IPTW, "o" = overlap IPTW, or a numeric for SMR weights weighted to the level of treatment indicated by the number.

Value

A vector of observation weights

Author

M. Alan Brookhart export