Dear all:
I woudl like to compare the two date variables date1 and date2, and if the date of the date1 variable exists, but the date of the date2 variable does not, delete the data of the date1 variable.
On the contrary, if the date of the date2 variable exists, but the date of the date1 variable does not, delete the data of the date2 variable.
Finally, the number of rows and dates should be the same for both date variables.

The result I require is below:

Thank you very much in advance,
Travis
I woudl like to compare the two date variables date1 and date2, and if the date of the date1 variable exists, but the date of the date2 variable does not, delete the data of the date1 variable.
On the contrary, if the date of the date2 variable exists, but the date of the date1 variable does not, delete the data of the date2 variable.
Finally, the number of rows and dates should be the same for both date variables.
Code:
clear input int date1 float price1 int date2 float price2 15006 1366.01 15006 1241.6 15007 1373.47 15007 1219.87 15008 1349.47 15010 1214.36 15010 1106.46 15011 1208.43 15011 1354.31 15012 1212.58 15012 1352.26 15035 1134.36 15034 1241.23 15036 1103.25 15035 1234.18 . . end format %td date1 date2
The result I require is below:
Code:
clear input int date1 float price1 int date2 float price2 15006 1366.01 15006 1241.6 15007 1373.47 15007 1219.87 15010 1106.46 15010 1214.36 15011 1354.31 15011 1208.43 15012 1352.26 15012 1212.58 15035 1234.18 15035 1134.36 end format %td date1 date2
Thank you very much in advance,
Travis
Comment