Statalist


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

st: RE: Recoding consecutive rows of data


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Recoding consecutive rows of data
Date   Wed, 28 Jan 2009 16:01:48 -0000

I am not sure that I understand your problem but -tsspell- from SSC may
help. Or the statement of principles in 

SJ-7-2  dm0029  . . . . . . . . . . . . . . Speaking Stata: Identifying
spells
        . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N.
J. Cox
        Q2/07   SJ 7(2):249--265                                 (no
commands)
        shows how to handle spells with complete control over
        spell specification

Nick 
[email protected] 

Michael Beets

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.

*
*   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