I have a historical dataset with teenagers' birthday in the format of dd.mm.yy, while they were all born after 1980.
e.g.
15.03.88
02.06.95
...
The variable name is: dob
I wrote the following syntax, but returned with empty values, it seems nothing has been converted:
gen dob_new = date(dob, "DMY")
format dob_new %tdDD/MM/YYYY
I also tried the following:
gen dob_num = clock(substr(dob, 1, 2) + "/" + substr(dob, 4, 2) + "/20" + substr(dob, 7, 2), "DMY")
It works but I don't know how to convert it back to dd/mm/yyyy format.
Could anyone please help?
Related Posts with Issue with converting date in dd.mm.yy format to dd/mm/yyyy
Why these clusterings are different?Hello. I have a question: why the below results are different? what is the meaning of each of the c…
Lasso inference - forcing lasso to accept groups of variables togetherI am interested in running lasso inference models (starting with dsregress), but I have non-trivial …
Graph Combine: One big graph with multiple small graphs on one sideHi, I struggle to build a graph that looks like this (I used my advanced MS Paint skills here): Arra…
Sample size calculations for a non-inferiority trialHi Listers, I need to calculate the sample necessary for a non-inferiority trial where we are compa…
Coefplot interaction term - loop multiple sample, label x axisDear all, I am estimating the coefficient of an interaction term for multiple samples. These sample…
Subscribe to:
Post Comments (Atom)
0 Response to Issue with converting date in dd.mm.yy format to dd/mm/yyyy
Post a Comment