delta.estimate {Rsurrogate} | R Documentation |
Calculates treatment effect
Description
This function calculates the treatment effect estimate, the difference in the average outcome in the treatment group minus the control group. This function is intended to be used for a fully observed continuous outcome. The user can also request a variance estimate, estimated using perturbating-resampling, and a 95% confidence interval. If a confidence interval is requested two versions are provided: a normal approximation based interval and a quantile based interval, both use perturbation-resampling.
Usage
delta.estimate(yone,yzero, var = FALSE, conf.int = FALSE, weight = NULL,
weight.perturb = NULL)
Arguments
yone |
numeric vector; primary outcome for treated observations. |
yzero |
numeric vector; primary outcome for control observations. |
var |
TRUE or FALSE; indicates whether a variance estimate for delta is requested, default is FALSE. |
conf.int |
TRUE or FALSE; indicates whether a 95% confidence interval for delta is requested, default is FALSE. |
weight |
a n1+n0 by x matrix of weights where n1 = length of yone and n0 = length of yzero, default is null; generally not supplied by use but only used by other functions. |
weight.perturb |
a n1+n0 by x matrix of weights where n1 = length of yone and n0 = length of yzero, default is null; generally used for confidence interval construction and may be supplied by user. |
Details
Let Y^{(1)}
and Y^{(0)}
denote the primary outcome under the treatment and primary outcome under the control,respectively. The treatment effect, \Delta
, is the expected difference in Y^{(1)}
compared to Y^{(0)}
, \Delta=E(Y^{(1)}-Y^{(0)}).
We estimate \Delta
as
\hat{\Delta}
= n_1^{-1} \sum_{i=1}^{n_1} Y_{1i} - n_0^{-1} \sum_{i=1}^{n_0} Y_{0i}
where Y_{1i}
is the observed primary outcome for person i
in the treated group, Y_{0i}
is the observed primary outcome for person i
in the control group, and n_1
and n_0
are the number of individuals in the treatment and control group, respectively. Randomized treatment assignment is assumed throughout this package.
Variance estimation and confidence interval construction are performed using perturbation-resampling. Specifically, let \left \{ V^{(b)} = (V_{11}^{(b)}, ...V_{1n_1}^{(b)}, V_{01}^{(b)}, ...V_{0n_0}^{(b)})^T, b=1,....,D \right \}
be n \times D
independent copies of a positive random variables V
from a known distribution with unit mean and unit variance. Let
\hat{\Delta}^{(b)} = \frac{ \sum_{i=1}^{n_1} V_{1i}^{(b)} Y_{1i}}{ \sum_{i=1}^{n_1} V_{1i}^{(b)}} - \frac{ \sum_{i=1}^{n_0} V_{0i}^{(b)} Y_{0i}}{ \sum_{i=1}^{n_0} V_{0i}^{(b)}}.
The variance of \hat{\Delta}
is obtained as the empirical variance of \{\hat{\Delta}^{(b)}, b = 1,...,D\}.
In this package, we use weights generated from an Exponential(1) distribution and use D=500
. We construct two versions of the 95\%
confidence interval for \hat{\Delta}
: one based on a normal approximation confidence interval using the estimated variance and another taking the 2.5th and 97.5th empirical percentiles of \hat{\Delta}^{(b)}
.
Value
A list is returned:
delta |
the estimate, |
var |
the variance estimate of |
conf.int.normal |
a vector of size 2; the 95% confidence interval for |
conf.int.quantile |
a vector of size 2; the 95% confidence interval for |
Author(s)
Layla Parast
Examples
data(d_example)
names(d_example)
delta.estimate(yone=d_example$y1, yzero=d_example$y0)