BookmarkSubscribeRSS Feed
Z_Lim
Calcite | Level 5

Hi,

I am trying to formulate this in SAS:

 
  Untitled.jpg

How should i code this?





 
 
 
 
 
 
 
 
 
 
 




2 REPLIES 2
RobPratt
SAS Super FREQ

Your formula has a couple of issues, including overloading of t.  I assume you meant the following (in LaTeX notation):

     \sum_j j x_{ijt} = \sum_{s=\max(1,t-8)}^t y_{is} + \sum_{s=\max(1,t-16)}^t z_{is} + \sum_{s=\max(1,t-24)}^t w_{is} \forall i,t

If so, you can write this constraint in PROC OPTMODEL as follows:

     con Mycon {i in ISET, t in TSET}:
          sum {j in JSET} j * x[i,j,t] = sum {s in max(1,t-8)..t} y[i,s] + sum {s in max(1,t-16)..t} z[i,s] + sum {s in max(1,t-24)..t} w[i,s];

Z_Lim
Calcite | Level 5

Hi Rob,

Thanks for your help. I will give it a try.

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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