Description Usage Arguments Value Examples
View source: R/print_prediction.R
Given a model and data, print the predicted value.
1 | print_prediction(model, predict_data, ...)
|
model |
Model used to make the prediction |
predict_data |
Data used to make the prediciton |
... |
Any extra parameters to be passed the |
Nothing
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | {
job.satisfaction.data <- AdvancedRegression::job_satisfaction
#specifying reference levels
educ.rel <- relevel(job.satisfaction.data$educ, ref = "master")
gender.rel <- relevel(job.satisfaction.data$gender, ref = "F")
#fitting general linear model
fitted.model <- glm(score ~ gender.rel + age + educ.rel,
data = job.satisfaction.data,
family = gaussian(link = identity))
#using fitted model for prediction
print_prediction(fitted.model,
tibble::tibble(gender.rel = "F", age = 40, educ.rel = "bachelor"))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.