Hello Everyone!
I was wondering if you could assist me in generating an age variable in a panel dataset I am working on.
I have the date of the birth (date_birth) as well as the year variable (that indicates the year of the observation).
I was trying to do (year - data_birth)/365.25
However that is probably not working because while the year is yyyy, the date_birth is dd/mm/yyyy. How do I make the conversion?
The specific date of the year we can use to calculate the age is not important for my analysis, as long as it is standard in the data.
Also not sure if it is important, but I am using Stata 13
Related Posts with Generating age variable in pannel dataset
Hetroskedasticity test Hausman-Taylor estimationDear all, Does anyone know how to perform a heteroskedasticity test (not a graphical one) with pane…
Problem with two merged datasets: time series and panel data relatedHi all, I am new to statalist, and relatively new to stata, so please bear that in mind when replyin…
Generate first difference using last available obs if missingDear All, I'm working on longitudinal data that look like the following: Code: * Example generate…
reshape long errorDear Readers I try to reshape long and get: Code: .. di `"`_vars'"' num0_ num_size00_ num_size10_…
Gen new variableHi! I want to make a measure for institutional trust. x1 = trust in judicial system x2 = trust in …
Subscribe to:
Post Comments (Atom)
0 Response to Generating age variable in pannel dataset
Post a Comment