Displaying 1 result from an estimated 1 matches for "tp20656012p20657233".
2008 Nov 24
3
count the cumulative for each subject
I have a data set like the following:
subject visit x1
1 1 0.5
1 2 1.2
1 3 0.7
2 1 0.4
2 2 0.6
2 3 1.0
.....
where x1 is the interval between the two visits. Now I want to calculate the
cumulative intervals since the beinging, for example
subject visit x1 cum
1 1 0.5 0.5
1 2 1.2 0.5+1.2
1 3 0.7 0.5+1.2+0.7
2 1 0.4 0.4
2 2 0.6 0.4+0.6
2 3 1.0 0.4+0.6+1.0
.....
is there an easy to generate the