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" <[email protected]>
To   <[email protected]>
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. 

[email protected] 

Ikram Ullah [mailto:[email protected]]

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:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index