doPS
calculates the unstabilized and stabilized inverse probability treatment weights (IPW) for average treatment effect using propensity score. The propensity score is calculated by twang
package using the boosted logistic regression.
doPS(data,Trt,Trt.name,VARS.)
The dataset, includes treatment assignment as well as covariates
The name of the treatment variable in the dataset.
The treated group name of the treatment variable in the dataset.
The vector of the name of potential confounding variables in the dataset.
doPS returns an object of class "PS". An object of class "PS" is a list containing the following components:
A new dataset which excludes all the missing value on the potential confounders from input data, add the propensity score and IPW into the new dataset.
The estimated propensity scores with estimand of interest as ATE
Unstabilized ipw calculated from ps_ate
Stabilized ipw calculated from ps_ate
an object of class ps
, See the help for ps for details of the ps class.
The treatment variable should only contain 2 levels of treatment, and one should be viewed as treated group and another is control group.
For stabilized weights:
For the treated individuals, we assign the IPW: w = Pr(T=1)/Pr(T=1|X=x), for control individuals, the stabilized weight is: w = (1-Pr(T=1))/(1-Pr(T=1|X=x)).