Hello all,
i have problems with creating a panel data set and I also have to mentioned that I am a stata beginner.
The Dataset includes many observations (around 100.000) and includes the following parameters:
companyid directorid role startrole endrole
9876 1234 Manager 2004 2006
9876 1234 CEO 2006 2008
9876 1233 President 2004 2010
9888 1234 CEO 2008 2010
So in genereal I have in the Datasets different observations for different time periods, companys, directors, roles.
And now I want to include a specific timeperiod from 1999-2017 for each companyid. Any observation that does not fall within this period can be deleted. The data set should therefore look like the following:
companyid year directorid role
9876 1999 (missing) (missing)
...
9876 2004 1234 Manager
9876 2004 1233 President
9876 2005 1234 Manager
9876 2005 1233 President
...
9876 2017 (missing) (missing)
I try to use the code "tsset director_id year_startrole". But I receive always the error "repeated time values within panel". I know that the time values are overlapping but I need then, like in the example, for example two rows for the companyid and for the year.
I hope someone can help me out.
Thank you all in advance.
Best regards,
Dennis
Related Posts with Create timeperiod for existing data by ID
Oaxaca decomposition for nonlinear regression (nldecompose)Hello readers, I am trying to decompose (using Ben Jann’s nldecompose) differences in the probabilit…
Rolling regression or loops - missing valuesDear All I have a peculiar issue I wish to share with you, in the hope of receiving some advice. I …
graph pie with some of percentagesHow to display the fraction when percentage is above 20%, I know how to display all percentages Cod…
Export browse table to ExcelHi there, is there a command that exports the whole data currently in memory to Excel? Practically,…
stripplot specificationsDear colleagues I have a variable named Total Compensation1 and another called Affiliationindex1 (f…
Subscribe to:
Post Comments (Atom)
0 Response to Create timeperiod for existing data by ID
Post a Comment