Hi everyone,
I have a long variable for source date in this dataset I am working with.
This long variable identifies dates in this way:
31oct1979
31oct1980
31oct1981
But when I tried to get it from dataex for this post, it came up in the following way:
* Example generated by -dataex-. To install: ssc install dataex
clear
input long srcdate
7243
7609
7974
end
format %td srcdate
Now I want to create a year variable which should only consist of the last 4 digits of the original format i.e. 1979, 1980. Can someone help me with the appropriate coding for this?
Related Posts with Keeping the last 4 digits of a long variable
Transformation and standardisation of variablesDear friends, I have some knowledge on standardisation, but I still have doubts; I would like to und…
Need helpclear all set more off mat drop _all pause off set graphics on // Control Pannel local beta "no" l…
Industry and year FE with paneldataHello, i have a paneldataset of S&P 500 companies form 2002 - 2019 and would like to implement …
Group observations with indirect tie.Dear colleagues, I am trying to group observations based on their (possibly indirect) connections .…
Margins and Clustered GEE Bootstrap Sampling ProblemHi Everyone, I am really struggling with this issue and hope someone can help. I have a generalize…
Subscribe to:
Post Comments (Atom)
0 Response to Keeping the last 4 digits of a long variable
Post a Comment