Hello,
I have a numerical variable x which contains date information (its value is, for example, 27112014 for today’s date).
I want to convert x into a date variable y using Stata’s date function. However, I cannot run 'gen y=date(x, “DMY”)’ because x needs to be a string variable. How do I convert x into a string? Or, how do I create a date from a numerical variable?
Thank you,
Jan
I have a numerical variable x which contains date information (its value is, for example, 27112014 for today’s date).
I want to convert x into a date variable y using Stata’s date function. However, I cannot run 'gen y=date(x, “DMY”)’ because x needs to be a string variable. How do I convert x into a string? Or, how do I create a date from a numerical variable?
Thank you,
Jan
Comment