Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Recoding consecutive rows of data


From   Michael Beets <[email protected]>
To   [email protected]
Subject   st: Recoding consecutive rows of data
Date   Wed, 28 Jan 2009 10:14:12 -0500

I have data collected in 15sec intervals over the course of 7 consecutive days.

Each row represents a single 15sec interval (fraction of 24hr day)
with a corresponding count variable ranging from 0 to 100.

For example, below represents a time-span of 3 minutes, beginning at
Midnight (zero - 00:00:00) to 00:03:00 (0.002083)



time                       count

0                      0

0.000174         0

0.000347         12

0.000521         58

0.000694         0

0.000868         32

0.001042         0

0.001215         0

0.001389         4

0.001563         27

0.001736         42

0.00191           8

0.002083         0



Can someone assist me in recoding the count variable to identify 20min
or longer time segments (80 15sec intervals/rows) that have
consecutive "zero" counts.

In the data there could be two 20min zero-count time segments, three
35min zero-count time segments, and one 4 hour zero-count time
segment.

These non-count segments could have occurred anytime throughout the
day. Hence, simply coding by counting every 20 rows does not work.

Any suggestions would be appreciated.

Michael
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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