mgcv: Extract Knot Locations for `tp` smooth from a GAM model
问题 I am trying to extract the placement of the knots from a GAM model in order to delineate my predictor variable into categories for another model. My data contains a binary response variable (used) and a continuous predictor (open). data <- data.frame(Used = rep(c(1,0,0,0),1250), Open = round(runif(5000,0,50), 0)) I fit the GAM as such: mod <- gam(Used ~ s(Open), binomial, data = data) I can get the predicted values, and the model matrix etc with either type=c("response", "lpmatrix") within