Description Usage Arguments Value Examples
Create Predicted Values + Upper and Lower Bounds for Confidence Interval
1 | .get_pred(fit, new_data)
|
fit |
- model used for making predictions |
new_data |
- dataframe or matrix used for prediction |
- list of predictions and lower and upper bounds of confidence interval
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #Load data
data(mtcars)
#Create simple regression model
fit = stats::lm(mpg ~ wt, data = mtcars)
#Create new set of data for prediction
new_wt = seq(min(mtcars$wt), max(mtcars$wt))
new_data = data.frame(wt = new_wt)
#Use get_pred to get predictions and confidence bounds
mpg_pred = .get_pred(fit, new_data)
#Show output for predicted y
mpg_pred$fHat
#Show output for upper and lower bounds
mpg_pred$ub
mpg_pred$lb
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.