I am trying to merge a few datasets, and one of them uses very specific date information in a format that is not, as far as I understand, legible to STATA as a date.
Specifically, the observations look like this:
start end
19460101 19461129
19460102 19460415
19460119 19460509
19460305 19460331
It is YYYYMMDD, such that 19460101 translates to January 1st, 1946.
The trouble with this is that the other data sets do not use this specific format, and indeed, I'd rather just use year.
Is there a way to generate new variables "start_year" and "end_year" such that they only include the first 4 digits of "start" and "end" respectively?
Related Posts with Truncating numerical dates to years
PPML estimation with bilateral trade agreement dummies.Hello everyone! I am applying PPML estimation to analyze the impact of two trade agreements (both b…
Collapsing observations in different rowsHi everybody I have some data this way: SP_E_CONSECUTIVO SP_Y_ESP_ENSEÑAR SP_Y_ESP_EVALUAR SP_Y_…
Confusion about the example in STATA help file of didregressToday I read the detail description of didregress from STATA. from page 6 and 7, there is a point th…
How to deal with treatment assignment times vary problem in STATA17?Dear all Statalist experts, today I read the new function of Difference-in-Difference test from STAT…
Seeking help with unbalanced panel data analysisHi, I have recently analyzed an unbalanced panel data, but since it is my first time to work with su…
Subscribe to:
Post Comments (Atom)
0 Response to Truncating numerical dates to years
Post a Comment