Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Running different running sums


From   "Carlo Lazzaro" <[email protected]>
To   <[email protected]>
Subject   st: Running different running sums
Date   Fri, 26 Oct 2007 19:08:30 +0200


Dear Statalisters,

 
sorry for reposting the same thread but the first today's try seems
unsuccessful.

 
I would like to run  30 running sums concerning the number of blood tests
provided to a given set of patients with the data column reported below, by
leaving one-out i per time. IOW, I would like to run a first running sum
with considering from i 1 to i 30; a second one including from i 2 to i 30,
a third including from i 3 to i 30 and so forth, until the last 30th running
sum, in which i 29 and i 30 should be included. 

I have tried - gen ALFA=sum(x) - but I have lost myself with imposing
different (and unsuccessful) conditions to make it work out. User's guide
and programming were not helpful. Any hints welcomed as ever. Thanks a lot
for your kindness and for your time. Kind Regards, Carlo.  

 

N_Blood_test (i)
---
1  
2  
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--

 

 

 

 



*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index