Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Re: Delete upper case variable


From   Janet Hill <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Re: Delete upper case variable
Date   Mon, 23 Apr 2012 09:14:41 +0100 (BST)

Eric, Kit and Nick.
 
Thank you all for your help.
 
Janet


----- Original Message -----
From: Eric Booth <[email protected]>
To: [email protected]
Cc: 
Sent: Sunday, 22 April 2012, 22:41
Subject: Re: st: Re: Delete upper case variable

<>

I don't think -findname- has the ability to select on variable case (that I could find anyways ((I thought I remembered Nick Cox commenting about this in an earlier thread, but I couldnt find it - or I'm imagining it))) ).  

Here's a one way to do it:

*************!
sysuse auto, clear
rename mpg headroom, upper
**
foreach a in  `c(ALPHA)' {
cap ds `a'*
loc list `"`list' `r(varlist)' "'
}
di `"`list'"' //check this
drop `list' 
*************!

- Eric

_
Eric A. Booth
Public Policy Research Institute 
Texas A&M University
[email protected]
+979.845.6754


On Apr 22, 2012, at 4:14 PM, Janet Hill wrote:

> I am importing a large dataset and, following various data manipulations, I generate new variables that have lower case names. To clean the dataset I need to delete all variables that start with an upper case letter. I can see the names in ds or findname (from SSC) but I can't work out how to select these names for deletion. I would be grateful for any advice on this. I am using Stata 12.
> 
> Thank you,
> Janet
> 
> *
> *   For searches and help try:
> *  http://www.stata.com/help.cgi?search
> *  http://www.stata.com/support/statalist/faq
> *  http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*  http://www.stata.com/help.cgi?searchhttp://www.stata.com/support/statalist/faqhttp://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index