Learn R Programming

PSAgraphics (version 2.1.3)

cstrata.psa: Supports Multiple Methods for Defining and Visualizing (PS) Strata

Description

Given propensity scores, allows strata to be directly user defined, possibly to: equalize sizes of strata, equalize the ranges of propensity scores, or to specify cut points on the unit interval. Once strata are created, a simple graphic is generated to visualize or judge strata for overlap and appropriateness. If a regression tree has been used, propensity scores are defined for each leaf of the tree.

Usage

cstrata.psa(
  treatment,
  propensity,
  strata = NULL,
  int = NULL,
  tree = FALSE,
  minsize = 2,
  graphic = TRUE,
  colors = c("dark blue", "dark green"),
  xlab = "Estimated Propensity Scores with Random Heights",
  pch = c(16, 16)
)

Value

Original.Strata

Table of strata-treatment sizes before minsize evaluation.

Used.Strata

Table of strata-treatment sizes after minsize evaluation.

strata

Vector of the same length as treatment, indicating either the strata input by user or those created by the function.

Arguments

treatment

Binary vector or factor defining the two treatments

propensity

Vector of same length as treatment containing estimated propensity scores.

strata

Either a vector of same length as treatment of predefined stratum number, or one integer n used to assign rows to n strata propensity scores, each of approximately the same number of cases. If relatively few unique propensity scores have been defined (as from a classification tree) then the logical tree should be set equal to TRUE.

int

Either a number m used to divide [0,1] into m equal length subintervals, or a vector containing cut points between 0 and 1 that define subintervals (perhaps as suggested by loess.psa). In either case the subintervals define strata, for which sizes can differ.

tree

Logical, default FALSE. If there are few unique propensity scores, say from a recursively partitioned tree, then TRUE forces strata to be defined by the unique propensity scores.

minsize

Smallest allowable stratum-treatment size. If violated, rows in the stratum are removed. User may wish to redefine strata.

graphic

Logical, default TRUE. If set to FALSE the graphic is not provided.

colors

2-ary color vector. Sets the colors of the points in the graphic. Default = c("blue", "orange")

xlab

Label for the x axis; default = "Estimated Propensity Scores with Random Heights".

pch

2-ary vector; determines the shape of points in the graphic. Default = c(16, 16).

Author

James E. Helmreich James.Helmreich@Marist.edu

Robert M. Pruzek RMPruzek@yahoo.com

KuangNan Xiong harryxkn@yahoo.com

See Also

cv.bal.psa, loess.psa

Examples

Run this code

data(lindner)
attach(lindner)
lindner.ps <- glm(abcix ~ stent + height + female +
      diabetic + acutemi + ejecfrac + ves1proc,
      data = lindner, family = binomial)
ps <- lindner.ps$fitted
cstrata.psa(abcix, ps, strata = 5)
cstrata.psa(abcix, ps, strata = 10)
cstrata.psa(abcix, ps, int = c(.37, .56, .87, 1))

Run the code above in your browser using DataLab