pred_int_tdist: Prediction interval for a 'numeric' based on the...

Description Usage Arguments Details Value See Also Examples

View source: R/pred_int_tdist.R

Description

Simple wrapper for 'lm' and 'predict' which returns a prediction interval. This method assumes iid normally distributed observations.

Usage

1
pred_int_tdist(x, level = 0.95, interval = c("prediction", "confidence"))

Arguments

x

should be an object of class "numeric"

level

coverage level with default 0.95

interval

type of interval, by default is "prediction"

Details

Calculate prediction interval based on the t-distribution. It uses 'lm' and 'predict'

the prediction is at the mean of 'x'. Missing values are not allowed.

Value

a prediction interval

See Also

function 'lm' and 'predict.lm'

Examples

1
2
3
4
5
6
## Not run: 
## Prediciton interval for simulated data
x <- rnorm(100)
pdi <- pred_int_tdist(x) 

## End(Not run)

femiguez/predintma documentation built on July 5, 2021, 4:16 a.m.