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 and
denote the primary outcome under the treatment and primary outcome under the control,respectively. The treatment effect,
, is the expected difference in
compared to
,
We estimate
as
where is the observed primary outcome for person
in the treated group,
is the observed primary outcome for person
in the control group, and
and
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 be
independent copies of a positive random variables
from a known distribution with unit mean and unit variance. Let
The variance of is obtained as the empirical variance of
In this package, we use weights generated from an Exponential(1) distribution and use
. We construct two versions of the
confidence interval for
: one based on a normal approximation confidence interval using the estimated variance and another taking the 2.5th and 97.5th empirical percentiles of
.
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)