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: dates question


From   Chamara Anuranga <[email protected]>
To   [email protected]
Subject   Re: st: dates question
Date   Mon, 8 Oct 2012 14:28:09 +0530

try this command
gen ndate=mdy( month, date, year)
format ndate %td



On Mon, Oct 8, 2012 at 2:07 PM, Michael Eisenberg
<[email protected]> wrote:
> Colleagues,
>
> I have what I hope will be a simple question regarding dates.
>
> I have separate columns for day of injury, month of injury, and year
> of injury.  How can I merge these into one variable in date format?
>
> For example
> injmo   03
> injday  29
> injyr  2001
>
> newvar 29mar2001
> or
> newvar 15063
>
> Thank you in advance.
>
> Best,
> Mike
> *
> *   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/


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