Accuracy Function - R Documentation
Accuracy Function - R Documentation
Accuracy Function - R Documentation
TRUE
plot
1 of 3 4/12/2020, 4:45 AM
accuracy function | R Documentation https://www.rdocumentation.org/packages/rcompanion/versions/2.3.25/t...
lm
# NOT RUN {
data(BrendonSmall)
BrendonSmall$Calories = as.numeric(BrendonSmall$Calories)
BrendonSmall$Calories2 = BrendonSmall$Calories ^ 2
model.1 = lm(Sodium ~ Calories, data = BrendonSmall)
model.2 = lm(Sodium ~ Calories + Calories2, data = BrendonSmall)
model.3 = glm(Sodium ~ Calories, data = BrendonSmall, family="Gamma")
quadplat = function(x, a, b, clx) {
ifelse(x < clx, a + b * x + (-0.5*b/clx) * x * x,
a + b * clx + (-0.5*b/clx) * clx * clx)}
model.4 = nls(Sodium ~ quadplat(Calories, a, b, clx),
data = BrendonSmall,
start = list(a=519, b=0.359, clx = 2300))
accuracy(list(model.1, model.2, model.3, model.4), plotit=FALSE)
2 of 3 4/12/2020, 4:45 AM
accuracy function | R Documentation https://www.rdocumentation.org/packages/rcompanion/versions/2.3.25/t...
# }
3 of 3 4/12/2020, 4:45 AM