Learn R Programming

JWileymisc (version 1.4.1)

modelPerformance: Return Indices of Model Performance

Description

Generic function. Generally returns things like fit indices, absolute error metrics, tests of overall model significance.

Usage

modelPerformance(object, ...)

as.modelPerformance(x)

is.modelPerformance(x)

# S3 method for lm modelPerformance(object, ...)

Value

A data.table with results.

A list with a data.table with the following elements:

Model

A character string indicating the model type, here lm

N_Obs

The number of observations

AIC

Akaike Information Criterion

BIC

Bayesian Information Criterion

LL

log likelihood

LLDF

log likelihood degrees of freedom

Sigma

Residual variability

R2

in sample variance explained

F2

Cohen's F2 effect size R2 / (1 - R2)

AdjR2

adjusted variance explained

F

F value for overall model significance test

FNumDF

numerator degrees of freedom for F test

FDenDF

denominator degrees of freedom for F test

P

p-value for overall model F test

Arguments

object

A fitted model object. The class of the model determines which specific method is called.

...

Additional arguments passed to specific methods.

x

A object (e.g., list or a modelPerformance object) to test or attempt coercing to a modelPerformance object.

Details

For lm class objects, return number of observations, AIC, BIC, log likelihood, R2, overall model F test, and p-value.

Examples

Run this code
modelPerformance(lm(mpg ~ qsec * hp, data = mtcars))

modelPerformance(lm(mpg ~ hp, data = mtcars))

if (FALSE) {
modelPerformance(lm(mpg ~ 0 + hp, data = mtcars))
modelPerformance(lm(mpg ~ 1, data = mtcars))
modelPerformance(lm(mpg ~ 0, data = mtcars))
}

Run the code above in your browser using DataLab