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

I wanted to calculate value of Q (Please find formula in the attacheed). I have values of Cn, V, S and A in a dataset.

 

Can somepne from community help me in achieving this. Also, I am new to SAS and has no experience with it. I really appreciate a stepwise procedure.

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

Are the values of the Ci also in a data set? Or have you already computed "sum of Ci"?

 

You posted this to the SAS/IML Support Community, so I will provide a SAS/IML solution. (You can also do this with the SAS data step.)

/* make up sample data */
data Coefs;
input Cn V S A;
datalines;
0.1  4  6 16
;
data Ci;
input C;
datalines;
0.01 0.02 0.03 0.04 0.05 0.06
;

proc iml;
/* read data */
use Coefs;
read all var {Cn V S A};
use Ci;
read all var {C};

/* compute Q */
Q = Cn*V + sum(C)*S / A;
print Q;

View solution in original post

1 REPLY 1
Rick_SAS
SAS Super FREQ

Are the values of the Ci also in a data set? Or have you already computed "sum of Ci"?

 

You posted this to the SAS/IML Support Community, so I will provide a SAS/IML solution. (You can also do this with the SAS data step.)

/* make up sample data */
data Coefs;
input Cn V S A;
datalines;
0.1  4  6 16
;
data Ci;
input C;
datalines;
0.01 0.02 0.03 0.04 0.05 0.06
;

proc iml;
/* read data */
use Coefs;
read all var {Cn V S A};
use Ci;
read all var {C};

/* compute Q */
Q = Cn*V + sum(C)*S / A;
print Q;

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.

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 1 reply
  • 754 views
  • 1 like
  • 2 in conversation