Description Usage Arguments Value Author(s) Examples
View source: R/boot.cond.mean.bca.R
Determines a confidence interval for a conditional mean in simple linear regression, using the BCa bootstrap method.
1 | boot.cond.mean.bca(x, y, xp, conf.level = 0.95, R = 9999)
|
x |
a (non-empty) numeric vector of predictor-variable data values. |
y |
the corresponding numeric vector of response-variable data values. |
xp |
the value of the predictor variable for which to find the CI for the conditional mean of the response variable. |
conf.level |
the confidence level (between 0 and 1); default is 0.95. |
R |
the number of bootstrap replications; default is 9999. |
A list with class "boot.regcor" containing the following components:
Boot.values |
the point estimates (fits) obtained from the bootstrap. |
Confidence.limits |
the upper and lower limits of the confidence interval. |
Header |
the main title for the output. |
Variable.1 |
the predictor variable. |
Variable.2 |
the response variable. |
n |
the sample size. |
Statistic |
the name of the statistic, here fit. |
Observed |
the observed point estimate (fit). |
Replications |
the number of bootstrap replications. |
Mean |
the mean of the bootstrap values. |
SE |
the standard deviation of the bootstrap values. |
Bias |
the difference between the mean of the bootstrap values and the observed value. |
Percent.bias |
the percentage bias: 100*|Bias/Observed|. |
Null |
always NULL for this function. |
Alternative |
always NULL for this function. |
P.value |
always NULL for this function. |
p.value |
always NULL for this function. |
Level |
the confidence level. |
Type |
always NULL for this function. |
Confidence.interval |
the confidence interval. |
cor.ana |
a logical; always FALSE for this function. |
Neil A. Weiss
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # Lot size, house size, and value for a sample of homes in a particular area.
data("homes")
str(homes)
attach(homes)
# 95% (default) CI for the conditional mean value of a 3000 sq.ft. home,
# with 999 bootstrap replications.
boot.cond.mean.bca(HOUSE.SIZE, VALUE, 3000, R = 999)
# 90% CI for the conditional mean value of a 3000 sq.ft. home, with
# 999 bootstrap replications.
boot.cond.mean.bca(HOUSE.SIZE, VALUE, 3000, conf.level = 0.90, R = 999)
detach(homes) # clean up
|
Loading required package: boot
Loading required package: simpleboot
Simple Bootstrap Routines (1.1-7)
'data.frame': 44 obs. of 3 variables:
$ HOUSE.SIZE: num 2311 2968 3773 1934 5466 ...
$ LOT.SIZE : num 2.37 2.09 2.21 2.21 2.1 2.06 2.03 2.44 2.14 2.63 ...
$ VALUE : num 396 355 586 254 646 278 279 748 546 338 ...
RESULTS OF BCa BOOTSTRAP FOR CONDITIONAL MEAN CORRESPONDING TO HOUSE.SIZE = 3000
SUMMARY Predictor Response n Statistic Observed
STATISTICS HOUSE.SIZE VALUE 44 Fit 446.3234
BOOTSTRAP Replications Mean SE Bias Percent.bias
SUMMARY 999 447.1873 15.38971 0.864 0.194
CONFIDENCE Level Confidence.interval
INTERVAL 95% (414.3, 474.6)
RESULTS OF BCa BOOTSTRAP FOR CONDITIONAL MEAN CORRESPONDING TO HOUSE.SIZE = 3000
SUMMARY Predictor Response n Statistic Observed
STATISTICS HOUSE.SIZE VALUE 44 Fit 446.3234
BOOTSTRAP Replications Mean SE Bias Percent.bias
SUMMARY 999 448.2229 15.48995 1.9 0.426
CONFIDENCE Level Confidence.interval
INTERVAL 90% (419.1, 469.4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.