Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Indeed, but wouldnt it have multiple values for the dependent variable? e.g. AAA and AA etc.

    Comment


    • #17
      From the very start of of the Stata Longitudinal-Data/Panel-Data Reference Manual PDF we have

      Panel datasets have the form xit, where xit is a vector of observations for unit i and time t.
      So clearly your data is not panel data where the panels are defined by Company ID, because you have more than one vector of observations for Company 1 in 2015.

      As suggested above, what you have is panel data where the panels are defined by the combination of Company ID and rating agency. Your data should be arranged something like the following.
      Code:
      Comp    CompID  year    agency rating   var1    var2
      A       1       2015    1      AAA       101     1.1
      A       1       2015    2      AA        101     1.1
      A       1       2014    2      AA        103     2.1
      B       2       2015    1      Aaa       201     3.2
      and then follow Carlo's advice to use egen ... group(CompID agency) to generate a panel identifier.

      You haven't told us how you intend to model the ratings, but your independent variables can include fixed effects for company as i.CompID, for agency as i.agency, and for year as i.year.
      Last edited by William Lisowski; 24 Jul 2016, 15:06.

      Comment


      • #18
        Thanks all, I think I understand the issue much better now. I think I have somewhat been asking the wrong question, having not understood the question. I clearly see now that I am dealing with a multi dimensional panel and that stata commands such as xtset only deal with a two dimensional panel, so I needed to reframe it into 2 dimension if I wish to use those commands (i.e. use a new ID encapsulating both the compID and the agency and the year). I can then cluster errors by firms using VCE(cluster compID) to group ratings by different agencies together for each bank? Thanks again

        Comment


        • #19
          Laurence:
          as per William's code, there's no need to encapsulate year in
          Code:
          egen <whatyoulike>=group(CompID agency)
          Yes, you can cluster your SEs by firms as you proposed in your last post.
          Kind regards,
          Carlo
          (StataNow 18.5)

          Comment


          • #20
            Dear statalist members,

            even though I am brand new to this forum and a relative Stata-beginner, I still hope that I am implementing the guidelines on "how to post" correctly.

            Since I have a similar problem to the one discussed above, I thought I would link here. My problem relates to a fairly large economic dataset in a panel format that examines the impact of independent board members on firms.

            As mentioned above, the problem of "repeated time values" also exists in my case, as long as one uses
            Code:
             xtset companyid panel_year
            as panel format.

            Therefore, I also created an unique_panel_id (in my main dataset) that specifies each director in terms of each company, committee_code (membership), their committee_R_code (as a function he has), role_code (as his role) and their status (ED-executive director; NED-non-executive director) by the following code:

            Code:
            egen uniq_panel_id = group(DirectorID CompanyID CommitteeName_Num CommitteeRole_Num Role_Num EDNED_Num year_Start_Int)
            , where year_Start_Int was the start-year of the individual director appointment. I created the Panel out of the initial "one-liner" by calculating the duration of director appointment (start-end) and the use of the "expand" command.

            According to this, determining
            Code:
             xtset uniq_panel_id panel_year
            is then indeed possible.

            Nevertheless, I have the question if the estimation coefficients are correct/make sense, since - while the panel ID as well as the year clearly define the panel - regressions run over the same recurring economic values as as can be seen with uniq_panel_id 1,4 or 18,16,17. Since even if directors hold different memberships/roles, the company logically remains the same. (E_M_ = dependent variable; direct_age - D_Audit = some of the example independent variables; SIC = Industry classification).

            My concern is that, if I reduce the panel to a single Company-Year panel by deleting redundant economic data and represent different director positions/roles etc. as dummy variables, information will be lost. I ran a few example regressions (xtreg / reghdfe) of the "complete" and "deleted redundant economic values" datasets, where some of which gave almost identical outputs, and some of which gave divergent outputs. Nevertheless, it is - from an econometric point of view - difficult for me to assess which values -if any- would be correct here.

            I would be grateful for any help or methodical suggestions/references.

            Code:
            companyid    directorid    SIC    uniq_panel_id    panel_year    year_start_int    year_end_int    committee_code    committee_R_code    role_code    edned_code    E_M_    direct_age    boardsize    Ind_Dir_Num    Board_IND    LEV    SIZE    D_Audit
            2.2e+08    216931    11    2    1993    1993    1999    Not in Committee    No defined Role    Chairman/CEO    ED    .0811722    41    8    5    .625    0    18.22001    0
            2.2e+08    216931    11    2    1994    1993    1999    Not in Committee    No defined Role    Chairman/CEO    ED    .0202475    42    8    5    .625    0    18.40016    0
            2.2e+08    216931    11    2    1995    1993    1999    Not in Committee    No defined Role    Chairman/CEO    ED    .0217582    43    8    5    .625    0    18.61741    0
            2.2e+08    216931    11    2    1996    1993    1999    Not in Committee    No defined Role    Chairman/CEO    ED    .0490732    44    8    5    .625    .0053977    19.56024    0
            2.2e+08    216931    11    2    1997    1993    1999    Not in Committee    No defined Role    Chairman/CEO    ED    .0492088    45    8    5    .625    .0080246    19.73937    0
            2.2e+08    216931    11    2    1998    1993    1999    Not in Committee    No defined Role    Chairman/CEO    ED    .0516448    46    8    5    .625    .0108395    19.74788    0
            2.2e+08    216931    11    1    1999    1999    1999    Not in Committee    No defined Role    Chairman (Executive)    ED    .0293619    47    8    5    .625    .0242687    19.77277    0
            2.2e+08    216931    11    4    1999    1999    2002    Not in Committee    No defined Role    Chairman/President/CEO    ED    .0293619    47    8    5    .625    .0242687    19.77277    0
            2.2e+08    216931    11    4    2000    1999    2002    Not in Committee    No defined Role    Chairman/President/CEO    ED    .0433888    48    8    5    .625    .0098971    19.69599    0
            2.2e+08    216931    11    4    2001    1999    2002    Not in Committee    No defined Role    Chairman/President/CEO    ED    .0126061    49    8    5    .625    .0504592    19.63202    0
            2.9e+08    216931    85    5    2004    2004    2007    Not in Committee    No defined Role    Director - SD    NED    .0396373    52    8    4    .5    .0183784    19.2637    0
            2.9e+08    216931    85    5    2005    2004    2007    Not in Committee    No defined Role    Director - SD    NED    .0401977    53    8    4    .5    .0036734    19.46424    0
            2.9e+08    216931    85    5    2006    2004    2007    Not in Committee    No defined Role    Director - SD    NED    .0256189    54    8    4    .5    .0030446    19.44149    0
            3.3e+08    722610    74    18    2005    2005    2007    Human Resources and Compensation    Member    Independent Director    NED    .0875044    52    8    5    .625    .3103888    21.97249    0
            3.3e+08    722610    74    16    2005    2005    2007    Audit and Ethics    Chairman    Independent Director    NED    .0875044    52    8    5    .625    .3103888    21.97249    1
            3.3e+08    722610    74    17    2005    2005    2007    Audit and Ethics    Financial Expert    Independent Director    NED    .0875044    52    8    5    .625    .3103888    21.97249    1
            3.3e+08    722610    74    17    2006    2005    2007    Audit and Ethics    Financial Expert    Independent Director    NED    .0280352    53    8    5    .625    .4056025    22.35734    1
            3.3e+08    722610    74    16    2006    2005    2007    Audit and Ethics    Chairman    Independent Director    NED    .0280352    53    8    5    .625    .4056025    22.35734    1
            3.3e+08    722610    74    18    2006    2005    2007    Human Resources and Compensation    Member    Independent Director    NED    .0280352    53    8    5    .625    .4056025    22.35734    0
            1.4e+09    722600    71    14    2001    2001    2004    Not in Committee    No defined Role    President    ED    .0464448    49    8    4    .5        22.65454    0
            1.4e+09    722600    71    14    2002    2001    2004    Not in Committee    No defined Role    President    ED    .0762209    50    8    4    .5        22.50645    0
            1.4e+09    722600    71    14    2003    2001    2004    Not in Committee    No defined Role    President    ED    .0839686    51    8    4    .5        22.4311    0

            Comment


            • #21
              Pete:
              welcome to this forum.
              If you do not plan to use time-series related operators (such as lags and leads), Nick's reply #2 applies.
              Kind regards,
              Carlo
              (StataNow 18.5)

              Comment


              • #22
                Carlo:
                thanks for you fast response and your help.
                Currently - since I am still learning how to handle panel-regressions, regression types (reg, xtreg, areg, reghdfe etc.) + their cluster options and which tests i have to make, I do not know yet conclusively, whether I need lag / leads. So far i only need them to estimate my dependent variables.

                Since my hypotheses examine the effects on companies as dependent variables:

                # Concerning your response and Nick`s reply in #2 - Do you know (or a paper/book reference) why regressing over the same economic values doesn`t lead to somehow biased estimators? And if lags / leads are needed in later calculations: Would "xtset uniq_panel_id and panel_year" still work with the panel time-setting?

                # Seems this fine divisioning of uniq_panel_id an expedient approach to you? Here several panel_id`s are generated per one company leading to about 150000 panel-id`s (caused by the number of several persons in different committees and functions within a company) Would this lead to the right "company-clustering" later on?

                Maybe there are different approaches like just building the dataset to a "Company-Year" panel-setting without recurring accounting data and only work with average values of director age, committee-size etc.? This in my opinion would, for example, just neglect the individual director-age effect that director age exerts on the dependent variable in each year. So therefore, it seems to me that a minimum Company-Director-Year panel is necessary, even if the actual interest on the dependent variable only exists on the Company-Year level. Or may there be other cluster-approaches in the up-front regression stage?

                Many thanks in advance and kind regards



                Comment


                • #23
                  Peter:
                  1) measuring the same set of variable on the same panels at equally spaced time intervals (if this is what you mean) is the essence of panel data regression. You can consult any decent panel data econometrics textbook in this respect.
                  You may use time-series operators such as lags and leads of independent variables if you want to stick with static panel data regression;
                  2) and 3): as far as I can get your query, I would consider clustering standard on -firm- if this variable is your -panelid-.
                  Kind regards,
                  Carlo
                  (StataNow 18.5)

                  Comment

                  Working...
                  X