Learn R Programming

expirest (version 0.1.6)

get_intvl_limit: Confidence or prediction interval limit

Description

The function get_intvl_limit() calculates the upper or lower confidence or prediction interval limit(s) at a given value of \(x\).

Usage

get_intvl_limit(
  x_new,
  model,
  alpha = 0.05,
  ivl = "confidence",
  ivl_type = "one.sided",
  ivl_side = "lower"
)

Value

A numeric value or, if model contains a categorical variable, a numeric vector of the predicted upper or lower confidence or prediction interval limit(s) at a given value of \(x\).

Arguments

x_new

A numeric value of \(x\) at which the upper or lower confidence or prediction interval limit(s) should be calculated.

model

A linear model object of type ‘lm’.

alpha

A numeric value between 0 and 1 that specifies the significance level for the calculation of confidence or prediction intervals. The default is 0.05.

ivl

A character string of either "confidence" or "prediction" that specifies the type of interval of interest. The default is "confidence".

ivl_type

A character string that specifies if a “one sided” or a “two sided” interval should be calculated, i.e. either "one.sided" or "two.sided", respectively. The default is "one.sided".

ivl_side

A character string that specifies if the specification limit, given that the limit has only one side, is an “upper” or a “lower” bound, i.e. it is specified as either "upper" or "lower", respectively. The default is "lower". If the specification has two boundaries, then this parameter specifies the preferred side. If no side is preferred over the other, "both" can be used.

Details

The function get_intvl_limit() calculates the upper or lower confidence or prediction interval limit(s) for the linear regression model provided by model.

See Also