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 'matrix'
SLR_prediction(y, col_response = 1,
col_exploratory = 2, pre_x_value = mean(y[, col_exploratory]))
|
y |
a numeric |
col_response |
column number of the response variable within y (default is 1) |
col_exploratory |
column number of the exploratory variable within y (default is 2) |
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 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.