regressionEvaluation: Evaluate Regression Model Results

Description Usage Arguments Value Examples

View source: R/regressionEvaluation.R

Description

Evaluate the performance of a regression model.

Usage

1
2
regressionEvaluation(obs, pred, model = NULL, sample_size = 1000,
  seed = 1234)

Arguments

obs

A vector of actual outcomes.

pred

A vector of fitted values.

model

Optional, the model used to predict fitted values from actual outcomes.

sample_size

the maximum sample size, in numbers or percents of total observations, will be used to visualise regression effects.

seed

Random seeds for reproducibility.

Value

A list of data.table and ggplot2

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
data(mtcars)
fit <- glm(mpg ~ cyl + disp + hp + drat, data=as.data.frame(mtcars), family = gaussian())
actuals <- mtcars$mpg
probs <- predict(fit, mtcars)
res <- regressionEvaluation(pred = probs,
obs = actuals,
model = fit,
sample_size=1e5,
seed = 1234)
res$descriptive_statistics
res$goodness_of_fit
res$model_details
res$visualisation$residual_vs_fitted
res$visualisation$residual_vs_order
res$visualisation$histograms
res$visualisation$prediction_intervals
res$check_model_assumptions

ivanliu1989/RQuant documentation built on Sept. 13, 2019, 11:53 a.m.