Statalist The Stata Listserver


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

st: Segmenting a dataset


From   "Morrison Hodges" <[email protected]>
To   <[email protected]>
Subject   st: Segmenting a dataset
Date   Thu, 17 May 2007 14:46:26 -0500

I have a dataset of 10 variables and 5000 observations. I need to calculate
the median of each variable in groups of 30 observations, i.e., the median
of each variable in observations 1-30, then the median for 31-60, then
61-90, etc. I know I can get the median from the p50 value of -summarize-,
but I'm not sure how to obtain consecutive segments of 30 observations each
to perform -summarize- on. Can anyone help?
Thanks, Morry Hodges

Morrison Hodges, MD
Professor Emeritus of Medicine
University of Minnesota

Senior Investigator
Minneapolis Heart Institute Foundation

612-863-3766
612-863-2490 (fax)
612-889-7695 (mobile)

[email protected]
http://www.mplsheartfoundation.org/

The reasonable man adapts himself to the world; the 
unreasonable man persists in trying to adapt the world
to himself. Therefore all progress depends on the 
unreasonable man.

George Bernard Shaw


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