lm.lincom.conf: Confidence Functions for the Expected Response of a Linear...

Description Usage Arguments Value References Examples

View source: R/lm.R

Description

Confidence functions for the expected response of a linear model under Gaussian noise assumptions.

Usage

1
lm.lincom.conf(mod, x, plot = TRUE, conf.level = 0.95)

Arguments

mod

an output from lm

x

a vector containing the predictor values for which the expected response is desired

plot

whether to plot the confidence density and curve

conf.level

the confidence level for the confidence interval indicated on the confidence curve

Value

A list containing the confidence functions pconf, dconf, cconf, and qconf for the expected response at x, as well as the P-curve and S-curve.

References

Tore Schweder and Nils Lid Hjort. Confidence, likelihood, probability. Vol. 41. Cambridge University Press, 2016.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Prediction of body fat percentage from other body measurements.

data(fat)

mod <- lm(body.fat ~ age + weight + height, data = fat)

# Confidence curve for the expected BFP of a 170lb, 6ft, 20-year old male

x <- c(1,    # Intercept
       20,   # 20 years old
       170,  # 170 lbs
       6*12) # 72 inches (6 feet)

m.conf <- lm.lincom.conf(mod, x)

ddarmon/clp documentation built on Jan. 25, 2021, 6:22 p.m.