Hello everyone,
I have a dataset like this-
input str4 hsn double cdob str10 bqdate_1
"1004" 19251 " 4/16/2026"
"1005" 19227 " 4/16/2011"
"1007" 19235 " 4/16/2011"
"1009" 19247 " 4/16/2013"
"1013" 19244 " 4/16/2021"
end
format %td cdob
cdob is the date of birth, and bqdate_1 is date of administering the data. Now I need to find out the age from the difference of these two variables. I know I need to change the format of these two variables, but I'm not sure exactly what to do for that. After changing the format I need to calculate differences between dates in months by using mofd prefix. Can someone help me to solve this problem? Thanks in advance.
Fahmida
Related Posts with Calculating Age from two variables
Mothers literacyHello, I wish to generate mother's matriculation literacy dummy (edu_matri) and illterate dummy (ill…
Keeping variables from a listHello everyone, I'd like to know if there's a way to keep in my dataset, the observations that are …
Error in Difference-in-Difference methodHi everyone, I have panel data Array When I run the DID estimator, Array I get the following message…
Keeping variables from a listHello everyone, I'd like to know if there's a way to keep in my dataset, the observations that are …
Multiple observations per id. How to filter observations if within a number of days of episodeHi! I'm working with a large data set that has multiple observations per id. Basically, there's one …
Subscribe to:
Post Comments (Atom)
0 Response to Calculating Age from two variables
Post a Comment