Hi, My input data c1 is as following: Date | P1 | P2 | Mean ----------------------------------------- 01JUN2017 | 200 | 300 | 3.2 ----------------------------------------- 02JUN2017 | 230 | 320 | 2.7 ----------------------------------------- 03JUN2017 | 250 | 340 | 3.7 ----------------------------------------- For each row, I would like to calculate Q_1, which based on the following function (pseudo code): Do i = 1 to 10: Q_1 = sum(P1 * pdf('Poisson', 1, Mean) * max((i-1),0) + P2 * pdf('Poisson', 1, Mean) * max((1-i),0)) so that output table c2 will have another column called 'Q_1' for each date. My initial code: Data c2; Set c1; do i = 1 to 10; Q_1 = sum(P1 * pdf('Poisson', 1, Mean) * max((i-1),0) + P2 * pdf('Poisson', 1, Mean) * max((1-i),0)); output; end; drop i; Run; But it returns 10 values of 'Q_1' for each date. How could I write it in data step? Thank you!
... View more