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
Estimating Random Effects in Mixed-effect Logistic Regression ModelHello, I am facing a crucial problem during the estimation of a random effect in a mixed effect log…
Adding sample size to graphsI want to add sample size for each of the subgraphs in the command below: graph bar if adoption == …
Sum individuals' totals into a group sum?Hi statalist, I have a tricky problem in which I have a large set of individuals, with individuals b…
Merging one of the rows with another within multiple rows of observationHello I have a dataset in which each identifier (ID) has multiple rows of observations, ranging fro…
deleting words in () for each row?Dear All, I found this question here (https://bbs.pinggu.org/thread-10057724-1-1.html). The data is:…
Subscribe to:
Post Comments (Atom)
0 Response to Create timeperiod for existing data by ID
Post a Comment