I have around 500 observations with a binary outcome at 25% prevalence and will be building an internally validated prediction model. I want to use splines to model non linearity in my continuous predictors. This is a part of a theoretical exercise and so I’m trying a few different things but I am a little confused about the way I should approach this, given the following:
- if I want to use the rule of thumb of 10 Events Per Predictor (EPP) to guide sample size for the development set, is it okay to keep this in mind when choosing the type of spline basis and number of knots? This would be in order to keep the extra predictors that count towards the EPP to the minimum. Since I have 5 continuous predictors, I wouldn’t want to end up with most of my data having to be used for the development. What I mean is that, for example, natural cubic spline with 5 knots will give me 6 predictors to my count, whereas a quadratic piece wise with 1 knot will give 4. I am going by k+1 and k+4, respectively, and would appreciate being corrected if this is wrong.
- for the purpose of visualisation of the splines for each variable separately, does it make sense to first show non linearity on the logit scale, and then show plots of the spline curve on the probability scale? Is there a good way to visually show the fit that includes a scatter of data points?
I hope my questions make sense. My understanding of splines in general may not be the best but I couldn’t really find relevant information on these issues that would fully answer my questions.