Hello All,
I am working with some data that requires the same format for dates. I am certain this is answered or addressed somewhere, but I haven't been able to find it. My issue is I have two date variables both are in a long format. The data came this way. If I had to do it myself it would not look like this at all. I have copied and pasted similar data to mine so that the issue is clear. One date is %12.0g format (date1) and the other is in %dD_m_Y format (date2).
input long(date1 date2)
5032011 11 Feb 86
5032011 11 Feb 86
2232010 17 Aug 91
4062010 17 Aug 91
9292011 24 Dec 81
11252014 24 Dec 81
end
format %tdD_m_Y date2
I tried to use dataex, on my version of Stata, it kept cutting off the data for date2, so I provided it this way. My purpose is simple. I do not have a specific interest in what the final product looks like. I just need to be able to have the dates on the same metric so I can do some other calculations (e.g., date2 - date1) and some conversions to normal time (e.g., months). Any ideas?
Thank you in advance.
George
I am working with some data that requires the same format for dates. I am certain this is answered or addressed somewhere, but I haven't been able to find it. My issue is I have two date variables both are in a long format. The data came this way. If I had to do it myself it would not look like this at all. I have copied and pasted similar data to mine so that the issue is clear. One date is %12.0g format (date1) and the other is in %dD_m_Y format (date2).
input long(date1 date2)
5032011 11 Feb 86
5032011 11 Feb 86
2232010 17 Aug 91
4062010 17 Aug 91
9292011 24 Dec 81
11252014 24 Dec 81
end
format %tdD_m_Y date2
I tried to use dataex, on my version of Stata, it kept cutting off the data for date2, so I provided it this way. My purpose is simple. I do not have a specific interest in what the final product looks like. I just need to be able to have the dates on the same metric so I can do some other calculations (e.g., date2 - date1) and some conversions to normal time (e.g., months). Any ideas?
Thank you in advance.
George

Comment