BookmarkSubscribeRSS Feed
julob
Calcite | Level 5

Hello,

How can I tell to SAS, that as criterion I want minimizing relative least squares (not absolute) in polynomial regression?
I have data with high variability and absolute least squares are discriminating low values, because the squared error is very low.

Thanks for answers

4 REPLIES 4
PaigeMiller
Diamond | Level 26

I'm not sure I know the difference between "relative" least squares and "absolute" least squares. Can you explain further?

Whatever it is, the usual procedures have built in objective functions, and I don't know that you can change them. Maybe PROC NLIN would allow you to specify your own objective function.

I have data with high variability

If that's the case, you might want to consider transforming your data so that the errors in your data are closer to normally distributed, rather than "relative" least squares, whatever that is.

--
Paige Miller
julob
Calcite | Level 5

Explain: I am not minimizing SUM[(desired value - model value)^2] in the least square method, but SUM[((desired value - model value)/desired value)^2]. In that case, errors of observations with small values are equal to errors of observations with high values.

PaigeMiller
Diamond | Level 26

A search of the SAS documentation doesn't show any hits for "relative least squares".

So I guess you would have to program this yourself in PROC IML or PROC NLIN

--
Paige Miller
PaigeMiller
Diamond | Level 26

Side comment: there is something called iteratively re-weighted least squares, which also reduces the influence of points far away from the fitted line. You can find an example of code for iteratively reweighted least squares in the PROC NLIN documentation.

--
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!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1171 views
  • 0 likes
  • 2 in conversation