Quartic function

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Quartic function

ma_me
I'm trying to run a quartic polynomial regression on SPSS, but apparently cubic is the highest order you can find under Regression >> Curve Estimation. Do you have any ideas on how to do this?
Reply | Threaded
Open this post in threaded view
|

Re: Quartic function

David Marso
Administrator
Syntax!!!  But if you can't fit a cubic. a quartic is probably a waste of effort.  Plot/Transform/Think.  Or maybe autopilot??? Doh factor overload.

---
ma_me wrote
I'm trying to run a quartic polynomial regression on SPSS, but apparently cubic is the highest order you can find under Regression >> Curve Estimation. Do you have any ideas on how to do this?
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: Quartic function

Jon Peck
You could calculate the polynomials and run an ordinary regression, but they are likely to be ill behaved.  You might consider cubic splines, which can be constructed with the STATS SPLINES extension command.

On Sun, Dec 25, 2016 at 2:22 PM David Marso <[hidden email]> wrote:
Syntax!!!  But if you can't fit a cubic. a quartic is probably a waste of

effort.  Plot/Transform/Think.  Or maybe autopilot??? Doh factor overload.



---



ma_me wrote

> I'm trying to run a quartic polynomial regression on SPSS, but apparently

> cubic is the highest order you can find under Regression >> Curve

> Estimation. Do you have any ideas on how to do this?











-----

Please reply to the list and not to my personal email.

Those desiring my consulting or training services please feel free to email me.

---

"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."

Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"

--

View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Quartic-function-tp5733636p5733637.html

Sent from the SPSSX Discussion mailing list archive at Nabble.com.



=====================

To manage your subscription to SPSSX-L, send a message to

[hidden email] (not to SPSSX-L), with no body text except the

command. To leave the list, send the command

SIGNOFF SPSSX-L

For a list of commands to manage subscriptions, send the command

INFO REFCARD

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Quartic function

Ryan
As Jon pointed out, the OP could use the REGRESSION procedure to fit a linear regression model in which the relationship between y and x is modeled as an nth degree polynomial. Below is a simulation experiment which shows how to: (1) generate data that conform to a linear regression with the relationship between the dependent variable y and independent variable x modeled as a 3rd degree polynomial (cubic relationship), (2) visualize the relationship in a scatterplot, (3) create the terms to be entered into the REGRESSION procedure, (4) fit the model using REGRESSION and (5) fit the model using CURVEFIT. I noticed that the CURVEFIT procedure only allowed for modeling up to a 3rd degree polynomial. This simulation experiment should be enough for the OP to be able to fit linear regression models in SPSS with the relationship between x and y modeled as any degree polynomial (quadratic, cubic, quartic etc.) using REGRESSION.

I'm always concerned about overfitting and the effect of outliers when modeling higher order polynomials.

I am in favor of evaluating the relationship between x and y using visual aids and spline effects driven by theory. When time permits I will play around with the STATS SPLINES extension command and report back to SPSS-L. I'm curious if anyone on SPSS-L has used this extension and what they have observed.

Ryan
--

*Generate Data.
set seed 98765432.
new file.
input program.
loop ID = 1 to 100.
     compute x = rv.normal(0,1).
     compute b0 = 0.5.
     compute b1 = 1.0.
     compute b2 = -1.5.
     compute b3 = 2.0.
     compute error = rv.normal(0,1).
     compute y  = b0 + b1*x + b2*x**2 + b3*x**3 + error.
     end case.
   end loop.
end file.
end input program.
execute.

delete variables b0 b1 b2 b3 error.

GRAPH
  /SCATTERPLOT(BIVAR)=x WITH y
  /MISSING=LISTWISE.

compute x_2nd = x**2.
compute x_3rd = x**3.
execute.

REGRESSION
  /MISSING LISTWISE
  /STATISTICS COEFF OUTS R ANOVA
  /CRITERIA=PIN(.05) POUT(.10)
  /NOORIGIN
  /DEPENDENT y
  /METHOD=ENTER x x_2nd x_3rd.

* Curve Estimation.
CURVEFIT
  /VARIABLES=y WITH x
  /CONSTANT
  /MODEL=CUBIC
  /PLOT FIT.

On Sun, Dec 25, 2016 at 5:46 PM, Jon Peck <[hidden email]> wrote:
You could calculate the polynomials and run an ordinary regression, but they are likely to be ill behaved.  You might consider cubic splines, which can be constructed with the STATS SPLINES extension command.

On Sun, Dec 25, 2016 at 2:22 PM David Marso <[hidden email]> wrote:
Syntax!!!  But if you can't fit a cubic. a quartic is probably a waste of

effort.  Plot/Transform/Think.  Or maybe autopilot??? Doh factor overload.



---



ma_me wrote

> I'm trying to run a quartic polynomial regression on SPSS, but apparently

> cubic is the highest order you can find under Regression >> Curve

> Estimation. Do you have any ideas on how to do this?











-----

Please reply to the list and not to my personal email.

Those desiring my consulting or training services please feel free to email me.

---

"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."

Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"

--

View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Quartic-function-tp5733636p5733637.html

Sent from the SPSSX Discussion mailing list archive at Nabble.com.



=====================

To manage your subscription to SPSSX-L, send a message to

[hidden email] (not to SPSSX-L), with no body text except the

command. To leave the list, send the command

SIGNOFF SPSSX-L

For a list of commands to manage subscriptions, send the command

INFO REFCARD

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD