Learn R Programming

rbounds (version 0.2)

binarysens: Binary Sensitivity Test

Description

Function to calculate Rosenbaum bounds for binary data.

Usage

binarysens(x,y, Gamma=6, GammaInc=1)

Arguments

x
Number of successes in control group.
y
Number of successes in treatment group.
Gamma
Upper-bound on gamma parameter.
GammaInc
To set user specified increments for gamma parameter.

References

Rosenbaum, Paul R. (2002) Observational Studies. Springer-Verlag.

See Also

See also data.prep, psens, hlsens, Match, mcontrol

Examples

Run this code
#
# Example From Rosenbaum Observational Studies Pg 112
# Success: Died From Lung Cancer
# 110 Treated Successes
# 12 Control Successes
#
# Sensitivity Test
#
binarysens(12,100)

#
# Example Using Match()
#

#
#Load Matching Software and Data
#
library(Matching)
data(GerberGreenImai)

#
# Estimate Propensity Score
#
pscore.glm <- glm(PHN.C1 ~ PERSONS + VOTE96.1 + NEW + 
    MAJORPTY + AGE + WARD + PERSONS:VOTE96.1 + PERSONS:NEW + 
    AGE2, family = binomial(logit), data = GerberGreenImai)

#
#save data objects
#
D <- GerberGreenImai$PHN.C1
Y <- GerberGreenImai$VOTED98
X <- fitted(pscore.glm)

#
# Match
#
m.obj <- Match(Y = Y, Tr = D, X = X, M = 1)
summary(m.obj)

#
# One should check balance, but let's skip that step for now.
#

#
# Sensitivity Test
#
binarysens(m.obj, Gamma=2, GammaInc=.1)

Run the code above in your browser using DataLab