# NOT RUN {
# Input values, independent variable
input <- 0:4
# Target vector, observed values, dependent variable
target <- c(1.9, 4.1, 5.89, 7.9, 10.01)
# Simple linear regression, target across input like: target = a * input + b,
# where a and b are coefficients.
model <- lm(target~input)
# Information about the model
summary(model)
# Values predicted by the model
predicted <- predict(model)
# using library ehaGoF for goodness of fit
library(ehaGoF)
# Goodness of fit - relative root mean square error (RRMSE)
gofRRMSE(target, predicted)
# }
Run the code above in your browser using DataLab