1

I ran a polynomial multiple regression in R using poly, and in the output the coefficients of some combinations of the two variables (Unc and Window) are seem to be missing, and I cannot get my head around it.

The input data can be downloaded from here.

The code I used in the following: per_lm=lm(formula = variable ~ polym(Unc, Window, degree = 4, raw = TRUE), data = mdata3)

and the output coefficients can be seen in the picture below.

Obtained coefficients

You can see that combinations such as 2,3; 4,1; 4,2; 4,3; or 1,4 etc. are missing. Does anyone have any idea why can this happen? I will have to extract the equation of the surface determined by the coefficients to use it in a separate program written by a colleague.

If I consider the "missing" combinations as zero coefficients I cannot reproduce the fitted surface illustrated here, where the Period=variable in the input data file attached above. I will have to use the equation of this surface in a separate software that we are writing. Thank you for any ideas.

  • @Roland answered your main question. For the second part ("I cannot reproduce the fitted surface illustrated below") you'll need to include more information: what did you try exactly? – user2554330 Sep 24 '20 at 11:50
  • Your linked dataset is different than the one in the figure. The linked one has 3 points with `Unc == 225` and 6 points with `Unc == 245`. The plot shows at least 25 points with `Unc` near those values. – user2554330 Sep 24 '20 at 12:10
  • @user2554330 I corrected the figure, I took a wrong prnt scr. I will provide more details soon, thank you! – Istvan Gabor Hatvani Sep 24 '20 at 13:45
  • You can always add predictors to the formula, e.g., `+ I(Unc ^ 2 * Window ^ 3)` would add the (2, 3) combination. – Roland Sep 24 '20 at 14:19

1 Answers1

2

It follows the definition for the degree of a bivariate polynomial consistent with this equation:

formula of a bivariate polynomial where n is the degree.

According to this definition 4,1 can only occur in a >= fifth degree polynomial.

Roland
  • 127,288
  • 10
  • 191
  • 288
  • Thanks, but even if this was true, the (2,3) combination is still missing, or zero? But l am quite certain that those coefficients should be there. Please see e.g. https://www.maplesoft.com/support/help/Maple/view.aspx?path=applications /BivariatePolynomialRegression or your source, where for a quadratic bivariate case https://mathworld.wolfram.com/MultivariatePolynomial.html – Istvan Gabor Hatvani Sep 24 '20 at 13:32
  • 1
    4-2 = 2, 4-3=1, so no, (2,3) shouldn't be there. The sum of both exponents must equal the degree. – Roland Sep 24 '20 at 13:40