predict.boot {FSA} | R Documentation |

Provides S3 methods to construct non-parametric bootstrap, hypothesis tests, predictions, and plots of the parameter estimates for `boot`

objects returned from `Boot`

from the car package.

## S3 method for class 'boot' predict(object, FUN, conf.level = 0.95, level = conf.level, digits = NULL, ...) ## S3 method for class 'boot' htest(object, parm = NULL, bo = 0, alt = c("two.sided", "less", "greater"), plot = FALSE, ...) ## S3 method for class 'boot' plot(x, ...)

`object, x` |
A |

`FUN` |
The function to be applied for the prediction. See the examples. |

`conf.level, level` |
A level of confidence as a proportion. |

`digits` |
A single numeric that indicates the number of digits for the result. |

`...` |
Additional items to send to functions. See details. |

`parm` |
A number or string that indicates which column of |

`bo` |
The null hypothesized parameter value. |

`alt` |
A string that indicates the “direction” of the alternative hypothesis. See details. |

`plot` |
A logical that indicates whether a histogram of the |

See `confint.boot`

in car for methods to construct confidence intervals from the bootstrapped results.

`predict`

applies a user-supplied function to each row of `object`

and then finds the median and the two quantiles that have the proportion (1-`conf.level`

)/2 of the bootstrapped predictions below and above. The median is returned as the predicted value and the quantiles are returned as an approximate 100`conf.level`

% confidence interval for that prediction. Values for the independent variable in `FUN`

must be a named argument sent in the ... argument (see examples). Note that if other arguments are needed in `FUN`

besides values for the independent variable, then these are included in the ... argument AFTER the values for the independent variable.

In `htest`

the “direction” of the alternative hypothesis is identified by a string in the `alt=`

argument. The strings may be `"less"`

for a “less than” alternative, `"greater"`

for a “greater than” alternative, or `"two.sided"`

for a “not equals” alternative (the DEFAULT). In the one-tailed alternatives the p-value is the proportion of bootstrapped parameter estimates in `object$coefboot`

that are extreme of the null hypothesized parameter value in `bo`

. In the two-tailed alternative the p-value is twice the smallest of the proportion of bootstrapped parameter estimates above or below the null hypothesized parameter value in `bo`

.

`htest`

returns a two-column matrix with the first column containing the hypothesized value sent to this function and the second column containing the corresponding p-value.

`plot`

constructs scatterplots of all pairs of bootstrapped parameter estimates.

`predict`

returns a matrix with one row and three columns, with the first column holding the predicted value (i.e., the median prediction) and the last two columns holding the approximate confidence interval.

Derek H. Ogle, derek@derekogle.com

S. Weisberg (2005). *Applied Linear Regression*, third edition. New York: Wiley, Chapters 4 and 11.

`Boot`

, `confint.boot`

, and `hist.boot`

in car.

data(Ecoli) fnx <- function(days,B1,B2,B3) { if (length(B1) > 1) { B2 <- B1[2] B3 <- B1[3] B1 <- B1[1] } B1/(1+exp(B2+B3*days)) } nl1 <- nls(cells~fnx(days,B1,B2,B3),data=Ecoli, start=list(B1=6,B2=7.2,B3=-1.45)) if (require(car)) { # for Boot() nl1.boot <- car::Boot(nl1,R=99) # B=99 too small to be useful confint(nl1.boot,"B1") confint(nl1.boot,c(2,3)) confint(nl1.boot,level=0.90) predict(nl1.boot,fnx,days=1:3) predict(nl1.boot,fnx,days=3) htest(nl1.boot,1,bo=6,alt="less") hist(nl1.boot) plot(nl1.boot) cor(nl1.boot$t) }

[Package *FSA* version 0.8.18 Index]