a loop function to do integral

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

a loop function to do integral

Joanne Tsai-2
Dear colisters:

I was advised to explain my question a little bit further. I apologize for
the confusion.

What I have on my current data set is from column Market to A2, and I'd like
to generate a column A11 respond to A1, and A22 respond to A2. Time is my
dependent variable which I'd like to take integral of. For example, for row
6, time at 4, A11 should calculate A1 (t=0) + A1 (t=1) +A1 (t=2) +A1 (t=3)+
A1 (t=4), which is equivalent to the summation of A1 from time 0 to time 4.

Is the loop function the right direction?

Thank you again for your help.



MARKET

PROD

time

A1

A2

A11

A22

A

B

0

0

0

0

0

A

B

1

0.00024

0.00001

0.00024

0.00001

A

B

2

0.00059

0.00001

0.00084

0.00002

A

B

3

0.00128

0.00005

0.00212

0.00006

A

B

4

0.00198

0.00009

0.0041

0.00015

A

B

5

0.00286

0.00015

0.00696

0.0003

A

B

6

0.00364

0.00022

0.0106

0.00052

A

B

7

0.00441

0.00029

0.01501

0.00082

A

B

8

0.00531

0.00039

0.02032

0.0012

A

B

9

0.00621

0.00049

0.02653

0.00169

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD