Usage
sensitivityHHS(z, s, y, bound = c("upper", "lower"), selection, groupings, empty.principal.stratum, ci = 0.95, ci.method = c("bootstrap", "analytic"), ci.type = "twoSided", custom.FUN = NULL, na.rm = FALSE, N.boot = 100, upperTest = FALSE, lowerTest = FALSE, twoSidedTest = TRUE, method = c("ACE", "T1", "T2"), isSlaveMode=FALSE)
Arguments
z
vector; contains the grouping values (e.g., treatment assignment)
for each record.
s
vector; indicates whether a record is selected.
y
vector; outcome values. Can be NA
for unselected records.
bound
vector; which bound should be calculated, upper and/or
lower. Partial string matching is performed.
selection
The value of s
indicating selection.
groupings
vector of two elements c(g0,g1)
; describes to
possible group values. The first element g0 being the value of
z
which delineates the first group, the last element g1
being the value of z
which delineates the second group.
empty.principal.stratum
vector of two elements c(s0,s1)
; describes the
s
values that select the empty principal stratum. If
empty.principal.stratum=c(s0,s1)
, then stratum
defined by $S(\var{g0}) = \var{s0}$ and
$S(\var{g1}) = \var{s1}$ is the empty stratum. In this example
s0 and s1 refer to the two possible values of
s
. (Note: method only works if
$\var{s0} != \var{s1}$).
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. Defaults to c("analytic","bootstrap")
.
Currently only works for bootstrap.
ci.type
character vector; type of confidence interval that the corisponding
ci
element is referring to. Can be upper,
lower, or twoSided. Defaults to
"twoSided"
.
custom.FUN
function; function to calculate custom result. mu0
,
mu1
, p0
, p1
are available to be used as
arguments in the custom function, where
$\code{mu0} = E(Y(\var{g0})|S(\var{g0}) = S(\var{g1}) = selected)$,
$\code{mu1} = E(Y(\var{g1})|S(\var{g0}) = S(\var{g1}) = selected)$,
$\code{p0} = P(S(\var{g0}) = selected)$, and
$\code{p1} = P(S(\var{g1}) = selected)$. The custom function
must return a single value.
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.
lowerTest
logical. Return the lower one sided p-value for returned tests. Defaults
to FALSE
upperTest
logical. Return the upper one sided p-value for returned tests. Defaults
to FALSE
twoSidedTest
logical. Return a two sided p-value for returned tests. Defaults
to TRUE
method
character vector; type of test statistic calculated. Can be one or
more of ACE, T1, or T2. Defaults to
"ACE"
.
isSlaveMode
logical; Internal Use only. Used in recursion.