# NOT RUN {
# 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)
# model's predicted values against targets
predicted<-model$fitted.values
# using library ehaGoF for Goodness of Fit function (GoF)
library(ehaGoF)
# Goodness of Fit : Mean Absolute Deviation
gofMAD(targets, predicted, dgt=4)
# }
Run the code above in your browser using DataLab