Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Converting Dates into Numerical Values


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Converting Dates into Numerical Values
Date   Mon, 4 Sep 2006 13:13:54 +0100

Ikram Ullah had problems sending to Statalist. I have
edited this slightly. 

Nick
n.j.cox@durham.ac.uk 

Ikram Ullah [mailto:hrd_srsp@yahoo.com]

1. I have got different data sets. I want to join these 
by using identical variables. There are some identical variables 
(but not unique, in some the number varies or there are some 
additional observations of these variables) in the those data 
sets but the problem is when I use  -joinby- or  -merge-
 command to combine those the message appears * the variable isnot unique*.  
what should I do to solve this problem?

I know that in some of datasets the there additional some 
additional observations of the variable through which I want 
to merge the datasets. Can you help me how shuold I drop the 
observations which are not matching or to keep them as missing 
values in the dataset which results after merging?

2. Second question is I want to subtract dates (in ddmmyyyy format) 
to get the differnece in days. 
Whether mathematical operations (adding or subtracting) 
can be applied to the dates in this form? If so, how to do 
this because generating a new variable which is equal to 
difference of two different dates doesnot work?
Or the dates should be coverted to numerical codes before 
any kind of mathematical operations. 
how to convert normal dates into numerical codes?

*
*   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