Percentile Bootstrap Conditional Mean CI in Simple Linear Regression

Share:

Description

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

Usage

1
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.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.

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.

Author(s)

Neil A. Weiss

Examples

 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

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.