Statalist


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

st: RE: Re: regexr and missing values


From   Howard Lempel <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: RE: Re: regexr and missing values
Date   Fri, 17 Oct 2008 16:59:13 -0400

Thanks, Martin!

I now know that lack of updating is not the problem.

Howie

Howie Lempel
Research Assistant
The Brookings Institution | Economic Studies

1775 Massachusetts Ave NW | Washington DC 20036
[email protected] | p: (202) 238-3576

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Martin Weiss
Sent: Friday, October 17, 2008 4:53 PM
To: [email protected]
Subject: st: Re: regexr and missing values

"I also do not know how to see what Stata has updated since my last update":
see -help whatsnew-

HTH
Martin
_______________________
----- Original Message -----
From: "Howard Lempel" <[email protected]>
To: <[email protected]>
Sent: Friday, October 17, 2008 10:34 PM
Subject: st: regexr and missing values


> Hello all,
>
> I'm using Stata 10 (last updated 10/10/07) and am having a bit of trouble
> with the -regexr- function.  I can't tell if I've stumbled on a bug or if
> I'm doing something wrong.
>
> I am trying to use -regexr- to transform a string variable called
> lfpatfin.  I'd like to take every observation where the last letter in
> lfpatfin is "U" and substitute an "E" for the "U".  The code appears to
> work except that two observations where lfpatfin was missing have been
> replaced with an "E".  This appears to be similar to a problem Yun Liu had
> with -regexm- on July 16 in this thread:
> http://www.stata.com/statalist/archive/2008-07/msg00596.html, but I can't
> tell if Yun's issue was ever resolved.  I have been unable to reproduce
> the problem using the auto dataset or a dataset generic dataset I created.
> My code and some output follows.  I did nothing to test in between
> generating it and the -list- command.
>
> gen test = regexr(lfpatfin,"U$", "E")
> list lfpatfin test in 1/1000 if lfpatfin != test
>
>      +-----------------+
>      | lfpatfin   test |
>      |-----------------|
>  70. |      FRU    FRE |
> 105. |      RFU    RFE |
> 148. |        U      E |
> 161. |        U      E |
> 554. |       FU     FE |
>      |-----------------|
> 861. |       FU     FE |
> 914. |        U      E |
>      +-----------------+
> list lfpatfin test if missing(lfpatfin) & !missing(test)
>
>       +-----------------+
>       | lfpatfin   test |
>       |-----------------|
> 20074. |               E |
> 24067. |               E |
>       +-----------------+
>
> . list lfpatfin test in 16000/16200 if missing(lfpatfin)
>
>       +-----------------+
>       | lfpatfin   test |
>       |-----------------|
> 16156. |                 |
> 16162. |                 |
> 16166. |                 |
> 16170. |                 |
> 16175. |                 |
>       |-----------------|
> 16176. |                 |
> 16179. |                 |
> 16180. |                 |
> 16183. |                 |
> 16186. |                 |
>       |-----------------|
> 16197. |                 |
>       +-----------------+
>
> For what it's worth, I try to make similar changes to lfpatfin
> (substituting "B"s for final "D"s) later in my code and had the same
> problem.
>
> I'd appreciate it a lot if anyone has any explanation.  I also do not know
> how to see what Stata has updated since my last update, but I would be
> grateful if anyone knows where to go for that - I'd like to check whether
> the -regex- functions have been changed.  Unfortunately, I don't have the
> admin rights to update my version of Stata.
>
> Thanks for your consideration.
> Howie
>
>
> Howie Lempel
> Research Assistant
> The Brookings Institution | Economic Studies
>
> 1775 Massachusetts Ave NW | Washington DC 20036
> [email protected] | p: (202) 238-3576
>
>
>
> *
> *   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?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?search
*   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