Hi everyone, I would like to ask some help in order to extract year from a string variable (year of incorporation) that is structured in this way: 12/9/1998.
I tried to encode the variable (year of incorporation), change the format in %td and then use the code year(year of incorporation) but Stata returns me a year that does not match with the one in the date. For example, for 12/9/1998 it returns 1970.
How can I solve the problem?
Thanks!
Related Posts with Extract Year from a string variable
Regarding generating year-sum for each variableDear, I have a question. I have a panel data looks like below. Code: country year x y "I…
Inconsistency between rdrobust and rdplot resultsHi everyone, I use the rdrobust/rdplot package in stata to estimate a simple RD model with time as t…
Getting the repeated-measures bse() error (again)Hello, I'm new to the list so apologies for posting a basic question. Until the latest update of ST…
Removing duplicate ID's by creating additional variableHi All, I would like to change this dataset such that each ID only appears one time, with additiona…
Combine the panel data with External Covariates.I have DHS data which have hhid(household id), BMI(Body Mass Index), and Year(2005, 2010, 2015. The …
Subscribe to:
Post Comments (Atom)
0 Response to Extract Year from a string variable
Post a Comment