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
Problem: no observations r(2000)Hello i'm making a dynamic panel and i want to estimate a model with pmg, mg and dfe. When I do th…
Propensity Score Matching: How to run analysis using a certain block?Hello, I believe this is a very newbie question but would be greatly appreciated if anyone can help …
New version of factext on SSCThanks as always to Kit Baum, a new version of the factext package is now available for download fro…
infix with files that do not have suffixesI am trying to read in 1000s of raw data files with the infix command. The files have a numeric name…
Multi level dummy variableHi listers, Yesterday I posted a question but when I re-read it, I found that there was some contex…
Subscribe to:
Post Comments (Atom)
0 Response to Calculating Age from two variables
Post a Comment