Description Usage Arguments Details Value See Also Examples
psw.spec.test
is used to test the sufficiency of propensity score model in balancing covariates between groups.
1 | psw.spec.test(data, form.ps, weight, V.name, trans.type, K = 4)
|
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 K in ω(e_i) = min(1, K min(e_i, 1-e_i)) for |
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.
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 χ^2_{df} distribution under the null, available when |
df |
degree of freedom for the specification test, |
pvalue |
pvalue of the specification test when |
psw, psw.balance
1 2 3 4 5 6 7 8 9 10 | # 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 );
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.