Learn R Programming

twang (version 0.6-1)

dx.wts: Propensity score diagnostics

Description

dx.wts takes a ps object or a set of propensity scores and computes diagnostics assessing covariates balance.

Usage

dx.wts(x,
       data,
       vars=NULL,
       treat.var,
       x.as.weights=TRUE,
       sampw=NULL,
       perm.test.iters=0,
       plots=TRUE,
       title)

Arguments

x
a data frame, matrix, or vector of propensity score weights or a ps object. x can also be a data frame, matrix, or vector of propensity scores if x.as.weights=FALSE
data
a data frame
vars
a vector of character strings naming variables in data on which to assess balance
treat.var
a character string indicating which variable in data contains the 0/1 treatment group indicator
x.as.weights
TRUE or FALSE indicating whether x specifies propensity score weights or propensity scores. Ignored if x is a ps object
sampw
optional sampling weights. If x is a ps object then the sampling weights should have been passed to ps and not specified here. dx.wts will issue a warni
perm.test.iters
an non-negative integer giving the number of iterations of the permutation test for the KS statistic. If perm.test.iters=0 then the function returns an analytic approximation to the p-value. This argument is ignored
plots
if plots=TRUE then dx.wts will call diag.plot generating diagnostic plots
title
a short text title, it will be used in plots and saved files. By default this is set to the current date and time

Value

  • Returns a list containing
  • treatthe vector of 0/1 treatment assignment indicators
  • desca nested list containing detailed diagnostic information on the weights. This includes the number of treatment and control subjects, the effective sample size, the largest KS statistic, the average absolute effect size, and the complete balance table
  • summary.taba data frame showing balance information
  • psthe given propensity scores
  • wthe given weights
  • datestampthe date and time of the call to dx.wts
  • parametersthe parameters used when calling dx.wts
  • alertstext containing any warnings accumulated during the estimation

Details

Creates a balance table that compares unweighted and weighted means and standard deviations, computes effect sizes, and KS statistics to assess the ability of the propensity scores to balance the treatment and control groups.

See Also

The example for ps contains an example of the use of dx.wts, diag.plot