BookmarkSubscribeRSS Feed
hckadali
Calcite | Level 5

Hi,

     I am trying to select 200 points from a pool of 1000 points which are nearest to the line say y = x using least squares. and my constraint is that the average of the values of the 200 points should be below a given value. How can i formulate this model using Proc optmodel?

I am not sure how i write the objective function in this case. I thought it should be like

min f = {sum i in 1..200} (x - y)**2

but in the above objective function, there is nothing to minimize, it just calculates the sum of least squares of first 200 obs. I am confused on how to tackle this. Plz help.

Thank you!

2 REPLIES 2
PGStats
Opal | Level 21

"the average of the values of the 200 points should be below a given value" ? The average of what value, x, y, SSQ?

PG
hckadali
Calcite | Level 5

There is one more column, say 'z'.

Average of  (y/z) of those 200 points should be less than some given value.

If i am correct in representing in SAS OPT model notation:

con constraint: {sum i in 1..200} (y/z) / 200  <= 0.60   

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 2 replies
  • 1046 views
  • 0 likes
  • 2 in conversation