
Last chance! 50% off unlimited learning
Sale ends in
bootCase
objects from the ## S3 method for class 'bootCase':
confint(object, parm = NULL, level = conf.level,
conf.level = 0.95, plot = FALSE, err.col = "black", err.lwd = 2,
rows = NULL, cols = NULL, ...)
## S3 method for class 'bootCase':
predict(object, FUN, MARGIN = 1, conf.level = 0.95,
digits = NULL, ...)
## S3 method for class 'bootCase':
htest(object, parm = NULL, bo = 0, alt = c("two.sided",
"less", "greater"), plot = FALSE, ...)
## S3 method for class 'bootCase':
hist(x, same.ylim = TRUE, ymax = NULL,
rows = round(sqrt(ncol(x))), cols = ceiling(sqrt(ncol(x))), ...)
## S3 method for class 'bootCase':
plot(x, ...)
bootCase
object.object
contains the parameter estimates to use for the confidence interval or hypothesis test.conf.level
.confint
then a histogram of the parm
parameters from the bootstrap samples with error bars that illustrate the bootstrapped confidence intervals will be constructFUN
is applied. MARGIN=1
will apply to each row and is the default.TRUE
. Ignored if ylmts
is non-null.object
is a matrix, then confint
returns a matrix with as many rows as columns (i.e., parameter estimates) in object
and two columns of the quantiles that correspond to the approximate confidence interval. If object
is a vector, then confint
returns a vector with the two quantiles that correspond to the approximate confidence interval.
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.
hist
constructs histograms of the bootstrapped parameter estimates.
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.confint
finds the two quantiles that have the (1-conf.level
)/2 proportion of bootstrapped parameter estimates below and above. This is an approximate 100conf.level
% confidence interval.
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 100conf.level
% confidence interval for that prediction.
In htest
the alt=
argument. The strings may be "less"
for a "greater"
for a "two.sided"
for a 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
.bootCase
in 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 bootCase()
nl1.boot <- car::bootCase(nl1,B=99) # B=99 too small to be useful
confint(nl1.boot,"B1")
confint(nl1.boot,c(2,3))
confint(nl1.boot,conf.level=0.90)
predict(nl1.boot,fnx,days=3)
htest(nl1.boot,1,bo=6,alt="less")
hist(nl1.boot)
plot(nl1.boot)
cor(nl1.boot)
}
Run the code above in your browser using DataLab