Learn R Programming

sensitivityPStrat (version 1.0-6)

sensitivitySGD: principal stratification sensitivity analysis with time to event data relaxing monotonicity assumption.

Description

Principal stratification sensitivity analysis with time to event data relaxing monotonicity as described by Shepherd, Gilbert, and Dupont (in press).

Usage

sensitivitySGD(z, s, d, y, v, beta0, beta1, phi, Pi, psi, tau, time.points, selection, trigger, groupings, followup.time, ci=0.95, ci.method = c("bootstrap", "analytic"), ci.type="twoSided", custom.FUN = NULL, na.rm = FALSE, N.boot = 100L, N.events = NULL, interval = c(-100, 100), upperTest = FALSE, lowerTest = FALSE, twoSidedTest=TRUE, inCore = TRUE,verbose = getOption("verbose"), colsPerFile = 1000L, isSlaveMode = FALSE)

Arguments

z
vector; contains the grouping values (e.g., treatment assignment) for each record.
s
vector; indicates whether a record is selected.
d
vector; indicates whether a post-selection event has occurred. Can be NA for unselected records.
y
vector; the length of time from selection until event (d) or censoring. Can be NA for unselected records.
v
numeric vector; the length of time from randomization until selection or censoring.
beta0
numeric vector; values of the sensitivity parameter $\beta$ linking outcome in group g0 with selection if assigned group g1.
beta1
numeric vector; values of the sensitivity parameter $\beta$ linking outcome in group g1 with selection if assigned group g0.
phi, Pi, psi
vectors; sensitivity parameters specifying the joint distribution of $S(\var{g0})$, $S(\var{g1})$. Only one of the three parameters should be specified. psi is the log-odds ratio of selection. Pi is the probability of being in the always selected principal stratum ($Pr(S(\var{g0}) = S(\var{g1}) = selected)$). phi is the probability of selection in group g0 given selection in group g1 ($Pr(S(\var{g0}) = 1|S(\var{g1}) = 1)$).
tau
maximum observed follow-up time after selection. Selection weights are constant for $\var{t}>\code{tau}$.
time.points
vector; time points, t, at which $SCE(\var{t})$ will be estimated.
selection
The value of s indicating selection.
trigger
The value of d that denotes the post-selection event.
groupings
Vector of two elements c(g0,g1), the first element g0 being the value of z the delineates the first group, the last element g1 being the value of z which delineates the second group.
followup.time
numeric value; cut-off point for v after which records are lost to censoring.
ci
numeric vector; confidence interval level, defaults to 0.95.
ci.method
character; method by which the confidence interval and variance are calculated. Can be “analytic” or “bootstrap”. Currently only works for “bootstrap”.
ci.type
character vector; type of confidence interval that the corresponding ci element is refering to. Can be “upper”, “lower”, or “twoSided”. Defaults to "twoSided".
custom.FUN
function; function to calculate custom result. Fas0, Fas1, time.points, p0, p1 are available to be used as arguments in the custom function. The custom function must return a vector of elements that is the same length as time.points.
na.rm
logical; indicates whether records that are invalid due to NA values should be removed from the data set.
N.boot
integer; number of bootstrap repetitions that will be run when ci.method includes “bootstrap”.
N.events
integer; number of selection-events (S) for each bootstrap replication when doing selection-event based bootstrapping.
interval
numeric vector of length 2. Controls the range limits used to by optimize to estimate $\alpha$.
lowerTest
logical. Return the lower one sided p-value for SCE. Defaults to FALSE
upperTest
logical. Return the upper one sided p-value for SCE. Defaults to FALSE
twoSidedTest
logical. Return a two sided p-value for SCE. Defaults to TRUE
verbose
logical; prints dots when bootstrapping to show that something is happening. Bootstrapping can take a long time.
inCore
logical; running in memory if TRUE, running with scratch files if FALSE. Default is TRUE. For large data analysis, the user may want to switch this to FALSE to allow for processing on data sets larger than can fit in memory.
colsPerFile
integer; number of columns of the scratch file to process in each pass (e.g., 100 columns).
isSlaveMode
logical. Internal Use only. Used in recursion.

Value

object of class sensitivity3d
SCE
array; Calculated values of SCE for all combinations of the values from beta0, beta1, phi/Pi/psi, and time.points. Array dimensions are length(time.points), length(beta0), length(beta1), length(psi).
SCE.ci
array; Confidence interval of the SCE value. Confidence interval determined by quantile if using ci.method “bootstrap”. Otherwise calculated using analytic variance with large sample normal approximation. Array dimensions the same as element SCE.
SCE.var
array; estimated variance of SCE. Array dimensions the same as element SCE.
beta0
vector; $\beta$ values used for first group.
beta1
vector; $\beta$ values used for second group.
psi
vector; $\psi$ values used.
Pi
vector; $Pi$ values used.
psi
vector; $psi$ values used.
ci.map
list; mapping of confidence interval to quantile probability. Use numbers contained within as indices to the SCE.ci element.

Details

Performs a sensitivity analysis estimating the “survival causal effect” among those who would have been selected regardless of treatment assignment (SCE) without assuming monotonicity (i.e., that one of the principal stratum is empty). The method assumes no interference (i.e., potential outcomes of all subjects are unaffected by treatment assignment of other subjects), ignorable (i.e., random) treatment assignment, and independent censoring (i.e., time from selection to event is independent of time from selection until censoring). SCE is identified by assuming values for the sensitivity parameters beta0, beta1, and one of the parameters phi, psi, or Pi. The sensitivity parameters beta0 and beta1 have a log-odds ratio interpretation (see help for sensitivityGBH). Given selection in one treatment arm, the probability of selection if in the other treatment arm is assumed to be constant for for $T(\code{z})>\code{tau}$. Only one of the parameters phi, psi, or Pi should be specified as all depend on each other. psi is unrestrained taking any value on the real line. The other parameters, phi and Pi have constraints and there will be estimation problems if these parameters are set at values outside the of their range of acceptable values based on the observed data. See Shepherd, Gilbert, Dupont (in press) for more details.

References

Shepherd BE, Gilbert PB, and Dupont CT, “Sensitivity analyses comparing time-to-event outcomes only existing in a subset selected postrandomization and relaxing monotonicity,” Biometrics, in press.

See Also

sensitivitySGL, sensitivityJR, Surv

Examples

Run this code

data(vaccine.trial)
sens.analysis<-with(vaccine.trial,
                sensitivitySGD(z=treatment, s=hiv.outcome, y=followup.yearsART,
                          d=ARTinitiation, beta0=c(0,-.25,-.5),
                          beta1=c(0, -.25, -.5), phi=c(0.95, 0.90), tau=3,
                          time.points=c(2,3), selection="infected",
                          trigger="initiated ART",
                          groupings=c("placebo","vaccine"), ci=.95,
                          ci.method="bootstrap", N.boot=100)
               )
sens.analysis


sens.analysis2<-with(vaccine.trial,
                sensitivitySGD(z=treatment, s=hiv.outcome, y=followup.yearsART,
                          d=ARTinitiation, beta0=c(0,-.25,-.5),
                          beta1=c(0, -.25, -.5), phi=c(0.95, 0.90), tau=3,
                          time.points=c(2,3), selection="infected",
                          trigger="initiated ART",
                          groupings=c("placebo","vaccine"), ci=.95,
                          custom.FUN=function(Fas0,Fas1,...,time.points) {
                            Fas0(time.points) - Fas1(time.points)
                          },
                          ci.method="bootstrap", N.boot=100)
               )
sens.analysis2

Run the code above in your browser using DataLab