if (FALSE) {
library(MASS)
data(Rubber)
# do a variable and shape selection with four possible shapes
# increasing, decreasing, convex and concave
ans <- ShapeSelect(loss ~ shapes(hard, set = c("incr", "decr", "conv", "conc"))
+ shapes(tens, set = c("incr", "decr", "conv", "conc")), data = Rubber, genetic = TRUE)
# check the best fit, which is an object of the cgam class
bf <- best.fit(ans)
class(bf)
plotpersp(bf)
}
Run the code above in your browser using DataLab