Announcement

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

  • Cross Sectional Regression vs Panel Data

    I am trying to regress returns as my dependent variable on forecast errors. My dependent variable is returns between announcement dates for company earnings. My independent variables are POST92 which is an indicator variable equal to 1 if the year is greater than or equal to 1992, SUE1 (earnings surprise based on GAAP earnings), SUE2 (earnings surprise based on street earnings). Could someone explain the difference between a cross sectional and pooled time series regression. RDQ is the report date of the quarterly earnings.
    Is cross sectional regression:
    RET2 POST92 sue3 sue3_post92 sue1 sue1_post92

    Is the panel data regression:
    xtset companyid rdq, daily
    reg RET2 POST92 sue3 sue3_post92 sue1 sue1_post92

    Which regression should I use if my dependent variable is returns between announcement dates?
    When I use xtset should I use daily or quarterly? My returns and data are quarterly but they are on different dates?
    Thank you!


    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input double RET2 float POST92 double sue3 float sue3_post92 double sue1 float(sue1_post92 companyid) long(rdq fqenddt)
         .3825624894142987 0     .00656250215195383             0    -.04042098290452338            0 1  9484  9465
        .06463903692347417 0   .0009570554387805897             0   -.017441886536802304            0 1  9576  9555
        .28933806667051654 0    .001276595951652366             0    -.01699332442252221            0 1  9846  9830
        .03966245118426137 0 -.00024793403871329906             0    -.01619581269463452            0 1  9943  9920
         .1526717555643411 0 -.00024691378956477654             0   -.017871143277881904            0 1 10056 10012
       -.33336227832598264 0   .0010033451983763701             0    -.01204138579134971            0 1 10126 10104
          .456623802011342 0  -.0012030076570071968             0   -.011202837638800443            0 1 10211 10195
        .09032602107529675 0   .0004761905086167827             0    -.00716132860832666            0 1 10303 10286
       .008319638820175168 0   .0011940309385619166             0   -.006535444715543647            0 1 10428 10378
       -.06328431248592592 0                      0             0   -.007209435661502524            0 1 10491 10470
        .10775971865496925 0  -.0004347826448015157             0   -.008708198659711234            0 1 10576 10561
        .20368186342930272 0 -.00019138767160099037             0  -.0076643040447050325            0 1 10671 10651
      -.025196124192679137 0  .00028880872790210967             0    -.00549446267435422            0 1 10855 10835
        -.1512158416491043 0  -.0008450707857966258             0   -.007173386418874048            0 1 10944 10926
       -.29925012908915316 0  -.0022489976378973794             0   -.009473120341304006            0 1 11023 11016
         -.347610836307913 0  -.0018823531520000228             0   -.012140399484111355            0 1 11128 11108
        -.2721463789378574 0  .00031496066781574046             0    -.01298741862819374            0 1 11219 11200
       .018097081775555468 0   .0038834957217457724             0  -.0038627231510238815            0 1 11401 11381
        .38668142437001074 0   -.006464647211672363             0   -.016649480942402033            0 1 11675 11656
       -.18094794116926627 0  -.0025806454792924433             0    -.00960217811272855            0 1 11766 11747
      -.021716851629548173 0   .0038834957217457745             0    -.01953196346127638            0 1 11858 11839
         .1370213670698317 1   -.045252530481706556    -.04525253   -.053240423930560776   -.05324042 1 12131 12112
         .1639044227315094 1   .0014545455550413287   .0014545455   -.003311582432338276 -.0033115824 1 12402 12387
       -.17892740797239803 1  -.0018897640068944411   -.001889764   -.007302315071282182  -.007302315 1 12494 12477
     -.0001059150321472968 1  -.0037037040960219885   -.003703704   -.010663324299586921  -.010663324 1 12681 12661
       .058833884767486966 1  -.0019047621122902736   -.001904762   -.007819481708106632  -.007819482 1 12767 12752
         .3511051256968938 1    .002181818332561994   .0021818182   -.003263070623161646  -.003263071 1 12857 12842
       -.04333834476447063 1                      0             0   -.006870634741254025  -.006870635 1 13222 13208
         .1655429734326872 1   .0013559322910274868   .0013559323   -.004840040357100777   -.00484004 1 13331 13300
        .18028583605667015 1    .002312138982792637    .002312139  -.0032970033049273106  -.003297003 1 13409 13392
      -.023507844801646027 1   .0006694564089005797   .0006694564   -.004388651772444544  -.004388652 1 13495 13483
         .2320445428295035 1     .00098039303690967    .000980393   -.006875905254376856  -.006875905 1 13586 13573
        .07641183406777596 1  .00032258080395429283   .0003225808   -.005818079015329877  -.005818079 1 13690 13665
        .13350956154814897 1   .0010372908974259469   .0010372909   -.004458003532391312 -.0044580037 1 13860 13848
      -.062041323374211865 1  .00010973936899862896  .00010973937   .0003193498863817068  .0003193499 1 13951 13938
       -.19094322412172904 1   .0011347517730496443   .0011347518   .0016419985950770345  .0016419986 1 14055 14030
        .05937887792426477 0   -.023333340761113472             0    -.06396676620598431            0 2 11290 11261
       -.03220780963185976 1                      0             0                      0            0 2 12641 12630
        .16000000237947076 0    .005833333333333333             0    -.15675563343818003            0 3  9373  9343
         .1791907543449771 0   .0018181818181818169             0    -.15026719317223605            0 3  9488  9435
        .15596330332573394 0    .006666666666666668             0    -.14141095429498332            0 3  9566  9527
    1.9272765605649056e-09 0    .003287671232876712             0     -.0931083805113243            0 3  9742  9708
      -.012345671981141448 0   .0037037037037037017             0     -.0744878236179449            0 3  9848  9800
        .08641975171698091 0   -.003191489361702128             0    -.09332207545448754            0 3  9924  9892
        .23333333614567553 0   .0007792207792207799             0    -.11773955190783546            0 3 10014  9981
        -.1106194619291111 0    .004375000000000001             0    -.09826271998750434            0 3 10105 10073
        .07142857264256275 0   .0024999999999999988             0    -.07369990808941648            0 3 10211 10165
       -.24324325252892887 0   .0005797101449275368             0    -.06752849793788947            0 3 10287 10257
        -.1363636387355125 0  -.0023668639053254434             0    -.06155186114233967            0 3 10378 10347
        .13186813231508498 0   .0014814814814814786             0    -.08064401643997773            0 3 10462 10439
       -.06862745265930381 0    .004301075268817203             0     -.0821098045614505            0 3 10575 10531
        .22105263649298257 0   -.004485981308411215             0    -.08478102884145909            0 3 10645 10623
        .15873016489468883 0   .0006015037593984968             0    -.06409517788546786            0 3 10827 10804
        .05882352502983079 0     .00857142857142857             0   -.050634827378391326            0 3 11011 10988
        .25000000529063815 0   .0035000000000000005             0    -.06247041742228911            0 3 11198 11169
        .32499999742913244 0    .001523809523809523             0    -.06089215570326055            0 3 11374 11353
        -.3614457792053346 0   .0014285714285714284             0    -.04362801521936379            0 3 11471 11442
       -.11111110792643097 0  -.0024778761061946906             0    -.05188163929767592            0 3 11562 11534
        .04639175478905977 0                      0             0    -.04977668794214434            0 3 11672 11626
        .32380952311839817 1   -.011153846153846153   -.011153846    -.06868648710993727  -.068686485 3 11736 11718
       .055147059479991434 1    .002201834862385321    .002201835     -.0502031852899153   -.05020319 3 11835 11808
         .2937063013335015 1   .0017328519855595683    .001732852    -.04984937579039733   -.04984938 3 11925 11900
        -.1467391307663778 1   .0008275862068965525   .0008275862   -.057260337527234015   -.05726034 3 12038 11992
         .3081760919123908 1  -.0002139037433155082 -.00021390374    -.03091850867463112   -.03091851 3 12106 12084
         .2870370399984927 1  .00024242424242424264  .00024242424    -.04296133076545167   -.04296133 3 12198 12173
         .1608391550540147 1  -.0002739726027397263  -.0002739726    -.01377510905943129   -.01377511 3 12403 12357
       -.03821656550936181 1 -.00027210884353741523 -.00027210885   -.008989812702625515  -.008989813 3 12471 12449
         .2105263103238857 1   .0004747774480712157  .00047477745   -.009838292568748975  -.009838292 3 12562 12538
       -.04143646271764245 1   .0006451612903225812   .0006451613   -.009696890041335348   -.00969689 3 12654 12630
         .1642651315451371 1  .00042440318302387303   .0004244032   -.011644418968630868   -.01164442 3 12772 12722
        .33333333711114865 1   .0003030303030303033   .0003030303  -.0020119106876206943 -.0020119108 3 12921 12903
       -.04950492780683191 1   .0002580645161290325   .0002580645  -.0009114532552162914 -.0009114533 3 13019 12995
      -.006666665920421089 1                      0             0  -.0011368180334093115 -.0011368181 3 13136 13087
        .18749999259704264 1   .0002588996763754048  .00025889967  -.0006695669251931166  -.000669567 3 13205 13179
        .19473684961052018 1  .00011904761904761916  .00011904762  -.0009061190250355925  -.000906119 3 13297 13269
        .17180617081176042 1   .0007100591715976325   .0007100592 -.00047459460271211264 -.0004745946 3 13388 13361
       -.11913358233480009 1  .00018281404478959876  .00018281404   .0028324474453854196  .0028324474 3 13494 13453
        .23913043610236628 1                      0             0  -.0008078291798763212 -.0008078292 3 13569 13545
        .04744524757612534 1   .0003827751196172252   .0003827751   .0037941458300296215   .003794146 3 13662 13634
      -.028052799854278443 1   .0002476780185758516  .00024767802    .002748092895168553   .002748093 3 13748 13726
       -.32885908642528305 1                      0             0   .0034964143556960752   .003496414 3 13857 13818
       -.10937500034813841 0   -.005384615384615381             0   -.005073137525112485            0 4  9483  9465
        .04587155885945271 0                   .039             0    .040393841935994095            0 4  9951  9920
       -.41025642110262917 0   .0036363636363636346             0   .0011725730265888883            0 5  9267  9221
        .12781954238191218 0  -.0023437504541016507             0    -.02170798388699184            0 6  9568  9496
       .001999997648265195 0 -.00037735854486769534             0   -.016010881442556243            0 6  9631  9586
        -.1612903197604707 0 -.00043478264461247856             0   -.004986645965863663            0 6  9933  9861
        .07493182567713896 0    .021224491441899338             0   -.005131996638448436            0 6 10449 10408
       .050895555239909074 0  -.0011881189012841957             0   -.010542688814357506            0 6 10541 10500
        .11360332045254284 0   -.000720720795000414             0   -.010804051730851501            0 6 10659 10592
        .08455517913177868 0   .0007339450570154178             0   -.007971367390544125            0 6 10720 10682
       -.02061058857015008 0   -.000888888964213999             0  -.0076406066718788836            0 6 10813 10773
       -.07068446903516135 0  -.0006818182555785211             0    -.00727984303831914            0 6 11077 11047
        .06381318756307941 0   .0017734000812644447             0    -.00508654428194152            0 6 11382 11322
        .01705817364345541 0    .001545895087363809             0   -.004658575736244992            0 6 11442 11412
        .02572543575977493 0   .0005673758865248232             0   -.005647603239273678            0 6 11632 11595
        .09623529996196267 0   -.008979591836734696             0   -.009726712971338949            0 6 11757 11687
       -.10746651588886047 1  -.0008695652173913051  -.0008695652  -.0009296360414775961  -.000929636 6 11821 11778
      -.009879692382547933 1  -.0024161073825503345   -.002416107   .0007953061279670278  .0007953061 6 11900 11869
        .06573488030503838 1   .0037894736842105274    .003789474  -.0066286997957126625    -.0066287 6 12004 11961
    end
    format %tdD_m_Y rdq
    format %tdD_m_Y fqenddt

  • #2
    You appear to have multiple observations of each company on several dates. This is longitudinal, or panel data, and in general requires the use of panel (xt) estimators. So you definitely need to -xtset companyid-. Now, there are two different date variables in your data, rdq and fqenddt. It isn't at all clear to me which of these you should be using as the time variable in your -xtset- command. Actually, you may not need to choose among them: unless you are planning to do analyses that involve time series operations like lag, lead, seasonal difference, etc., or estimate autoregressive correlation structure, you do not have to specify a time variable in -xtset- at all: just the panel identifier (companyid) suffices. So unless you post back stating that you will need to do some of those things, I'm going to skip your question about whether to specify daily or quarterly for that. (Spoiler: The answer is probably quarterly, but you can't do that with these date variables because they are daily, not quarterly, internal format dates. So you would have to first convert to quarterly dates, and then use the quarterly date variable, with a quarterly specification.)

    After -xtset-ing your data, you would then need to use -xtreg-, not -reg- to estimate your model. There is the issue of whether to use fixed or random effects for this. It is popular in finance to use a Hausman test to decide this issue (though it is not my preference).

    Now, there is a small possibility that after running -xtreg-, at the bottom of the output you will see that the test of the hypothesis that all u_i = 0 is not rejected and that rho is very close to zero. In that case, if you prefer the simplicity of -regress-, it would be OK to revert to that. But this doesn't happen very often with real data, so don't expect it.

    Now, looking at your data and your stated goals, I see that you are trying to fit an interaction model and you have calculated your own interaction terms. That's not a good idea. You will then have to do a lot of extra work to correctly interpret the results of your regression: the process of doing that is long, tedious, and error-prone. Unless you love algebra and are good at it, I don't recommend trying. Instead, do it the easy way. Forget your homemade interaction terms and use factor variable notation in your regression (-help fvvarlist- for details) and then let -margins- do the interpretation for you. Something like this:

    Code:
    xtreg RET2 i.post92##c.(sue1 sue3) // SPECIFY FE OR RE OPTION AS APPROPRIATE
    margins post92, dydx(sue1 sue3)
    This will give you the marginal effects of sue1 and sue3 in both pre- and post-92 conditions, along with standard errors, confidence intervals, and p-values. I'm guessing that's most if not all of what you want to find from this data.



    Comment


    • #3
      Thanks Clyde. This is excellent.

      Comment


      • #4
        Code:
        xtreg RET2 i.post92##c.(sue1 sue3), fe
        If I use this code are the fixed effects going to be based on companyid since this is the variable in the xtset?

        Comment


        • #5
          If I use this code are the fixed effects going to be based on companyid since this is the variable in the xtset?
          Yes. All of the -xt- modeling commands automatically use the panel variable named in the -xtset- command for the fixed effects when you specify the -fe- option. (Unless you override this behavior explicitly using the -i()- option.) Indeed, that is the whole point of the -xtset- command, it's very reason for being.

          If you are going to be working with this kind of data with any frequency it behooves you to read the [XT] volume of the PDF documentation that is installed with Stata. While there may be some commands there that you will never use, and can skip , most people who work with financial data end up needing to use most of these commands. So do familiarize yourself with them.

          Comment

          Working...
          X