Hello friends,
I am currently using data that has one variable that shows the value of the date, for example, a variable named effective_date shows the value 20120105 means 2012-January-5th. If I only need the value of year (for my analysis purpose, as I need to create an arrival cohort based on years, not the exact date).
Right now I recode it like (20120000/20129999 = 2012), It works, but I am curious is there a way to formate variable just show the first four digitals instead of recoding it?
Please advise
Thanks
Related Posts with Is there a way to format variable?
Parallel Trends Assumption in Difference-in-Differences (DiD)Hello guys, recently I´m doing some research on the risk behavior of banks during the low interest …
Right way to extract Confidence Intervals of coefficients of interaction termDear all, I was wondering about what would the right way to form a list or matrix or a variable (ei…
hyperlink in Stata graphHi, I would like to include a hyperlink in the footnote of a graph. For instance: clear all webus…
Trying to replace a variable with a new generated variableHello, I am trying to replace a variable so that when I create a graph for GDPpc it shows GDPpc belo…
VAR or VECM- which one to use?If I have 4 variables in a model and I want to check for causality between the two variables say X a…
Subscribe to:
Post Comments (Atom)
0 Response to Is there a way to format variable?
Post a Comment