Skip to content
Prev 319341 / 398506 Next

Extracting the knots of a natural cubic spline fit

On Mar 12, 2013, at 2:59 PM, Rajat Tayal <rajat at igidr.ac.in> wrote:

            
Using the example from ?ns:

require(splines)
fm1 <- lm(weight ~ ns(height, df = 5), data = women)
list(weight, ns(height, knots = c(60.8, 63.6, 66.4, 69.2), Boundary.knots = c(58, 
72), intercept = FALSE))


or directly on the data:
20%  40%  60%  80% 
60.8 63.6 66.4 69.2
[1] 58 72



Regards,

Marc Schwartz