Learn R Programming

wBoot (version 1.0.3)

boot.cond.mean.per: Percentile Bootstrap Conditional Mean CI in Simple Linear Regression

Description

Determines a confidence interval for a conditional mean in simple linear regression, using the percentile bootstrap method.

Usage

boot.cond.mean.per(x, y, xp, conf.level = 0.95, R = 9999)

Arguments

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.

Value

  • A list with class "boot.regcor" containing the following components:
  • Boot.valuesthe point estimates (fits) obtained from the bootstrap.
  • Confidence.limitsthe upper and lower limits of the confidence interval.
  • Headerthe main title for the output.
  • Variable.1the predictor variable.
  • Variable.2the response variable.
  • nthe sample size.
  • Statisticthe name of the statistic, here fit.
  • Observedthe observed point estimate (fit).
  • Replicationsthe number of bootstrap replications.
  • Meanthe mean of the bootstrap values.
  • SEthe standard deviation of the bootstrap values.
  • Biasthe difference between the mean of the bootstrap values and the observed value.
  • Percent.biasthe percentage bias: 100*|Bias/Observed|.
  • Nullalways NULL for this function.
  • Alternativealways NULL for this function.
  • P.valuealways NULL for this function.
  • p.valuealways NULL for this function.
  • Levelthe confidence level.
  • Typealways NULL for this function.
  • Confidence.intervalthe confidence interval.
  • cor.anaa logical; always FALSE for this function.

Warning

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.

concept

  • Bootstrap
  • Percentile bootstrap
  • Simple linear regression
  • Confidence interval
  • Conditional mean in simple linear regression

Examples

Run this code
# 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

Run the code above in your browser using DataLab