Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: random sample from aggregated data


From   "Svend Juul" <[email protected]>
To   <[email protected]>
Subject   Re: st: random sample from aggregated data
Date   Mon, 5 Dec 2005 19:39:46 +0100

Tomas wrote:
I have aggregated data:
year X sex  X age X education level X labor force participation
(7x2x9x4x2)
these data are from the whole population and I would like to make
random sample from them, but they are to big to do that, do you
have any idea how I can do that?

what I did: I use STATA 9.1/SE and first of all I changed my
memory to 950m after that I transformed  aggregated data to
individual data by
expand f
it consumed a lot of time but it was ok
after that I tried to do random sample to have at each table 1000
respondents
bsample 1000, strata(year sex age)
I left the computer to work on it during the weekend but it is
not completed yet, so I think that it is not possible to do,
do you have any idea how to do random sample if I have so big data?
-----------------------------------------------------------------

I am not sure whether you can avoid the expansion, but some other advice:

1.
   . compress
before expand may (or may not) reduce the size of your dataset.

2.
As suggested by Stas Kolenikov, drop any variables not needed.

3.
I guess that you by choosing 950m forced the computer to use virtual
memory which makes it very slow. See chapter 6 in [U] and this FAQ:

FAQ     . . . . . . . . . . . . . . .  Using a dataset that won't fit into RAM
         . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A. Riley
         1/96    How can I use a dataset that is larger than the available RAM?
                 http://www.stata.com/support/faqs/data/large.html

Good luck,
Svend

________________________________________________________

Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6
DK-8000 Aarhus C,  Denmark
Phone, work:  +45 8942 6090
Phone, home:  +45 8693 7796
Fax:          +45 8613 1580
E-mail:       [email protected]
_________________________________________________________

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