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: Cannot generate a dummy variable using if command


From   "JOHN N. NG'OMBE" <[email protected]>
To   [email protected]
Subject   Re: st: RE: Cannot generate a dummy variable using if command
Date   Sat, 3 Aug 2013 16:35:51 +0200

Hi, since u have missing values in your age column, Stata recognises
all missing values that have 'periods' as very large values and so it
assigns a 1 to those. Fill up those missing values and run the
generate and replace command. Hope this will help.  Thanks.

On 8/2/13, Joseph Kwan <[email protected]> wrote:
> Just to add that I have some missing values for the observations for the age
> column ( and I want to generate a dummy for people older than 25)  , is that
> causing the problem or it is just technical fault due to the product?
>
> Thanks
> ________________________________________
> From: [email protected]
> [[email protected]] on behalf of Joseph Kwan
> [[email protected]]
> Sent: Friday, August 02, 2013 7:05 PM
> To: [email protected]
> Subject: st: Cannot generate a dummy variable using if command
>
> I would like to generate a variable for people older than 25 years old,
>
> so I use
>
> gen old=1  if age>25
>
> but then Stata returns with an old dummy variable with all 1 for all
> observations.
>
> I checked the syntax and I do not know what is wrong.
>
> Is Stata known to have faults like that?
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
>


-- 
__________________________________
John N. Ng'ombe, (B.Sc Agric. Econ)
Staff Development Fellow (SDF)
Department of Agricultural Economics
The University Of Zambia
P.O. Box 32379
Lusaka, 10101
Zambia
Cell:+260977121913
Email: [email protected]

LIVE LAUGH LOVE!!!!
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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