Hello, I'm trying to merge two datasets using a variable called sur_mon_yr that is month/year. E.g. 01/2010
When merging by sur_mon_yr, there is no match.
I suspect this is because one dataset has sur_mon_yr in %tmNN/CCYY format whereas the other dataset uses %tdNN/CCYY format.
I tried changing the format of the variables to match but it's not working.
For example, if %tdNN/CCYY is changed to %tmNN/CCYY, the observation changes from 01/2010 to 01/3497.
On the other hand, if %tmNN/CCYY is changed to %tdNN/CCYY, the observation changes from 01/2020 to 08/1961.
I'm not sure how to get the two sur_mon_yr variables to have the same format such that they can merge and match.
Many thanks for your help,
Harry
Related Posts with Date format question
Treatment , Post Treat in case of heterogeneous treatment timingHello all, Would like to create an event study but I'm trying to make sure I'm creating treatment, …
Vectorized divisionHi All, I have the following dataset. test2=sums_of_squares_weight/total_passenger_perday_adjusted …
covs() not allowed in rdrobstDear statlists, I have a very brief question, but I cannot wrap my head around why this doesn't wor…
Choosing model specification: region*time FEs vs. country-specific time trendsHello! I am trying to find the effect of drought on agricultural production using a model of the fo…
Difference in Difference estimation on carbon emissions in STATA 17.Dear STATA community, I have some questions regarding my analysis for my DID estimation. I am looki…
Subscribe to:
Post Comments (Atom)
0 Response to Date format question
Post a Comment