Survsens: Sensitivity Test for Matched Time to Event Outcomes

Description Usage Arguments References Examples

View source: R/Rfunctions.R

Description

This function performs sensitivity analysis for time to event outcomes in observational studies

Usage

1
2
Survsens(x, y = NULL, data = NULL, exp = NULL, outcome = NULL, failtime,
  Gamma, alpha = 0.05, Gammainterval, plot_title = NULL)

Arguments

x

name of the matching object. Should be either a Match or matchit object.

data

dataset.

exp

name of treatment variable.

outcome

name of outcome variable.

failtime

name of event time variable.

Gamma

upper bound for sensitivity parameter.

Gammainterval

value by which to increament sensitivity parameter from zero to Gamma

plot_title

main title of your plot.

References

Rosenbum 2011

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(toy)
psmodel <- glm(treated ~ covA + covB + covC + covD + covE + covF + Asqr + BC + BD, family=binomial(), data=toy)
toy$ps <- psmodel$fitted
toy$linps <- psmodel$linear.predictors
X <- toy$linps ## matching on the linear propensity score
Tr <- as.logical(toy$treated)
Y <- toy$out3.time
match1 <- Match(Y=Y, Tr=Tr, X=X, M = 1, replace=FALSE, ties=FALSE)
match.it <- matchit(treated ~ covA + covB + covC + covD + covE + covF + Asqr + BC + BD, data = toy, method='nearest', ratio=1)
Survsens(x= match.it,data =toy,exp='treated',outcome = 'out2',failtime = 'out3.time',Gamma=2.4,Gammainterval = 0.01,alpha = 0.05,plot_title = 'Time To Event Outcome Sensitivity Plot')

Ngendahimana/sensitivityR5 documentation built on June 24, 2020, 4:09 a.m.