pscore {micsr} | R Documentation |
Propensity scores
Description
Propensity scores estimation, using an algorithm that checks the balancing hypothesis using strata and enable the estimation of the treatment effect using stratification methods
Usage
pscore(formula, data, maxiter = 4, tol = 0.005, link = c("logit", "probit"))
## S3 method for class 'pscore'
summary(object, ...)
## S3 method for class 'pscore'
print(
x,
...,
digits = getOption("digits"),
var_equal = c("none", "strata", "group", "both")
)
## S3 method for class 'summary.pscore'
print(
x,
...,
digits = getOption("digits"),
format = c("rst", "pipe", "simple"),
step = c("all", "strata", "covariates", "atet")
)
## S3 method for class 'pscore'
nobs(object, ..., smpl = c("total", "cs"))
## S3 method for class 'summary.pscore'
nobs(object, ..., smpl = c("total", "cs"))
rg(object, ...)
## S3 method for class 'pscore'
rg(object, ..., smpl = c("total", "cs"))
## S3 method for class 'summary.pscore'
rg(object, ..., smpl = c("total", "cs"))
stdev(object, ...)
## S3 method for class 'pscore'
mean(x, ..., var_equal = c("none", "strat", "group", "both"))
## S3 method for class 'summary.pscore'
mean(x, ...)
## S3 method for class 'pscore'
stdev(object, ..., var_equal = c("none", "strata", "group", "both"))
## S3 method for class 'summary.pscore'
stdev(object, ..., var_equal = c("none", "strata", "group", "both"))
Arguments
formula |
a Formula object; the left-hand side should contain
two variables ( |
data |
a data frame |
maxiter |
the maximum number of iterations |
tol |
stratas are cut in halves as long as the hypothesis of
equal means is rejected at the |
link |
the link for the binomial glm estimation, either
|
... |
further arguments |
x , object |
a |
digits |
number of digits for the |
var_equal |
to compute the variance of the ATET, variances can
be computed at the class/group level ( |
format |
one of |
step |
for the |
smpl |
the sample to use, either the whole sample ( |
Value
an object of class "pscore"
, with the following elements:
-
strata
: a tibble containing the stratas, the frequencies, the means and the variances of the propensity scores for treated and controled observations -
cov_balance
: a tibble containing the results of the balancing tests for every covariate; the results for the class with the lowest p-value is reported -
unchecked_cov
: a character vector containing the names of the covariates for which the balancing test could be computed -
model
: a tibble containing the original data, with supplementary columns:gp_
for the groups,resp_
for the outcome andcls_
for the stratas -
pscore
: the glm model fitted to compute the propensity scores
References
Dehejia RH, Wahba S (2002). “Propensity Score-Matching Methods for Nonexperimental Causal Studies.” The Review of Economics and Statistics, 84(1), 151-161. ISSN 0034-6535, doi:10.1162/003465302317331982.
Becker SO, Ichino A (2002). “Estimation of average treatment effects based on propensity scores.” Stata Journal, 2(4), 358-377(20).
Examples
data_tuscany <- dplyr::mutate(dplyr::filter(twa, region == "Tuscany"),
dist2 = dist ^ 2, livselfemp = I((city == "livorno") * (occup == "selfemp")),
perm = ifelse(outcome == "perm", 1, 0))
formula_tuscany <- group | perm ~ city + sex + marital + age +
loc + children + educ + pvoto + training +
empstat + occup + sector + wage + hour + feduc + femp + fbluecol +
dist + dist2 + livselfemp
pscore(formula_tuscany, data_tuscany)