psw.spec.test {PSW} | R Documentation |
Propensity score model specification test
Description
psw.spec.test
is used to test the sufficiency of propensity score model in balancing covariates between groups.
Usage
psw.spec.test(data, form.ps, weight, V.name, trans.type, K = 4)
Arguments
data |
data frame to be used. |
form.ps |
propensity score model. |
weight |
weighting method to be used. Available methods are |
V.name |
a vector of covariates on which the specification test is performed. |
trans.type |
a vector of the same length as |
K |
value of |
Details
In the data set, treatment indicator should be numerically specified such that a value of 1
indicates the treated
and a value of 0
indicates the control. The null hypothesis is that the propensity score model is correctly specified; the
alternative is that the propensity score model is misspecified. Therefore, this test is a goodness-of-fit test of propensity score model,
with the test statistic being a metric of covariate balance.
#'
Rejection of the specification test implies current propensity score model is inadquate
for balancing covariates between groups.
Value
A list of model specification test results.
weight |
weighting method. |
ps.model |
object returned by fitting the propensity score model using |
ps.hat |
estimated propensity score. |
W |
estimated propensity score weight. |
V.name |
covariates in the specification test. |
g.B1.hat |
a vector of transformed weighted average for covariates in the treated group when |
g.B0.hat |
a vector of transformed weighted average for covariates in the control group when |
B.hat |
difference between |
var.B.hat |
covariance matrix for |
test.stat |
test statistic for the specification test, which follows the |
df |
degree of freedom for the specification test, |
pvalue |
pvalue of the specification test when |
See Also
Examples
# Load the test data set
data(test_data);
# Propensity score model
form.ps <- "Z ~ X1 + X2 + X3 + X4";
# A vector of covariates
V.name <- c( "X1", "X2", "X3", "X4" );
# A vector of transformation types for covariates in V.name.
trans.type <- c( "identity", "identity", "logit", "logit" );
tmp <- psw.spec.test( data = test_data, form.ps = form.ps,
weight = "MW", V.name = V.name, trans.type = trans.type );