EVOLUTION-MANAGER
Edit File: linear.approx.html
<!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: Linear Approximation of Bootstrap Replicates</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 linear.approx {boot}"><tr><td>linear.approx {boot}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Linear Approximation of Bootstrap Replicates </h2> <h3>Description</h3> <p>This function takes a bootstrap object and for each bootstrap replicate it calculates the linear approximation to the statistic of interest for that bootstrap sample. </p> <h3>Usage</h3> <pre> linear.approx(boot.out, L = NULL, index = 1, type = NULL, t0 = NULL, t = NULL, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>boot.out</code></td> <td> <p>An object of class <code>"boot"</code> representing a nonparametric bootstrap. It will usually be created by the function <code>boot</code>. </p> </td></tr> <tr valign="top"><td><code>L</code></td> <td> <p>A vector containing the empirical influence values for the statistic of interest. If it is not supplied then <code>L</code> is calculated through a call to <code>empinf</code>. </p> </td></tr> <tr valign="top"><td><code>index</code></td> <td> <p>The index of the variable of interest within the output of <code>boot.out$statistic</code>. </p> </td></tr> <tr valign="top"><td><code>type</code></td> <td> <p>This gives the type of empirical influence values to be calculated. It is not used if <code>L</code> is supplied. The possible types of empirical influence values are described in the help for <code><a href="empinf.html">empinf</a></code>. </p> </td></tr> <tr valign="top"><td><code>t0</code></td> <td> <p>The observed value of the statistic of interest. The input value is used only if one of <code>t</code> or <code>L</code> is also supplied. The default value is <code>boot.out$t0[index]</code>. If <code>t0</code> is supplied but neither <code>t</code> nor <code>L</code> are supplied then <code>t0</code> is set to <code>boot.out$t0[index]</code> and a warning is generated. </p> </td></tr> <tr valign="top"><td><code>t</code></td> <td> <p>A vector of bootstrap replicates of the statistic of interest. If <code>t0</code> is missing then <code>t</code> is not used, otherwise it is used to calculate the empirical influence values (if they are not supplied in <code>L</code>). </p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Any extra arguments required by <code>boot.out$statistic</code>. These are needed if <code>L</code> is not supplied as they are used by <code>empinf</code> to calculate empirical influence values. </p> </td></tr></table> <h3>Details</h3> <p>The linear approximation to a bootstrap replicate with frequency vector <code>f</code> is given by <code>t0 + sum(L * f)/n</code> in the one sample with an easy extension to the stratified case. The frequencies are found by calling <code>boot.array</code>. </p> <h3>Value</h3> <p>A vector of length <code>boot.out$R</code> with the linear approximations to the statistic of interest for each of the bootstrap samples. </p> <h3>References</h3> <p>Davison, A.C. and Hinkley, D.V. (1997) <em>Bootstrap Methods and Their Application</em>. Cambridge University Press. </p> <h3>See Also</h3> <p><code><a href="boot.html">boot</a></code>, <code><a href="empinf.html">empinf</a></code>, <code><a href="control.html">control</a></code> </p> <h3>Examples</h3> <pre> # Using the city data let us look at the linear approximation to the # ratio statistic and its logarithm. We compare these with the # corresponding plots for the bigcity data ratio <- function(d, w) sum(d$x * w)/sum(d$u * w) city.boot <- boot(city, ratio, R = 499, stype = "w") bigcity.boot <- boot(bigcity, ratio, R = 499, stype = "w") op <- par(pty = "s", mfrow = c(2, 2)) # The first plot is for the city data ratio statistic. city.lin1 <- linear.approx(city.boot) lim <- range(c(city.boot$t,city.lin1)) plot(city.boot$t, city.lin1, xlim = lim, ylim = lim, main = "Ratio; n=10", xlab = "t*", ylab = "tL*") abline(0, 1) # Now for the log of the ratio statistic for the city data. city.lin2 <- linear.approx(city.boot,t0 = log(city.boot$t0), t = log(city.boot$t)) lim <- range(c(log(city.boot$t),city.lin2)) plot(log(city.boot$t), city.lin2, xlim = lim, ylim = lim, main = "Log(Ratio); n=10", xlab = "t*", ylab = "tL*") abline(0, 1) # The ratio statistic for the bigcity data. bigcity.lin1 <- linear.approx(bigcity.boot) lim <- range(c(bigcity.boot$t,bigcity.lin1)) plot(bigcity.lin1, bigcity.boot$t, xlim = lim, ylim = lim, main = "Ratio; n=49", xlab = "t*", ylab = "tL*") abline(0, 1) # Finally the log of the ratio statistic for the bigcity data. bigcity.lin2 <- linear.approx(bigcity.boot,t0 = log(bigcity.boot$t0), t = log(bigcity.boot$t)) lim <- range(c(log(bigcity.boot$t),bigcity.lin2)) plot(bigcity.lin2, log(bigcity.boot$t), xlim = lim, ylim = lim, main = "Log(Ratio); n=49", xlab = "t*", ylab = "tL*") abline(0, 1) par(op) </pre> <hr /><div style="text-align: center;">[Package <em>boot</em> version 1.3-22 <a href="00Index.html">Index</a>]</div> </body></html>