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
Westerlund cointegration testI am attempting to estimate a panel co-integration. I converted 'country' to numeric using encode co…
Replace variable if commandI have a set of European regions for many different years and I would like to create a variable whic…
Error in Stata 16Hello, I try to run "ssc new" in Stata 16 IC on Windows and get the following error: "file ssc_resu…
Unit-root test for a bounded seriesHi All, I would like to test for unit root for a series that is bounded, i.e., a series which lies …
Problem by making an ordered probit variableHello, I am using panel data, where my dataset includes 4 different target firm characteristics and…
Subscribe to:
Post Comments (Atom)
0 Response to Calculating Age from two variables
Post a Comment