With $K$ knots $(t_1, \ldots, t_k)$ the restricted cubic spline can be written as
$\beta_0 + \beta_1X + \beta_2(X-t_1)^3_+ + \beta_3(X-t_2)^3_+ + \ldots + \beta_{k+1}(X-t_k)^3_+,$
with
$\beta_k = [\beta_2(t_1-t_k) + \beta_3(t_2-t_k)+ \ldots +\beta_{k-1}(t_{k-2} -t_k)] / (t_k -t_{k-1}),$
and
$\beta_{k+1} = [\beta_2(t_1-t_{k-1}) + \beta_3(t_2-t_{k-1})+ \ldots +\beta_{k-1}(t_{k-2} -t_{k-1})] / (t_{k-1} -t_{k}).$
When I specify glm(y ~ ns(x, df=3, intercept=FALSE), data = data, family = binomial())
in R
I obtain estimates for:
ns(x, df=3)1, ns(x, df=3)2, ns(x, df=3)3
since the intercept should not be included $\beta_0$ is removed. However which is the estimate for my linear term? $\beta_1$. Does the estimate for ns(x, df=3)1
correspond to $\beta_2$?