Description Usage Arguments Value Author(s) References Examples

Calculates and returns coefficient of determination (R-squared).

1 | ```
gofCoD(Obs, Prd, dgt = 3)
``` |

`Obs` |
Observed or measured values or target vector. |

`Prd` |
Predicted or fitted values by the model. Values produced by approximation or regression. |

`dgt` |
Number of digits in decimal places. Default is 3. |

`CoefficientofDetermination` |
Goodness of fit - coefficient of determination (R-squared) |

Prof. Dr. Ecevit Eyduran, TA. Alper Gulbe

Comparison of Different Data Mining Algorithms for Prediction of Body Weight From Several Morphological Measurements in Dogs - S Celik, O Yilmaz.

A new decision tree based algorithm for prediction of hydrogen sulfide solubility in various ionic liquids - Reza Soleimani, Amir Hossein Saeedi Dehaghani, Alireza Bahadori.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ```
# dummy inputs, independent variable
# integers from 0 to 99
inputs <- 0:99
# dummy targets/observed values, dependent variable
# a product of 2*times inputs minus 5 with some normal noise
targets <- -5 + inputs*1.2 + rnorm(100)
# linear regression model
model<-lm(targets~inputs)
# About the model
summary(model)
# model's predicted values against targets
predicted<-model$fitted.values
# using library ehaGoF for goodness of fit.
library(ehaGoF)
# Goodness of fit : coefficient of determination (R-squared)
gofCoD(targets, predicted)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.