Statalist The Stata Listserver


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

st: RE: RE: Generating a Varlist that EXCLUDES a suffix


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: Generating a Varlist that EXCLUDES a suffix
Date   Tue, 21 Nov 2006 17:04:58 -0000

Having said this, I don't see the relevance to 
a -reshape- problem. For -reshape- you need 
stubs, not a varlist that includes stubs plus suffixes. 
Thus removing varnames that have certain suffixes
won't affect a stub list. You possibly need to 
-rename- the *3 first. 

Nick 
n.j.cox@durham.ac.uk 

Nick Cox
 
> ds *3, not 
> 
> If no variables match the pattern, this will return an 
> error; otherwise -not- specifies return of the complement 
> in `r(varlist)'. 
> 
> -ds- is currently undocumented (meaning, there is no 
> manual entry), but the help and the .ado are there 
> for you to use. 
> 
> If -ds- didn't exist, this would be a three-step 
> 
> unab not : *3 
> unab all : _all 
> local all : list all - not 
> 
> and in general that should be more efficient, not 
> that you would normally notice. See
> help for -macrolists- and -unab-. 
 
Rachel
  
> > Can Stata generate a varlist that excludes all variables ending in,
> > say, the number three?  I need a varlist like this for a reshape.

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