Learn R Programming

TriMatch (version 0.9.9)

trips: Estimates propensity scores for three groups

Description

The propensity score is $$e(X)=P({ W }=1|X)$$ This function will estimate the propensity scores for each pair of groups (e.g. two treatments and one control).

Usage

trips(thedata, treat, formu = ~., groups = unique(treat), nstrata = 5,
  method = "logistic", ...)

Arguments

thedata

the data frame.

treat

vector or factor indicating the treatment/control assignment for thedata. Length must be equal to nrow(thedata).

formu

the logistic regression formula. Note that the dependent variable should not be specified and will be modified.

groups

a vector of exactly length three corresponding the values in treat for each control/treatment.

nstrata

the number of strata marks to plot on the edge.

method

the method to use to estimate the propensity scores. Current options are logistic or randomForest.

...

other parameters passed to glm.

Details

$${ PS }_{ 1 }=e({ X }_{ { T }_{ 1 }C })=Pr(z=1|{ X }_{ { T }_{ 1 }C })$$

$${ PS }_{ 2 }=e({ X }_{ { T }_{ 2 }C })=Pr(z=1|{ X }_{ { T }_{ 2 }C })$$

$${ PS }_{ 3 }=e({ X }_{ { T }_{ 2 }{ T }_{ 1 } })=Pr(z=1|{ X }_{ { T }_{ 2 }{ T }_{ 1 } })$$

Examples

Run this code
# NOT RUN {
data(tutoring)
formu <- ~ Gender + Ethnicity + Military + ESL + EdMother + EdFather + Age +
     Employment + Income + Transfer + GPA
tpsa <- trips(tutoring, tutoring$treat, formu)
head(tpsa)
# }

Run the code above in your browser using DataLab