Skip to contents

This function creates a regression result object containing the observed and predicted values, test design, test indices, and predictor.

Usage

regression_result(
  observed,
  predicted,
  testind = NULL,
  test_design = NULL,
  predictor = NULL
)

Arguments

observed

A vector of observed values.

predicted

A vector of predicted values.

testind

A vector of indices for the test data (optional).

test_design

The test design (optional).

predictor

The predictor used in the regression model (optional).

Value

A list with class attributes "regression_result", "classification_result", and "list" containing the observed and predicted values, test design, test indices, and predictor.

Examples

res <- regression_result(observed = c(1, 2, 3), predicted = c(1.1, 1.9, 3.2))
performance(res)
#>        R2      RMSE  spearcor 
#> 0.9814540 0.1414214 1.0000000