Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

AW: 回复: st: AW: 回复: AW: 回复: st: re: missing string entry


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   AW: 回复: st: AW: 回复: AW: 回复: st: re: missing string entry
Date   Tue, 9 Mar 2010 10:38:10 +0100

<> 

Kill the blank in -missing ()-. Has to be -missing()-. Stata does not always mind blanks, as recently discussed on this list, but here it does. Also, the code around the -replace- line is only for illustration purposes, you do not need it for your particular case...



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von lydia huang
Gesendet: Dienstag, 9. März 2010 10:32
An: statalist@hsphsun2.harvard.edu
Betreff: st: 回复: st: AW: 回复: AW: 回复: st: re: missing string entry

Dear Martin,
i typed -set obs 1-, 
it came out -obs must be between 28032 and 231975 
             r(198);- in red,

typed -gen  public_medical_insurance_no=""-, 
it came out -public_medical_insurance_no already defined
             r(110);-


typed -replace  public_medical_insurance_no="null" if missing ( public_medical_insurance_no)- 
it came out -missing not found
             r(111);-
Best wishes
Lydia

--- 10年3月9日,周二, Martin Weiss <martin.weiss1@gmx.de> 写道:

> 发件人: Martin Weiss <martin.weiss1@gmx.de>
> 主题: st: AW: 回复: AW: 回复: st: re: missing string entry
> 收件人: statalist@hsphsun2.harvard.edu
> 日期: 2010年3月9日,周二,下午4:40
> 
> <> 
> 
> Spell out the function as "missing()":
> 
> 
> *************
> clear*
> set obs 1
> gen x=""
> replace x="null" if missing(x)
> *************
> 
> 
> 
> HTH
> Martin
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu]
> Im Auftrag von lydia huang
> Gesendet: Dienstag, 9. März 2010 09:39
> An: statalist@hsphsun2.harvard.edu
> Betreff: st: 回复: AW: 回复: st: re: missing string
> entry
> 
> yes, i am using stata7, then how can i replace all the
> missing string entries with "null" in stata7?
> 
> --- 10年3月9日,周二, Martin Weiss <martin.weiss1@gmx.de>
> 写道:
> 
> > 发件人: Martin Weiss <martin.weiss1@gmx.de>
> > 主题: AW: 回复: st: re: missing string entry
> > 收件人: statalist@hsphsun2.harvard.edu
> > 日期: 2010年3月9日,周二,下午4:15
> > 
> > <> 
> > 
> > 
> > 
> > -mi()- was introduced in Stata 8 (-help
> whatsnew7to8-), so
> > if you are a Stata 7 user, then the mystery is solved.
> If
> > not, it lingers on...
> > 
> > 
> > 
> > HTH
> > Martin
> > 
> > -----Ursprüngliche Nachricht-----
> > Von: owner-statalist@hsphsun2.harvard.edu
> > [mailto:owner-statalist@hsphsun2.harvard.edu]
> > Im Auftrag von lydia huang
> > Gesendet: Dienstag, 9. März 2010 04:46
> > An: statalist@hsphsun2.harvard.edu
> > Betreff: st: 回复: st: re: missing string entry
> > 
> > i typed 
> > 
> > replace nosocomial_infection = "NULL" if
> > mi(nosocomial_infection)
> > 
> > and it says "unknown function mi()".
> > what does this mean? how solve it? I want to change
> all the
> > missing string variables into "null", do i type the
> > following?
> > 
> > replace _all = "NULL" if mi(_all)
> > 
> > Best wishes
> > Lydia
> > 
> > --- 10年3月9日,周二, Kit Baum <baum@bc.edu>
> > 写道:
> > 
> > > 发件人: Kit Baum <baum@bc.edu>
> > > 主题: st: re: missing string entry
> > > 收件人: statalist@hsphsun2.harvard.edu
> > > 日期: 2010年3月9日,周二,上午10:36
> > > <>
> > > How to convert all the missing string entry into
> > entry
> > > shows "null"? 
> > > 
> > > replace myvar = "NULL" if mi(myvar)
> > > 
> > > Kit
> Baum   |   Boston
> > College
> > > Economics & DIW
> > > Berlin   |   http://ideas.repec.org/e/pba1.html
> > >           
>    
> > 
> > >           
> >    An
> > > Introduction to Stata Programming 
> > > |   http://www.stata-press.com/books/isp.html
> > >    An Introduction to Modern
> Econometrics
> > > Using Stata  |   http://www.stata-press.com/books/imeus.html
> > > 
> > > 
> > > *
> > > *   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/
> > 
> 
> 
>       
> 
> 
> *
> *   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/


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