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
plot with margins from different variables in one modelI'd like to make a plot with the margins results for multiple variables
Simply, using auto, I do th…
Locals vs variables: ML estimatorDear all,
I have a general question regarding the use of locals vs actually creating temporary varia…
Running xtpcse on unbalanced panel dataHi
I am really new in statistics and stata; so firstly I do apologies if my question does not make …
Measure Impact of Specific Variable kombination in dependent VariableHello I have a problem finding a fitting method for my research. I would like to test the impact of …
Are the assumptions the same for OLS-PCSE?Hi,
I wonder if the assumptions for OLS-PCSE are the same as for OLS?
And I have been running some…
Subscribe to:
Post Comments (Atom)
0 Response to Truncating numerical dates to years
Post a Comment