Learn R Programming

expirest (version 0.1.5)

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 the model contained 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 specifying 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", i.e. specifying the type of interval of interest. The default is "confidence".

ivl_type

A character string specifying 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 specifying if the “upper” or the “lower” limit is the relevant limit, i.e. either "upper" or "lower", respectively. The default is "lower".

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