0

After running some polynomial fitting on wavelength data, I encountered quite different results for poly() with raw=TRUE enabled and using `I()'.

Some side-information: ln and T_T0 are colomns of the fbg_data_simp dataframe

reg_fbg<-lm(ln ~ poly(T_T0,2), data=fbg_data_simp,raw=TRUE) 

and

reg_fbg<-lm (ln ~ I(T_T0) + I(T_T0^2), data=fbg_data_simp)

Summary's from both variants:

Summary view of top variant Summary view of bottom variant

It's clear both results in very different terms. Any idea why this would be the case? I am probably missing something.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
pnivelle
  • 1
  • 1
  • 1
    Both R-squares are 1 and the coefficients are very tiny. Without the data it is hard to say more. – dcarlson Aug 11 '21 at 20:09
  • Welcome to StackOverflow! I think @G.Grothendieck's answer should solve your problem. In future questions, you are (strongly) encouraged to post textual information (like your `summary()` outputs) as cut-and-pasted text (possibly in a code-format block), rather than as images ... it's much more accessible that way. – Ben Bolker Aug 11 '21 at 20:33
  • Thanks, for the tip! Ben – pnivelle Aug 12 '21 at 13:17

1 Answers1

3

raw= is an argument of poly, not of lm.

G. Grothendieck
  • 254,981
  • 17
  • 203
  • 341