-egen minute = fill(1 1 1 1 2 2 2 2)-
-collapse counts,by(minute)-
Scott
On Wed, May 21, 2008 at 2:03 PM, Michael W. Beets <[email protected]> wrote:
> I have 15sec interval data collected on individuals over the course of a
> single day.
>
> The data look like the following, where "counts" are the primary outcome and
> time is the "time" (fraction of 24hrs) the counts occurred.
>
> What I am attempting to do is create a mean of every 4 15sec intervals to
> reflect the average counts/min. Hence, if a person is monitored (at 15sec
> intervals) over the duration of 1hr, they would have 240 lines of data
> containing counts. This needs to be collapsed into average counts/min
> (resulting in 60 lines of data/person).
>
> However, I am unaware of how to specify the collapse command to take the
> average of every 4 lines of data.
>
*
* 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/