Description Usage Arguments Value Warning Author(s) Examples
View source: R/boot.cond.mean.per.R
Determines a confidence interval for a conditional mean in simple linear regression, using the percentile bootstrap method.
1 | boot.cond.mean.per(x, y, xp, conf.level = 0.95, R = 9999)
|
x |
a (nonempty) 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. |
This routine should be used only when bias is small and the sampling distribution is roughly symmetric, as indicated by the output of the bootstrap. Otherwise, use the BCa version.
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.per(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.per(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 PERCENTILE 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.4446 15.32613 1.12 0.251
CONFIDENCE Level Confidence.interval
INTERVAL 95% (419.3, 476.6)
RESULTS OF PERCENTILE 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 446.4453 14.79349 0.122 0.0273
CONFIDENCE Level Confidence.interval
INTERVAL 90% (422.9, 472.1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.