Statalist


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

st: RE: sub-dataset by variable numbers


From   "Jian'an Luan" <[email protected]>
To   <[email protected]>, Sebastian F. B�chte <[email protected]>
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: [email protected] 
> [mailto:[email protected]] On Behalf Of 
> Jian'an Luan
> Sent: 02 October 2007 12:05
> To: [email protected]
> 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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index