Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/SLR_prediction.R
Predicting with a simple linear regression model
1 2 3 | ## S3 method for class 'numeric'
SLR_prediction(y, exploratory,
pre_x_value = mean(exploratory))
|
y |
a numeric vector (the response variable) |
exploratory |
a numeric vector (the exploratory variable with the same length as y) |
pre_x_value |
the numeric value (within the range of the exploratory vector) for which the prediction is made |
The function first builds a simple linear regression model with one response and one exploratory variable. Then the prediction for a given value of the exploratory variable (default the mean and no out of sample predictions) gets returned.
the predicted value of the response variable
Emanuel Sommer
1 2 3 4 5 | ##numeric S3 method
response <- c(1:5)
exploratory <- c(1,3,4.5,7,8)
special <- 6
SLR_prediction(response,exploratory,pre_x_value = special)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.