Hi,
I have a problem with the date format. As I imported all dates from excel (also formatted as date) all missing data which had a 0 assigned turn into 31dec1899.
I already found out that this is the equivalent to 0 in the date format from stata. (Sorry - stata beginner)
But I really need the 0 there as I want to count the numbers of dates which are not existent and compare them to all the others (if it is possible to replace them with a 1 that would be awesome).
I used this one for another variable but it doesnt work for dates - any ideas:
gen n_Restricted_Areas=.
replace n_Restricted_Areas=1 if Restricted_Areas~="0"
replace n_Restricted_Areas=0 if Restricted_Areas=="0"
Kind regards,
Niklas
I have a problem with the date format. As I imported all dates from excel (also formatted as date) all missing data which had a 0 assigned turn into 31dec1899.
I already found out that this is the equivalent to 0 in the date format from stata. (Sorry - stata beginner)
But I really need the 0 there as I want to count the numbers of dates which are not existent and compare them to all the others (if it is possible to replace them with a 1 that would be awesome).
I used this one for another variable but it doesnt work for dates - any ideas:
gen n_Restricted_Areas=.
replace n_Restricted_Areas=1 if Restricted_Areas~="0"
replace n_Restricted_Areas=0 if Restricted_Areas=="0"
Kind regards,
Niklas
Comment