title: How to extract the underlying coefficients from fitting a linear b spline regression in R?
body: <p>Take for instance the following one-knot, degree one, spline:</p>
  
  <pre><code>library(splines)
  library(ISLR)
  
  age.grid    = seq(range(Wage$age)[1], range(Wage$age)[2])
  fit.spline  = lm(wage~bs(age, knots=c(30), degree=1), data=Wage)
  pred.spline = predict(fit.spline, newdata=list(age=age.grid), se=T)
  
  plot(Wage$age, Wage$wage, col="gray")
  lines(age.grid, pred.spline$fit, col="red")
  
  # NOTE: This is **NOT** the same as fitting two piece-wise linear models becase
  # the spline will add the contraint that the function is continuous at age=30
  # fit.1  = lm(wage~age, data=subset(Wage,age&lt;30))
  # fit.2  = lm(wage~age, data=subset(Wage,age&gt;=30))
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/idHs6.png" alt="Spline Plot"></p>
  
  <p>Is there a way to extract the linear model (and its coefficients) for before and after the knot?  That is, how can I extract the two linear models before and after the cut point of <code>age=30</code>?</p>
  
  <p>Using <code>summary(fit.spline)</code> yields coefficients, but (to my understanding) they are not meaningful for interpretation.</p>