BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
leonzheng
Obsidian | Level 7

I have a parameter (let's call it power) with x y coordinates. Now I need to do a 4th order polynomial fit for power, with x and y, equation should includes below terms:

x, y, x^2, x*y, y^2, x^3, x^2*y, x*y^2, y^3, x^4, x^3*y, x^2*y^2, x*y^3, y^4

Is there a function in SAS doing this? I saw some examples about doing polynomial prediction in SAS online, but they usually only fit y = f(x).

 

Thanks,

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

PROC GLM will do this

 

You need to write x^2 as x*x and x*y^3 as x*y*y*y and so on

--
Paige Miller

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

PROC GLM will do this

 

You need to write x^2 as x*x and x*y^3 as x*y*y*y and so on

--
Paige Miller
leonzheng
Obsidian | Level 7
thanks, i got the predicted result and residual in result, how can I add them directly into the original table as two new column?
leonzheng
Obsidian | Level 7
got it, thx

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1285 views
  • 0 likes
  • 2 in conversation