Skip to content
Back to formatted view

Raw Message

Message-ID: <CAO-mjT_bfndYXEtPXvzOiemwfz11rfvTDHaHNRvsAgNWbOAiJQ@mail.gmail.com>
Date: 2013-03-12T19:59:35Z
From: Rajat Tayal
Subject: Extracting the knots of a natural cubic spline fit

Dear list members,

I am trying to fit a natural cubic spline to my dataset using the ns
function in the splines package.
Specifically, I do:

library(splines)
lm(y ~ ns(x, df=3), data =data)

How do I extract the values of the interior knots of the fitted spline ?

Thanks,

Rajat

-------------------------------------------------------------------------
Rajat Tayal
Ph.D Research Scholar
Indira Gandhi Institute of Development Research,
Gen A.K.Vaidya Marg, Goregaon (East)
Mumbai