if (FALSE) {
data(wage1)
## Cross-validated model selection for spline degree and bandwidths Note
## - we override the default degree.max and segments.max here given the
## large number of predictors and small sample size (the tensor spline basis
## will become singular hampering search)
model <- crs(lwage~married+
female+
nonwhite+
educ+
exper+
tenure,
degree.max=5,
segments.max=5,
data=wage1)
summary(model)
## Partial mean plots (control for non axis predictors)
plot(model)
## Partial first derivative plots (control for non axis predictors)
plot(model,gradients = TRUE)
## Partial second derivative plots (control for non axis predictors)
plot(model,gradients = TRUE, gradient_order = 2)
}
Run the code above in your browser using DataLab