Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-02-2016 09:57 AM

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

Accepted Solutions

Solution

05-09-2016
08:40 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-02-2016 10:40 AM

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;
```

All Replies

Solution

05-09-2016
08:40 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-02-2016 10:40 AM

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;
```