BookmarkSubscribeRSS Feed
mikepk
Calcite | Level 5

Hi all,

I'm trying to plot and fit data to a power function (y=ax^b) using proc gplot. The interpol option in the symbol statement allows you to define a type of regression (eg: rl=linear, rq=quadratic etc) but I don't see the power function as being one of them.

Is there perhaps another way to do this? I can easily do this in Excel as the trendline option has the power option........but need to use SAS to do it.

Thanks!

Mike

2 REPLIES 2
GraphGuy
Meteorite | Level 14

Do you have some sample data you could post up?

PaigeMiller
Diamond | Level 26

Here's how I normally do this.

  1. Augment the raw data with new observations that contain x-values that cover the range of your data and are spaced closely together. For example, if your data range is 0 to 10, I would add values 0, 0.01, 0.02, etc. The Y values are missing for these new observations.
  2. Perform the regression on this augmented data set and save the predicted values
  3. Plot the original data, and overlay the predicted values for the augmented data. At this point, you can simply connect the predicted value points linearly, that will be close enough for graphical purposes.
--
Paige Miller

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
  • 2 replies
  • 1367 views
  • 1 like
  • 3 in conversation