<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Calculates model-based or robust residual treatment effect</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="R.css" />
</head><body>

<table width="100%" summary="page for delta.s.estimate"><tr><td>delta.s.estimate</td><td style="text-align: right;">R Documentation</td></tr></table>

<h2>

Calculates model-based or robust residual treatment effect
</h2>

<h3>Description</h3>


<p>This function calculates the model-based or robust estimate of the residual treatment effect i.e. the hypothetical treatment effect if the distribution of the surrogate in the treatment group looks like the distribution of the surrogate in the control group. Ideally, this function is only used as a helper function and is not directly called. 
</p>


<h3>Usage</h3>

<pre>
delta.s.estimate(sone, szero, yone, yzero, weight.perturb = NULL, number="single",
type="robust", warn.te = FALSE, warn.support = FALSE, extrapolate = FALSE, 
transform = FALSE)
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>sone</code></td>
<td>


<p>numeric vector or matrix; surrogate marker for treated observations, assumed to be continuous. If there are multiple surrogates then this should be a matrix with <i>n_1</i> (number of treated observations) rows and n.s (number of surrogate markers) columns.
</p>
</td></tr>
<tr valign="top"><td><code>szero</code></td>
<td>


<p>numeric vector or matrix; surrogate marker for control observations, assumed to be continuous. If there are multiple surrogates then this should be a matrix with <i>n_0</i> (number of control observations) rows and n.s (number of surrogate markers) columns. 
</p>
</td></tr>
<tr valign="top"><td><code>yone</code></td>
<td>


<p>numeric vector; primary outcome for treated observations.
</p>
</td></tr>
<tr valign="top"><td><code>yzero</code></td>
<td>


<p>numeric vector; primary outcome for control observations.
</p>
</td></tr>
<tr valign="top"><td><code>weight.perturb</code></td>
<td>


<p>a <i>n_1+n_0</i> by x matrix of weights where <i>n_1 = </i> length of yone and <i>n_0 = </i> length of yzero; generally used for variance estimation and confidence interval construction, default is null.
</p>
</td></tr>
<tr valign="top"><td><code>number</code></td>
<td>


<p>specifies the number of surrogate markers; choices are &quot;multiple&quot; or &quot;single&quot;, default is &quot;single&quot;. 
</p>
</td></tr>
<tr valign="top"><td><code>type</code></td>
<td>


<p>specifies the type of estimation; choices are &quot;robust&quot; or &quot;model&quot;, default is &quot;robust&quot;.
</p>
</td></tr>
<tr valign="top"><td><code>warn.te</code></td>
<td>


<p>value passed from R.s.estimate function to control warnings; user does not need to specify.
</p>
</td></tr>
<tr valign="top"><td><code>warn.support</code></td>
<td>


<p>value passed from R.s.estimate function to control warnings; user does not need to specify.
</p>
</td></tr>
<tr valign="top"><td><code>extrapolate</code></td>
<td>


<p>TRUE or FALSE; indicates whether the user wants to use extrapolation.
</p>
</td></tr>
<tr valign="top"><td><code>transform</code></td>
<td>


<p>TRUE or FALSE; indicates whether the user wants to use a transformation for the surrogate marker. 
</p>
</td></tr>
</table>


<h3>Details</h3>


<p>Details are included in the documentation for R.s.estimate.
</p>


<h3>Value</h3>






<p><i>\hat{&Delta;}_S</i>, the model-based or robust residual treatment effect estimate.
</p>


<h3>Note</h3>

<p>If the treatment effect is not significant, the user will receive the following message: &quot;Warning: it looks like the treatment effect is not significant; may be difficult to interpret the residual treatment effect in this setting&quot;. In the single marker case with the robust estimation approach, if the observed support of the surrogate marker for the control group is outside the observed support of the surrogate marker for the treatment group, the user will receive the following message: &quot;Warning: observed supports do not appear equal, may need to consider a transformation or extrapolation&quot;.</p>


<h3>Author(s)</h3>


<p>Layla Parast
</p>


<h3>References</h3>


<p>Parast, L., McDermott, M., Tian, L. (2015). Robust estimation of the proportion of treatment effect explained by surrogate marker information. Statistics in Medicine, 35(10):1637-1653.
</p>
<p>Wang, Y., &amp; Taylor, J. M. (2002). A measure of the proportion of treatment effect explained by a surrogate marker. Biometrics, 58(4), 803-812.
</p>


<h3>Examples</h3>

<pre>
data(d_example)
names(d_example)
delta.s.estimate(yone=d_example$y1, yzero=d_example$y0, sone=d_example$s1.a, szero=
d_example$s0.a, number = "single", type = "robust")
delta.s.estimate(yone=d_example$y1, yzero=d_example$y0, sone=d_example$s1.a, szero=
d_example$s0.a, number = "single", type = "model")
delta.s.estimate(yone=d_example$y1, yzero=d_example$y0, sone=cbind(d_example$s1.a, 
d_example$s1.b, d_example$s1.c), szero=cbind(d_example$s0.a, d_example$s0.b, d_example$s0.c), 
number = "multiple", type = "robust")
delta.s.estimate(yone=d_example$y1, yzero=d_example$y0, sone=cbind(d_example$s1.a, 
d_example$s1.b, d_example$s1.c), szero=cbind(d_example$s0.a, d_example$s0.b, d_example$s0.c),
number = "multiple", type = "model")
</pre>


</body></html>
