library(earth);
fit.gcv <- earth(
formula = fev ~.,
data = fev,
degree = 5,
keepxy = TRUE
);
print(fit.gcv);
Selected 6 of 17 terms, and 4 of 4 predictors
Termination condition: Reached nk 21
Importance: height.inches, sexMale, age, smokeYes
Number of terms at each degree of interaction: 1 3 2
GCV 0.1487769 RSS 93.32458 GRSq 0.8024061 RSq 0.8098985