Build data and AI skills | 50% off

Last chance! 50% off unlimited learning

Sale ends in


wBoot (version 1.0.3)

boot.cond.mean.bca: BCa Bootstrap Conditional Mean CI in Simple Linear Regression

Description

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

Usage

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

Arguments

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.

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.

concept

  • Bootstrap
  • BCa 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.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

Run the code above in your browser using DataLab