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

From |
"Rodini, Mark" <mrodini@compasslexecon.com> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
st: using the first n observations in a dataset w/o evaluating the whole thing? |

Date |
Thu, 3 Apr 2008 16:31:58 -0700 |

Greetings. Suppose I have a large Stata dataset (e.g. 3,000,000 observations) and I only with to read in the first, say, 100 observations. I have tried the code, which works: use mydata if ( _N<100 ) However, evidently, this code goes through ALL 3 million observations to evaluate the expression in parentheses, which can be very time consuming (and sort of defeats the purpose). Is there a way to only read the first 100 observations without having to evaluate the entire dataset? Perhaps some application of the "set obs 100"? But I have not been successful. Thank you. -Mark ---------------------------------------------- Mark Rodini mrodini@compasslexecon.com * * 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/

**Follow-Ups**:**Re: st: using the first n observations in a dataset w/o evaluating the whole thing?***From:*David Kantor <kantor.d@att.net>

**st: RE: using the first n observations in a dataset w/o evaluating the whole thing?***From:*"Kieran McCaul" <kamccaul@meddent.uwa.edu.au>

- Prev by Date:
**st: mulogit program (graphs both the multivariate and univariate odds ratios from logistic regression)** - Next by Date:
**st: RE: using the first n observations in a dataset w/o evaluating the whole thing?** - Previous by thread:
**st: mulogit program (graphs both the multivariate and univariate odds ratios from logistic regression)** - Next by thread:
**st: RE: using the first n observations in a dataset w/o evaluating the whole thing?** - Index(es):

© Copyright 1996–2017 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |