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
Test for collinearityHi all, I'm trying to estimate the Wald-DID below: Code: svy: ivregress 2sls OUTCOMEVAR i.time…
Causal Random ForestHi: Is anyone aware or has anyone tried to implement Causal Random Forests to examine heterogeneous…
Using Classes from LCA in another modelDear Statalisters, I am using Stata17. I have run the following LCA model (the analysis try to grou…
Creating a variable that corresponds the proportion of observations that the current observation is larger thanHi, I am looking to create a variable that corresponds to the proportion (or percentage) of observat…
Solving Endogeneity in Panel Data Analysis: (R coding)Hi, I need your help in my regression model: I have a panel data for 6 year at state level (50 state…
Subscribe to:
Post Comments (Atom)
0 Response to Create timeperiod for existing data by ID
Post a Comment