I am trying to fit a second order polynomial. I center and scale my predictors and fit the data using the lm function. I did summary(fit). For 3 of my variables, I got NA in all columns including estimate, p-value etc.

So, I am using R

I used the function lm as follows

fit1<- lm (y ~ x11+x22 + I(x11^2) +I(x22^2) +I(x11*x22) )

The output I got is:

lm(formula = y ~ x11 + x22 + I(x11^2) + I(x22^2) + I(x11 * x22))

 Min       1Q   Median       3Q      Max 
-0.33889 -0.21371  0.01898  0.15166  0.47933 

               Estimate       Std. Error         t value               Pr(>|t|)
(Intercept)         2.57956     0.05367            48.062               <2e-16 ***
x11             -0.13097        0.05329         -2.458                0.0194 *  
x22                NA              NA                NA                NA    
I(x11^2)             0.08673       0.03559        2.437            0.0204 *  
I(x22^2)            NA            NA               NA                   NA    
I(x11 * x22)        NA            NA              NA                  NA    
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

So, in short the variables x22, x22-square and interaction x1*x2 shows NA in all columns.

Is there an error to get NA or should I just be assuming that the predictors for which estimates are NA are just insignificant?

Thank you for your help

  • 2
    $\begingroup$ Sure you can paste your output: copy it from the R window and paste it into your question-editing dialog as usual. Format it using the tools found across the top of the window. $\endgroup$
    – whuber
    Commented Apr 10, 2013 at 17:53
  • 1
    $\begingroup$ It would also be helpful to know what language you are using (is it indeed R?), as well as the code you used to generate your output. $\endgroup$
    – histelheim
    Commented Apr 10, 2013 at 18:14
  • $\begingroup$ I added the output. $\endgroup$
    – user23899
    Commented Apr 10, 2013 at 18:43
  • 1
    $\begingroup$ What is the correlation coefficient between x11 and x22? $\endgroup$ Commented Apr 10, 2013 at 19:22

1 Answer 1


Did you get any warnings from lm?

Usually when you get NA values like that there is also a warning about the x matrix being singular or nearly singular.

This is not unexpected in a couple of different cases. One is if either x1 or x2 only takes on a small number of values (possibly only 2 if values are rounded), or if there is a very strong relatioship between x1 and x2. If either of these cases hold then there is not enough meaningful information for R to get good estimates of all the variables (at least using finite precision arithmatic) and only focuses on those it can. Here order matters, if you switch all your x1's and x2's you may see that it estimates the values including x2 and gives NA for the x1 terms.

Explore your data to see if you really have enough meaningfully different values in x1 and x2 to estimate the polynomials, or if x1 and x2 are too closely related.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.