Announcement

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

  • Comparing pairs of observations within firm and within quarter in regression

    Hello all,

    I have a question regarding Stata: I have two observations by firm-quarter, namely of the CEO and the CFO and I want to exploit this data structure to control for firm fundamentals as both find executives themselves in exactly the same situation of the firm, meaning that I don't have to control for firm performance etc. I am interested in the effect of tenure on speech, controlling for ceodummy, and would like to exploit the within-firm-quarter feature to control for firm fundamentals...

    As such, each CEO observation should be benchmarked against its respective CFO position within the firm and quarter to attribute potential differences in speech to a difference in tenure.

    What would be the right Stata approach to do this? I attached a photo of how the data looks like.

    Create a group variable for firm, year, quarter (firmyearquarterid) and use areg, absorbing for firmyearquarterid? Using reghdfe and absorbing firm-fixed effects and yearquarter-fixed effects? Computing the difference in tenure and the difference in speech between CEO and CFO and then regress the speech diff on the tenure diff for CEOs and CFOs separately?

    I appreciate your help!
    Julia
    Attached Files

  • #2
    Welcome to Statalist, Julia.

    The data as you present it is not helpful to those who might wish to answer your question with sample code applied to your example, since Stata has no ability to read pictures of data.

    Please review the Statalist FAQ linked to from the top of the page, as well as from the Advice on Posting link on the page you used to create your post. Note especially sections 9-12 on how to best pose your question.

    In particular, please read FAQ #12 and use the dataex command and CODE delimiters when posting to Statalist, rather than pictures.

    The more you help others understand your problem, the more likely others are to be able to help you solve your problem.

    Comment


    • #3
      Code:
      ticker year quarter jobposition tenureqtrsrd qureturn eps ceodummy speech_total_nettone_wostop_wc
      "AAN" 2014 1 1 95   2.857144 .53 0  -.010101010101010102
      "AAN" 2014 1 2  9   2.857144 .53 1   .041176470588235294
      "AAN" 2014 2 1 96  17.857143 .12 0  -.008944543828264758
      "AAN" 2014 2 2 10  17.857143 .12 1   .056112224448897796
      "AAN" 2014 3 1 97 -31.762064 .13 0 -.0028680688336520078
      "AAN" 2014 3 2  0 -31.762064 .13 1    .03944954128440367
      "AAN" 2014 4 1 98  25.699015  .3 0  -.004784688995215311
      "AAN" 2014 4 2  1  25.699015  .3 1    .03568716780561883
      "ACM" 2009 1 1  9  25.736494 .39 0    .02242152466367713
      "ACM" 2009 1 2 13  25.736494 .39 1   .023952095808383235
      "ACM" 2009 2 1 10 -15.131792  .4 0   .013665594855305467
      "ACM" 2009 2 2 14 -15.131792  .4 1   .023887587822014052
      "ACM" 2009 3 1 11  22.699387 .45 0    .01846381093057607
      "ACM" 2009 3 2 15  22.699387 .45 1    .03623949579831933
      "ACM" 2009 4 1 12   -15.1875 .49 0   .028890959925442685
      "ACM" 2009 4 2 16   -15.1875 .49 1    .02207977207977208
      Okay, I'm sorry for the inconvenience. Is that how it works?

      Comment


      • #4
        That's an improvement, but still falls short of dataex output since the value label for jobposition is lacking and speech needs to be a double. I expect something like the following would represent dataex output on your data, following by the necessary step of combining the year and quarter into a Stata quarterly date value, and changing the display format for speech to show a little less precision.

        Regarding the Stata quarterly datetime value, Stata's "datetime" variables are complicated and there is a lot to learn. If you have not already read the very detailed Chapter 24 (Working with dates and times) of the Stata User's Guide PDF, do so now. If you have, it's time for a refresher. After that, the help datetime documentation will usually be enough to point the way. You can't remember everything; even the most experienced users end up referring to the help datetime documentation or back to the manual for details. But at least you will get a good understanding of the basics and the underlying principles. An investment of time that will be amply repaid.

        Code:
        * Example generated by -dataex-. To install: ssc install dataex
        clear
        input str3 ticker float(year quarter jobposition tenure qureturn eps ceodummy) double speech
        "AAN" 2014 1 1 95   2.857144 .53 0  -.010101010101010102
        "AAN" 2014 1 2  9   2.857144 .53 1   .041176470588235294
        "AAN" 2014 2 1 96  17.857143 .12 0  -.008944543828264758
        "AAN" 2014 2 2 10  17.857143 .12 1   .056112224448897796
        "AAN" 2014 3 1 97 -31.762064 .13 0 -.0028680688336520078
        "AAN" 2014 3 2  0 -31.762064 .13 1    .03944954128440367
        "AAN" 2014 4 1 98  25.699015  .3 0  -.004784688995215311
        "AAN" 2014 4 2  1  25.699015  .3 1    .03568716780561883
        "ACM" 2009 1 1  9  25.736494 .39 0    .02242152466367713
        "ACM" 2009 1 2 13  25.736494 .39 1   .023952095808383235
        "ACM" 2009 2 1 10 -15.131792  .4 0   .013665594855305467
        "ACM" 2009 2 2 14 -15.131792  .4 1   .023887587822014052
        "ACM" 2009 3 1 11  22.699387 .45 0    .01846381093057607
        "ACM" 2009 3 2 15  22.699387 .45 1    .03623949579831933
        "ACM" 2009 4 1 12   -15.1875 .49 0   .028890959925442685
        "ACM" 2009 4 2 16   -15.1875 .49 1    .02207977207977208
        end
        label values jobposition POS
        label def POS 1 "CEO", modify
        label def POS 2 "CFO", modify
        
        // having read in the dataex output, make a few more changes
        // create quarterly date
        generate yrqtr = yq(year, quarter)
        format yrqtr %tq
        drop year quarter
        order ticker yrqtr
        // better display format for speech
        format speech %9.5f
        list, sepby(ticker) noobs
        Code:
          +-----------------------------------------------------------------------------+
          | ticker    yrqtr   jobpos~n   tenure    qureturn   eps   ceodummy     speech |
          |-----------------------------------------------------------------------------|
          |    AAN   2014q1        CEO       95    2.857144   .53          0   -0.01010 |
          |    AAN   2014q1        CFO        9    2.857144   .53          1    0.04118 |
          |    AAN   2014q2        CEO       96    17.85714   .12          0   -0.00894 |
          |    AAN   2014q2        CFO       10    17.85714   .12          1    0.05611 |
          |    AAN   2014q3        CEO       97   -31.76206   .13          0   -0.00287 |
          |    AAN   2014q3        CFO        0   -31.76206   .13          1    0.03945 |
          |    AAN   2014q4        CEO       98    25.69901    .3          0   -0.00478 |
          |    AAN   2014q4        CFO        1    25.69901    .3          1    0.03569 |
          |-----------------------------------------------------------------------------|
          |    ACM   2009q1        CEO        9    25.73649   .39          0    0.02242 |
          |    ACM   2009q1        CFO       13    25.73649   .39          1    0.02395 |
          |    ACM   2009q2        CEO       10   -15.13179    .4          0    0.01367 |
          |    ACM   2009q2        CFO       14   -15.13179    .4          1    0.02389 |
          |    ACM   2009q3        CEO       11    22.69939   .45          0    0.01846 |
          |    ACM   2009q3        CFO       15    22.69939   .45          1    0.03624 |
          |    ACM   2009q4        CEO       12    -15.1875   .49          0    0.02889 |
          |    ACM   2009q4        CFO       16    -15.1875   .49          1    0.02208 |
          +-----------------------------------------------------------------------------+
        It seems to me that "the difference in tenure and the difference in speech between CEO and CFO" would be the same values for the CEO and CFO (or else the negatives) for any ticker/quarter, so that the separate regressions you suggest for the CEOs and CFOs would produce identical results.

        The output of help areg tells us "areg is designed for datasets with many groups, but not a number of groups that increases with the sample size" and this does not seem consistent with your data.

        It seems to me reghdfe will be your tool, and the author Sergio Correia participates in Statalist and may be able to advise you further.

        Comment


        • #5
          Thank you for your help! I performed three different regressions now:

          a) standard linear regression clustering standard errors on the firm-level:
          Code:
          reg speech tenure ceodummy eps qureturn, vce(cluster firm_id)
          b) reghdf with firm and quarter fixed effects
          Code:
          reghdfe speech tenure ceodummy, absorb(firm_id yearquarter_id) vce(cluster firm_id)
          c) panel regressions separately for each job position to be able to create a time series with one observation per year-quarter per firm
          Code:
          xtreg speech tenure eps qureturn i.year, fe vce(cluster firm_id)
          I am still wondering what the right approach would be... conceptually, I would like to see the results of the within-firm comparing CEO and CFO in the same quarter... Is that what REGHDF does here? Since with all speech variables that I use I get significant results using linear regressions and non-significant results using REGHDF, I was not sure if this is the right thing to do... or could the reason be that b) takes out the largest degree of freedom and therefore loses statistical power? Or did I perform REGHDF wrong? Or is maybe another approach right to perform the within-firm tests?

          Comment

          Working...
          X