You are not logged in. You can browse but not post. Login or Register by clicking 'Login or Register' at the top-right of this page. For more information on Statalist, see the FAQ.
Thanks a lot. My variables are called "country", "year" and "idno". When I try "xtset country idno" Stata continues to tell me "repeated time values within panel", is there a reason for this?
Joan:
Stata is warning you that the way you -xtset- your data is wrong.
Assuming the -idno- is your -panelid- and -year- your -timevar- you shoud have typed:
Thank you Carlo, I tried but it still says "repeated time values within panel". To give you more details, my datasetlook like this:
Country Year Idno
Austria 2005 1
Austria 2005 2
Austria 2005 3
Austria 2006 4
Austria 2006 5
Austria 2006 6
France 2005 7
France 2005 8
France 2006 9
France 2006 10
France 2006 11
Joan:
thanks for providing an excerpt of your data (however, please use CODE delimiters in your future posts. Thanks).
The fix is easy: provided that you do not plan to use time-series related commands, such as lags and leads, you can simply -xtset- your dataset with -panelid- only:
I think that it's actually properly what I showed in #15 above.
Code:
xtset country
that is, country is the panel ID.
See the quote that I excerpted there at #15: idno is the individual respondent—no repeated measurements at that level. (Her smidgen of a data excerpt is consistent with that, too.)
Thank you for your insightful advice so far. I would like to present my problem as well. Thank you for your time and advice.
Dataset:
I generated a manager-firm matched sample in which I can track the movement of the mangers (according to Bertrand & Schoar, 2003, p. 1175-1176). Consequently, I restricted my sample in such a way that there is at least one manager in each firm that can be observed in at least one other firm. These “movers” have to be in each firm for at least three years. For each firm that satisfies these requirements, I kept all observations, i.e. including years where the firm has managers that are not observed in multiple firms. The goal is to add manager-fixed effects to my panel (yellow-highlighted benchmark) regression, so that I am able to conclude whether manager-effects matter. Thus, I estimate versions of equation (1).
My dataset looks like the exemplary one I posted below, although there are several more observations and variables for each firm (e.g. data for CEO, CFO and other executives).
Legend: Y: Dependent variable (Compustat items) X1, X2,…: Independent (control) variables (Compustat items) Gvkey: Firm ID Fyear: Indicated Fiscal year Execid: Manger ID CO_PER_ROL: ID number for each executive/company combination CEO / CFO / Other: Dummy variable stating the role of the manager within the firm in the given year
I would like to understand the following: For each firm-year combination I have multiple observations, i.e. I observe in company (gvkey=) 1000 in year 1992 the CEO (A) and CFO (B). Of course, if the CEO and CFO work in the same company and in the same year, the (in)dependent firm variables have to be the same. I would like to understand whether that is a problem if I want to estimate an equation (1) as above. Is my panel regression messed up if there are these multiple observations for a given firm-year observation? If so, what would you suggest to circumvent that problem? Initially I would have said that my panel is determined by “gvkey fyear” but I then face the issue of “too many time variables”, thus maybe “CO_PER_ROL fyear”? I am not sure whether this is appropriate for my intended regression. Is it even necessary in this case to tell Stata what my panel and what my time variable is?
Secondly, I wanted to understand how I can implement such panel regression in Stata. I think of using the Stata command “reghdfe Y X1 X2, absorb(gvkey fyear CEO CFO Other)”
Comment