a <- earth(Volume~ ., data = trees)
summary(a, digits = 2)
# yields:
# Call:
# earth(formula = Volume ~ ., data = trees)
#
# Expression:
# 23
# + 5.7 * pmax(0, Girth - 13)
# - 2.9 * pmax(0, 13 - Girth)
# + 0.72 * pmax(0, Height - 76)
#
# Number of cases: 31
# Selected 4 of 5 terms, and 2 of 2 predictors
# Number of terms at each degree of interaction: 1 3 (additive model)
# GCV: 11 RSS: 213 GRSq: 0.96 RSq: 0.97
Run the code above in your browser using DataLab