Statalist


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

st: RE: sub-dataset by variable numbers


From   "Jian'an Luan" <jal42@medschl.cam.ac.uk>
To   <statalist@hsphsun2.harvard.edu>, Sebastian F. Büchte <sfbuechte@gmail.com>
Subject   st: RE: sub-dataset by variable numbers
Date   Tue, 2 Oct 2007 14:41:14 +0100

Dear all

Many thanks indeed for those who has answered my question.  Sebastian Büchte has suggested a better way which solved my problem perfectly : 
	unab vlist : _all
	//keep 3rd to 6th variable from dataset in memory keep `: word 3 of `vlist'' - `: word 6 of `vlist''

Thanks Sebastian!

Regards
Jianan



> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu 
> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of 
> Jian'an Luan
> Sent: 02 October 2007 12:05
> To: statalist@hsphsun2.harvard.edu
> Subject: st: sub-dataset by variable numbers
> 
> Dear Statalist
> 
> I wonder if I can select a sub-dataset by variables without 
> given variable names but using variable numbers, something 
> like the command when select a sub-dataset by observations 
> ".keep if _n>1001 & _n<2000".
>  
> Any help will be appreciated.
>  
> Jianan
> 
> *
> *   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/
> 

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index