Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: replacing incorrect dob values


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: replacing incorrect dob values
Date   Wed, 23 Oct 2002 19:01:41 +0100

Kim Price
> 
> I need to replace some date of birth values that were entered 
> incorrectly.  The variable dob (V1) is entered as %d.  I've 
> been using 
> variations on the following and coming up with error messages:
> 
> replace V1=05sep2046 05sep1946 if id==434
> 
> I want to change id 434's date from 05sep2046 to 05sep1946.

Use Stata's date functions, as in 

replace V1 = mdy(9,5,1946) if id == 434 

Nick 
n.j.cox@durham.ac.uk 
*
*   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