goof: Goodness of fit measures

Description Usage Arguments Value Note Author(s) References Examples

View source: R/goof.R

Description

This function performs a number of model goodness of fit measures which include the root mean square error (RMSE), mean square error (MSE), prediction bias, coefficient of determination (R squared), concordance correlation coefficient (CCC), ratio of performance to deviation (RPD), ratio of performance to interquartile distance (RPIQ), and residual variance estimates. These goodness of fit measures are used in both digital soil mapping and soil chemometric studies to test the relative performance of competing models.

Usage

1
goof(observed,predicted, plot.it = FALSE, type="DSM")

Arguments

observed

numeric; a vector or matrix of values that are actual observations of some phenomenon.

predicted

numeric; a vector or matrix of values of predictions of the phenomenon that was observed .

plot.it

logical; If TRUE an xy-plot of the observations and predictions will be generated.

type

character; Selection from either “DSM” or “spec” to generate the goodness of fit statistics of greatest relevance to either digital soil mapping and soil spectroscopy respectively.

Value

Returns a dataframe with the goodness of fit statistics. The column headers of the dataframe are: R2 (coefficient of determination), concordance (concordance correlation coefficient), MSE (mean square error), RMSE (root mean square error), bias (prediction bias), MSEc (mean residual variance), RMSEc (root mean residual variance), RPD (ratio of performance to deviation), RPIQ (ratio of performance to interquartile distance). An xy-plot will also be generated if requested.

Note

These goodness of fit measures are not exclusive to digital soil mapping or soil spectroscopy.

Author(s)

Brendan Malone

References

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(ithir)
library(MASS)


#some data
data(USYD_soil1)

#fit a linear model
mod.1 <- lm(CEC ~ clay, data = USYD_soil1 , y = TRUE, x = TRUE)

#Goodness of fit
goof(observed = mod.1$y, predicted = mod.1$fitted.values, plot.it = TRUE)

ithir documentation built on May 2, 2019, 4:49 p.m.

Related to goof in ithir...