Announcement

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

  • F test overall joint significance

    In the attached image I have the time_to_treat variable where if time_to_treat = -1 after that every value is the lead and before -1 everything is lag. This is a way of doing event study.

    Could anyone tell me how can I do the joint significance of some selected values of time_to_treat variable like a F-test for coefficients? Whenever I'm trying to do the joint significance it's providing me an error.

    In the following section I'm providing my data so that it would be easier to give me a feedback on this.

    . dataex time_to_treat coef se

    ----------------------- copy starting from the next line -----------------------
    [CODE]
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float(time_to_treat coef se)
    -24 .008508598 .005053634
    -23 .0022498965 .0045150574
    -22 .0013960946 .004846417
    -21 .002219392 .004902562
    -20 .0020763692 .004785649
    -19 .006928295 .004210821
    -18 .0027256764 .004483498
    -17 -.00321555 .005539487
    -16 -.008326484 .005001508
    -15 -.01394333 .007769032
    -14 -.0017484284 .0043266085
    -13 .00001703563 .006014496
    -12 .0008115402 .003706033
    -11 -.012659636 .00606336
    -10 -.01776172 .006103916
    -9 -.015083795 .0070582
    -8 -.013199518 .007084396
    -7 -.011645027 .005474801
    -6 -.009051482 .003864478
    -5 -.0006222086 .0034474526
    -4 .0011750647 .0024080195
    -3 .0014252485 .002636254
    -2 .002093018 .0017095497
    -1 0 0
    0 -.0009728096 .0012391168
    1 -.0019464534 .0019846538
    2 -.000770941 .002230628
    3 -.001301857 .002529583
    4 .0017778093 .003131443
    5 -.00698993 .002825085
    6 -.005874823 .0034410385
    7 -.009891002 .005276658
    8 -.0135705 .005358401
    9 -.0199844 .007074628
    10 -.02002133 .007729002
    11 -.0178371 .006769186
    12 -.006262023 .00446658
    13 -.0088388445 .0045080045
    14 -.00482809 .004252179
    15 -.0044788974 .005194928
    16 -.00049108505 .005439484
    17 -.004579766 .0046234056
    18 -.00701394 .0042848717
    19 -.006032526 .004182411
    20 -.003769428 .004684277
    21 -.00958967 .005299903
    22 .0003095985 .004741376
    Attached Files

  • #2
    your question is not clear to me - and you don't provide the code you tried but I think the following is the place to start
    Code:
    help test
    you might be particularly interested in the testparm command in that help file

    Comment


    • #3
      This is the code I tried in the beginning and got the following error message :

      test time_to_treat
      time_to_treat not found
      r(111);

      After your kind suggestion also tested out the

      testparm time_to_treat
      no such variables;
      the specified varlist does not identify any testable coefficients
      r(111);

      I don't know why its saying that there is no testable coefficient. I want to the same what Damian Clarke ( 2020 ) did the same his leads and lags - testing overall joint significance. My leads and lags are given in time_to_treat variable ( as in the value after -1 are leads and before -1 are lags).

      Attached Files

      Comment


      • #4
        Always show your commands and output, including the error message. You could be getting an error because of a typo, or it could be there is some fundamental flaw in your approach.

        Incidentally dataex is not being used correctly. Indeed it gets cut off because of the image you provide covers up the last several lines.
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        StataNow Version: 18.5 MP (2 processor)

        EMAIL: [email protected]
        WWW: https://www3.nd.edu/~rwilliam

        Comment


        • #5
          What was the command before the test command though? The dataex file is incomplete and we can't see all the commands you gave (or should have given). Try to post an example from start to finish (dataex output followed by other stata commands) so we can replicate exactly what you are doing.
          -------------------------------------------
          Richard Williams, Notre Dame Dept of Sociology
          StataNow Version: 18.5 MP (2 processor)

          EMAIL: [email protected]
          WWW: https://www3.nd.edu/~rwilliam

          Comment


          • #6
            . dataex time_to_treat coef se

            ----------------------- copy starting from the next line -----------------------
            Code:
            * Example generated by -dataex-. For more info, type help dataex
            clear
            input float(time_to_treat coef se)
            -24    .008508598  .005053634
            -23   .0022498965 .0045150574
            -22   .0013960946  .004846417
            -21    .002219392  .004902562
            -20   .0020763692  .004785649
            -19    .006928295  .004210821
            -18   .0027256764  .004483498
            -17    -.00321555  .005539487
            -16   -.008326484  .005001508
            -15    -.01394333  .007769032
            -14  -.0017484284 .0043266085
            -13  .00001703563  .006014496
            -12   .0008115402  .003706033
            -11   -.012659636   .00606336
            -10    -.01776172  .006103916
             -9   -.015083795    .0070582
             -8   -.013199518  .007084396
             -7   -.011645027  .005474801
             -6   -.009051482  .003864478
             -5  -.0006222086 .0034474526
             -4   .0011750647 .0024080195
             -3   .0014252485  .002636254
             -2    .002093018 .0017095497
             -1             0           0
              0  -.0009728096 .0012391168
              1  -.0019464534 .0019846538
              2   -.000770941  .002230628
              3   -.001301857  .002529583
              4   .0017778093  .003131443
              5    -.00698993  .002825085
              6   -.005874823 .0034410385
              7   -.009891002  .005276658
              8     -.0135705  .005358401
              9     -.0199844  .007074628
             10    -.02002133  .007729002
             11     -.0178371  .006769186
             12   -.006262023   .00446658
             13  -.0088388445 .0045080045
             14    -.00482809  .004252179
             15  -.0044788974  .005194928
             16 -.00049108505  .005439484
             17   -.004579766 .0046234056
             18    -.00701394 .0042848717
             19   -.006032526  .004182411
             20   -.003769428  .004684277
             21    -.00958967  .005299903
             22   .0003095985  .004741376
            end

            Comment


            • #7
              These are the two following commands and the error messages I'm getting :
              test time_to_treat
              time_to_treat not found
              r(111);

              end of do-file

              r(111);

              testparm time_to_treat
              no such variables;
              the specified varlist does not identify any testable coefficients
              r(111);

              end of do-file

              r(111);


              I deeply apologize for any unintentional inconvenience

              Comment


              • #8
                For doing the whole replication you can use the data here :

                use "http://www.damianclarke.net/stata/bacon_example.dta", clear
                gen timeToTreat = year - _nfd

                Then from this website you can kindly copy paste the command, I can attach the image but if I try to copy paste it ( from the stata section ) then it becomes very messy. ( https://lost-stats.github.io/Model_E...t_study.html#r )


                Attached Files

                Comment


                • #9
                  You have to do some kind of estimation before using the test command.

                  Comment


                  • #10
                    Dear Dr. Wooldridge,

                    This is the first time I'm doing event study and I'm totally out of my depth. The above command is the only one that works for my cross section data ( Which I got from Dr. Nick Huntington-Klein 's website https://lost-stats.github.io/Model_E...t_study.html#r ) .

                    If you could kindly give me a lead what kind of estimation I can do with my data to go further ahead then that would be very kind.

                    Comment


                    • #11
                      Here's the basic idea

                      Code:
                      use "http://www.damianclarke.net/stata/bacon_example.dta", clear 
                      gen timeToTreat = year - _nfd
                       
                      eventdd asmrs pcinc asmrh cases i.year, timevar(timeToTreat) method(fe, cluster(stfips))  lags(10) leads(10) accum
                      
                      // post estimation for eventdd
                      estat eventdd
                      
                      // by hand 
                      test lag10  lag9 lag8 lag7 lag6 lag5 lag4 lag3 lag2 lag1 lag0
                      Res:
                      Code:
                      . estat eventdd
                                                             
                            Joint significance test for
                                 leads and lags
                      ----------------------------------------
                                      LEADS
                      ----------------------------------------
                      F-stat:                    0.8738
                      P-value:                   0.5547
                      Degrees of freedom        (9,48)
                      ----------------------------------------
                                       LAGS
                      ----------------------------------------
                      F-stat:                    1.7641
                      P-value:                   0.0876
                      Degrees of freedom        (11,48)
                      ----------------------------------------
                      
                      . 
                      . 
                      . test lag10  lag9 lag8 lag7 lag6 lag5 lag4 lag3 lag2 lag1 lag0
                      
                       ( 1)  lag10 = 0
                       ( 2)  lag9 = 0
                       ( 3)  lag8 = 0
                       ( 4)  lag7 = 0
                       ( 5)  lag6 = 0
                       ( 6)  lag5 = 0
                       ( 7)  lag4 = 0
                       ( 8)  lag3 = 0
                       ( 9)  lag2 = 0
                       (10)  lag1 = 0
                       (11)  lag0 = 0
                      
                             F( 11,    48) =    1.76
                                  Prob > F =    0.0876

                      Comment


                      • #12
                        Thanks everyone for putting their time for answering my question. Really appreciate everyone's patience with me !

                        Comment


                        • #13
                          Hi all - thanks so much for the advice presented here. I'm also using the eventdd package and was wondering if there are other recommended postestimation tests, robustness checks, and/or diagnostics I should run? Any/all thoughts would be much appreciated, thank you!

                          Comment

                          Working...
                          X