title: How `poly()` generates orthogonal polynomials? How to understand the "coefs" returned?
body: <p>My understanding of orthogonal polynomials is that they take the form</p>
  
  <p><em>y(x) = a1 + a2(x - c1) + a3(x - c2)(x - c3) + a4(x - c4)(x - c5)(x - c6)...</em> up to the number of terms desired</p>
  
  <p>where <em>a1</em>, <em>a2</em> <em>etc</em> are coefficients to each orthogonal term (vary between fits), and <em>c1</em>, <em>c2</em> <em>etc</em> are coefficients within the orthogonal terms, determined such that the terms maintain orthogonality (consistent between fits using the same <em>x</em> values)</p>
  
  <p>I understand <code>poly()</code> is used to fit orthogonal polynomials. An example</p>
  
  <pre><code>x = c(1.160, 1.143, 1.126, 1.109, 1.079, 1.053, 1.040, 1.027, 1.015, 1.004, 0.994, 0.985, 0.977) # abscissae not equally spaced
  
  y = c(1.217395, 1.604360, 2.834947, 4.585687, 8.770932, 9.996260, 9.264800, 9.155079, 7.949278, 7.317690, 6.377519, 6.409620, 6.643426)
  
  # construct the orthogonal polynomial
  orth_poly &lt;- poly(x, degree = 5)
  
  # fit y to orthogonal polynomial
  model &lt;- lm(y ~ orth_poly) 
  </code></pre>
  
  <p>I would like to extract both the coefficients <em>a1</em>, <em>a2</em> <em>etc</em>, as well as the orthogonal coefficients <em>c1</em>, <em>c2</em> <em>etc</em>. I'm not sure how to do this. My guess is that </p>
  
  <pre><code>model$coefficients
  </code></pre>
  
  <p>returns the first set of coefficients, but I'm struggling with how to extract the others. Perhaps within</p>
  
  <pre><code>attributes(orth_poly)$coefs
  </code></pre>
  
  <p>?</p>
  
  <p>Many thanks.</p>