Hello everyone,
I would like to replace the missing values (leftceo) by the last given observation-year, to calculate the tenure of a CEO.
This means in my case that the three missing values should be replaced by "2020".
I tried the following command: "bysort gvkey_year: replace leftceo=max(YEAR) if missing(leftceo)". Unfortunately Stata states that it is an invalid syntax.
Could someone help me, please?
Thanks in advance!
Array
Related Posts with How do I fill in missing values using the highest/last observation-year?
Adding character to string variable depending on the length of characters in the same stringHi, I've got a string variable, which should have 10 characters. I need to add a "0" in the front o…
Is it possibly to export xttrans results to Excel table?Hello! I am trying to figure out how to export results from xttrans command to an Excel file. My com…
Creating a concentration index for time delay between eventsHi Statalist, I am working with a dataset regarding students and their exam scores. I have data on …
Interaction terms in panel dataDear all, I am currently working on my master thesis : i am analyzing the link between board gender…
Interpretation sum of coefficientsDear Stata users, I have a question regarding the interpretation of my coefficients. I use an IV (T…
Subscribe to:
Post Comments (Atom)
0 Response to How do I fill in missing values using the highest/last observation-year?
Post a Comment