Announcement

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

  • #31
    This looks slightly better, but it's still not right. We are only seeing a few values of event_time_var. That shouldn't be happening. We should see them all (except for -5 as a reference category).

    Also, before we introduce the complications of a higher level interaction with age, let's get the basic model working. Then we can try adding in the extra features.

    To that end, I need you to use -dataex- to post example data that meets the following constraints:

    1. It contains observations from both 3 states where ps = 1 and 3 states where ps = 0, and contains the ps variable.
    2. It contains a variable showing the year in which each state began pre-registration
    3. It contains the year variable and the statefips variable.
    4. The years included for any given state are a block of consecutive years, and for ps = 1 states include the year in which pre-registration began as well as some before and some after.
    5. It contains the outcome variable (register).

    Then I can try to figure out what's going wrong.

    Comment


    • #32
      When I try to select what you tell me using together with the command -dataex-, the command -if- STATA shows me this message
      input statement exceeds linesize limit. Try specifying fewer variables
      .
      Code:
      Code:
      * Example generated by -dataex-. To install: ssc install dataex
      clear
      input float ps byte statefip float event_time_var int year float(years_since_implement year_first_post_implement)
      0 1 0 1988 -5 .
      0 1 0 2008 -5 .
      0 1 0 1988 -5 .
      0 1 0 1984 -5 .
      0 1 0 1988 -5 .
      0 1 0 1990 -5 .
      0 1 0 1988 -5 .
      0 1 0 2006 -5 .
      0 1 0 2008 -5 .
      0 1 0 1980 -5 .
      0 1 0 1998 -5 .
      0 1 0 1988 -5 .
      0 1 0 2010 -5 .
      0 1 0 1996 -5 .
      0 1 0 1992 -5 .
      0 1 0 1982 -5 .
      0 1 0 1980 -5 .
      0 1 0 1982 -5 .
      0 1 0 2000 -5 .
      0 1 0 1980 -5 .
      end
      label values statefip STATEFIP
      label def STATEFIP 1 "alabama", modify
      label values event_time_var event_time_var
      label def event_time_var 0 "-5", modify
      I know it's not exhaustive, but I don't know how to show it to you. Unfortunately, the only thing I could do is put a screenshot of the Data Editor (Browse).
      Click image for larger version

Name:	Screen1.png
Views:	2
Size:	122.4 KB
ID:	1605857
      Click image for larger version

Name:	Scree2.png
Views:	1
Size:	130.1 KB
ID:	1605858
      Attached Files

      Comment


      • #33
        I give you some cross tabulation, maybe it can be useful .. in fact, they are not very convincing...
        Code:
         tab ps years_since_implement
        
                   | years_since_implement
                ps |        -5          3 |     Total
        -----------+----------------------+----------
                 0 | 1,213,442          0 | 1,213,442 
                 1 |         0    495,035 |   495,035 
        -----------+----------------------+----------
             Total | 1,213,442    495,035 | 1,708,477
        Code:
        tab ps  event_time_var
        
                   |    event_time_var
                ps |        -5          3 |     Total
        -----------+----------------------+----------
                 0 | 1,213,442          0 | 1,213,442 
                 1 |         0    495,035 |   495,035 
        -----------+----------------------+----------
             Total | 1,213,442    495,035 | 1,708,477
        Code:
        tab ps year_first_post_implement
        
                   |               year_first_post_implement
                ps |      1994       2008       2010       2012       2014 |     Total
        -----------+-------------------------------------------------------+----------
                 1 |    20,042     93,926    263,663     24,556     92,848 |   495,035 
        -----------+-------------------------------------------------------+----------
             Total |    20,042     93,926    263,663     24,556     92,848 |   495,035

        Comment


        • #34
          OK, well thanks for trying. Something is clearly wrong with the years_since_implement because we are getting only 3 and -5, and we should be getting all the numbers (or nearly all of them) in between as well. Now, years_since_implement is calculated from year_first_post_implement (which looks OK), and year, I worry that there is a problem with the year variable in your data. But what you have shown does not give any information about that variable.

          Can you show the results of:

          Code:
          table year year_first_post_implement, c(min years_since_implement max years_since_implement)
          Then run your regression model again and show the results of:
          Code:
          table year year_first_post_implement if e(sample), c(min years_since_implement max years_since_implement)

          Comment


          • #35
            Yes! For sure. Here we are:
            Code:
            table year year_first_post_implement, c(min years_since_implement max years_si
            > nce_implement)
            
            ----------------------------------------
            survey    |  year_first_post_implement  
            year      | 1994  2008  2010  2012  2014
            ----------+-----------------------------
                 1982 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 1984 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 1986 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 1988 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 1990 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 1992 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 1994 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 1996 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 1998 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 2000 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 2002 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 2004 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 2006 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 2008 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 2010 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 2012 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 2014 |    3     3     3     3     3
                      |    3     3     3     3     3
            ----------------------------------------
            and then after the basic regression:
            Code:
            . table year year_first_post_implement if e(sample), c(min years_since_implement
            >  max years_since_implement)
            
            ----------------------------------------
            survey    |  year_first_post_implement  
            year      | 1994  2008  2010  2012  2014
            ----------+-----------------------------
                 1982 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 1984 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 1986 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 1988 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 1990 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 1992 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 1994 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 1996 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 1998 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 2000 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 2002 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 2004 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 2006 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 2008 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 2010 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 2012 |    3     3     3     3     3
                      |    3     3     3     3     3
                      | 
                 2014 |    3     3     3     3     3
                      |    3     3     3     3     3
            ----------------------------------------
            
            .

            I am sending you the commands that were originally used, but which for me are very complex and I cannot understand. Maybe they can help you:
            Code:
            *Generate Cohorts*
            gen ps = 0
            by statefip: egen max_pre=max(pre_reg)
            by statefip: replace ps =max_pre
            
            by statefip: egen pre_reg_y=min(year) if pre_reg==1
            by statefip: egen target=min(pre_reg_y)
            egen treated_year=group(pre_reg_y)
            by statefip: egen cohort=max(treated_year)
            replace cohort=0 if cohort==.
            
            *Generate Leads and Lags*
            forvalues kk = 0(1)5 {
            by statefip: gen F`kk'=target-2*`kk'
            by statefip: gen F`kk'_pre=0
            by statefip: replace F`kk'_pre=1 if age18_24==1 & year==F`kk'
            by statefip: gen Fold`kk'_pre=1 if age18_24==0 & year==F`kk'
            }
            
            forvalues kk = 1(1)3 {
            by statefip: gen L`kk'=target+2*`kk'
            by statefip: gen L`kk'_pre=0
            by statefip: replace L`kk'_pre=1 if age18_24==1 & year==L`kk'
            by statefip: gen Lold`kk'_pre=1 if age18_24==0 & year==L`kk'
            }
            
            by statefip: gen F5_last=0
            by statefip: replace F5_last=1 if age18_24==1 & year<=target-10 & target!=.
            by statefip: gen L3_last=0
            by statefip: replace L3_last=1 if age18_24==1 & year>=target+6 & target!=.
            
            *Generate event window*
            gen eventwindow = 0
            forvalues kk = 0(1)5 {
                replace eventwindow = 1 if F`kk'_pre == 1 | Fold`kk'_pre==1
                }
            forvalues kk = 1(1)2 {
                replace eventwindow = 1 if L`kk'_pre == 1 | Lold`kk'_pre==1
                }
            
            * Generate mean of omitted time
            gen year_omitted=.
            replace year_omitted=year if F1_pre==1
            by state: egen max_year_omitted=max(year_omitted)
            by state: egen register_young_m=mean(register) if (age18_24==1 & year==max_year_omitted)
            by state: egen register_old_m=mean(register) if (age18_24==0 & year==max_year_omitted)
            by state: egen max_register_young_m=max(register_young_m)
            by state: egen max_register_old_m=max(register_old_m)
            gen register_gap_m=max_register_old_m-max_register_young_m
            
            by state: egen vote_young_m=mean(vote) if (age18_24==1 & year==max_year_omitted)
            by state: egen vote_old_m=mean(vote) if (age18_24==0 & year==max_year_omitted)
            by state: egen max_vote_young_m=max(vote_young_m)
            by state: egen max_vote_old_m=max(vote_old_m)
            gen vote_gap_m=max_vote_old_m-max_vote_young_m
            
            by state: egen register_young_D=mean(register) if (age18_24==1 & pre_reg==0 & target!=.)
            by state: egen register_old_D=mean(register) if (age18_24==0 & pre_reg==0 & target!=.)
            by state: egen max_register_young_D=max(register_young_D)
            by state: egen max_register_old_D=max(register_old_D)
            gen register_gap_D=max_register_old_D-max_register_young_D
            
            by state: egen vote_young_D=mean(vote) if (age18_24==1 & pre_reg==0 & target!=.)
            by state: egen vote_old_D=mean(vote) if (age18_24==0 & pre_reg==0 & target!=.)
            by state: egen max_vote_young_D=max(vote_young_D)
            by state: egen max_vote_old_D=max(vote_old_D)
            gen vote_gap_D=max_vote_old_D-max_vote_young_D

            Comment


            • #36
              OK, so clearly the calculation of years_since_implement is going wrong. The code you show, however, does not include the code that creates that variable. In fact, in addition to being complicated, the code mostly creates variables that we are not currently using. Please show the code that creates the variable years_since_implement. The problem is almost certainly in that.

              Comment


              • #37
                Yes. This is the code:
                Code:
                /*GEN EVENTS ON AGE 18-24 PREREG*/
                
                so statefip
                
                *Generate Cohorts*
                gen treated_states = 0
                by statefip: egen max_pre=max(pre_reg)
                by statefip: replace treated_state=max_pre
                
                by statefip: egen pre_reg_y=min(year) if pre_reg==1
                by statefip: egen target=min(pre_reg_y)
                egen treated_year=group(pre_reg_y)
                by statefip: egen cohort=max(treated_year)
                replace cohort=0 if cohort==.

                Comment


                • #38
                  But that code does not create the variable years_since_implement. The code creating years_since_implement is doing something wrong--so we need to focus on that.

                  I did a little experimenting with some made up data that looks like what I think you have. And there was a mistake in what I proposed for it. Here's corrected code:

                  Code:
                  gen years_since_implement = year - year_first_post_implement
                  replace years_since_implement = max(min(years_since_implement, 3), -5)
                  replace years_since_implement = -5 if ps == 0
                  I think this will fix the problems
                  Last edited by Clyde Schechter; 26 Apr 2021, 13:15.

                  Comment


                  • #39
                    Code:
                    . regress register i.ps##i.years_since_implement i.statefip i.year, cluster(stat
                    > efip) 
                    years_since_implement:  factor variables may not contain negative values
                    r(452);

                    Comment


                    • #40
                      Yes, I realized back in #29 that this would happen and proposed the following solution there:

                      Code:
                      gen event_time_var = years_since_implement + 5
                      label define event_time_var  0 "-5" 1 "-4" 2 "-3" 3 "-2" 4 "-1" 5 "0" 6 "1" 7 "2" 8 "3"
                      label values event_time_var event_time_var
                      
                      regress register i.ps##i.event_time_var ... // ADDITIONAL COVARIATES AND OPTIONS AS APPROPRIATE

                      Comment


                      • #41
                        Okay, I'm driving you crazy! I'm sorry. Keep giving me the same mistake, maybe I'm doing something wrong.
                        Code:
                        /*EVENT-TIME DUMMY */
                        by statefip, sort: egen year_first_post_implement = min(cond(pre_reg, year, .))
                        gen years_since_implement = year - year_first_post_implement
                        gen event_time_var = years_since_implement + 5
                        label define event_time_var  0 "-5" 1 "-4" 2 "-3" 3 "-2" 4 "-1" 5 "0" 6 "1" 7 "2" 8 "3"
                        label values event_time_var event_time_var
                        Then, when I regress:
                        Code:
                         regress register i.ps##i.event_time_var i.statefip i.year, cluster(statefip) 
                        event_time_var:  factor variables may not contain negative values

                        Comment


                        • #42
                          I think your rushing too fast, and copying code without looking at it to see where it goes in the sequence. You skipped two important commands. The full sequence for preparing event_time var, start to finish, looks like this:

                          Code:
                          gen years_since_implement = year - year_first_post_implement
                          replace years_since_implement = max(min(years_since_implement, 3), -5)
                          replace years_since_implement = -5 if ps == 0
                          
                          gen event_time_var = years_since_implement + 5
                          label define event_time_var 0 "-5" 1 "-4" 2 "-3" 3 "-2" 4 "-1" 5 "0" 6 "1" 7 "2" 8 "3"
                          label values event_time_var event_time_var
                          Now you should not run into a factor variable problem.

                          Comment


                          • #43
                            Sorry, you're right! I fixed it, but when I regress:
                            Code:
                             regress register i.ps##i.event_time_var i.statefip i.year, cluster(statefip) 
                            note: 0b.ps#1.event_time_var identifies no observations in the sample
                            note: 0b.ps#3.event_time_var identifies no observations in the sample
                            note: 0b.ps#5.event_time_var identifies no observations in the sample
                            note: 0b.ps#7.event_time_var identifies no observations in the sample
                            note: 0b.ps#8.event_time_var identifies no observations in the sample
                            note: 1.ps#1.event_time_var omitted because of collinearity
                            note: 1.ps#3.event_time_var omitted because of collinearity
                            note: 1.ps#5.event_time_var omitted because of collinearity
                            note: 1.ps#7.event_time_var omitted because of collinearity
                            note: 1.ps#8.event_time_var omitted because of collinearity
                            note: 44.statefip omitted because of collinearity
                            
                            Linear regression                               Number of obs     =  1,350,537
                                                                            F(20, 50)         =          .
                                                                            Prob > F          =          .
                                                                            R-squared         =     0.0189
                                                                            Root MSE          =     .41782
                            
                                                           (Std. Err. adjusted for 51 clusters in statefip)
                            -------------------------------------------------------------------------------
                                          |               Robust
                                 register |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
                            --------------+----------------------------------------------------------------
                                     1.ps |  -.0101383   .0063279    -1.60   0.115    -.0228484    .0025717
                                          |
                            event_time_~r |
                                      -4  |   .0088175   .0156243     0.56   0.575    -.0225648    .0401998
                                      -2  |   .0158877   .0118842     1.34   0.187    -.0079824    .0397578
                                       0  |   .0052568    .017569     0.30   0.766    -.0300317    .0405453
                                       2  |   .0160359    .021538     0.74   0.460    -.0272244    .0592963
                                       3  |   .0075756   .0249932     0.30   0.763    -.0426248     .057776
                                          |
                                       ps#|
                            event_time_~r |
                                    0#-4  |          0  (empty)
                                    0#-2  |          0  (empty)
                                     0#0  |          0  (empty)
                                     0#2  |          0  (empty)
                                     0#3  |          0  (empty)
                                    1#-4  |          0  (omitted)
                                    1#-2  |          0  (omitted)
                                     1#0  |          0  (omitted)
                                     1#2  |          0  (omitted)
                                     1#3  |          0  (omitted)
                                          |
                                 statefip |
                                  alaska  |   .0308861   .0001915   161.29   0.000     .0305014    .0312707
                                 arizona  |  -.0927812   .0001679  -552.58   0.000    -.0931184   -.0924439
                                arkansas  |  -.0868887    .000134  -648.28   0.000    -.0871579   -.0866194
                              california  |  -.0277687    .001235   -22.48   0.000    -.0302493    -.025288
                                colorado  |  -.0091602   .0035583    -2.57   0.013    -.0163072   -.0020133
                             connecticut  |   .0009516   .0008769     1.09   0.283    -.0008096    .0027129
                                delaware  |   -.028709   .0001999  -143.59   0.000    -.0291106   -.0283074
                            district o..  |   .0346767   .0003227   107.47   0.000     .0340287    .0353248
                                 florida  |  -.0324138   .0013894   -23.33   0.000    -.0352044   -.0296232
                                 georgia  |  -.0680808   .0004669  -145.81   0.000    -.0690186    -.067143
                                  hawaii  |  -.1191363    .010763   -11.07   0.000    -.1407543   -.0975182
                                   idaho  |  -.0602836   .0001294  -465.79   0.000    -.0605435   -.0600236
                                illinois  |   .0047676   .0004448    10.72   0.000     .0038742    .0056609
                                 indiana  |  -.0617863   .0002381  -259.50   0.000    -.0622646   -.0613081
                                    iowa  |   .0002549   .0004214     0.60   0.548    -.0005916    .0011014
                                  kansas  |   -.053148   .0002981  -178.29   0.000    -.0537468   -.0525492
                                kentucky  |  -.0440332   .0004061  -108.43   0.000    -.0448488   -.0432175
                               louisiana  |    .023204    .003506     6.62   0.000     .0161621     .030246
                                   maine  |    .077071   .0020555    37.50   0.000     .0729425    .0811995
                                maryland  |  -.0092022   .0003877   -23.74   0.000    -.0099809   -.0084236
                            massachuse~s  |    .030039   .0050252     5.98   0.000     .0199456    .0401325
                                michigan  |   .0438619   .0007103    61.75   0.000     .0424353    .0452886
                               minnesota  |    .078792   .0007331   107.48   0.000     .0773196    .0802644
                             mississippi  |   .0312137   .0003136    99.52   0.000     .0305837    .0318437
                                missouri  |   .0059264   .0003565    16.62   0.000     .0052104    .0066424
                                 montana  |  -.0111077   .0001853   -59.93   0.000      -.01148   -.0107354
                                nebraska  |  -.0270129   .0002678  -100.86   0.000    -.0275508    -.026475
                                  nevada  |  -.1381774   .0005891  -234.57   0.000    -.1393606   -.1369943
                            new hampsh..  |  -.0388454   .0012625   -30.77   0.000    -.0413812   -.0363096
                              new jersey  |  -.0087847    .000886    -9.91   0.000    -.0105644    -.007005
                              new mexico  |  -.0722432   .0002705  -267.11   0.000    -.0727864      -.0717
                                new york  |  -.0350971   .0005965   -58.84   0.000    -.0362952   -.0338991
                            north caro..  |  -.0457065   .0030626   -14.92   0.000     -.051858    -.039555
                            north dakota  |   .1224431   .0001484   825.07   0.000      .122145    .1227412
                                    ohio  |  -.0354814   .0005419   -65.47   0.000    -.0365698   -.0343929
                                oklahoma  |  -.0589376   .0001088  -541.54   0.000    -.0591562    -.058719
                                  oregon  |   .0280558   .0011865    23.65   0.000     .0256727     .030439
                            pennsylvania  |  -.0779009   .0004892  -159.23   0.000    -.0788836   -.0769183
                            rhode island  |          0  (omitted)
                            south caro..  |   -.080478   .0003175  -253.45   0.000    -.0811158   -.0798403
                            south dakota  |   .0095469    .000185    51.60   0.000     .0091753    .0099185
                               tennessee  |  -.0659307   .0002355  -279.96   0.000    -.0664038   -.0654577
                                   texas  |  -.0566178    .000174  -325.43   0.000    -.0569673   -.0562684
                                    utah  |  -.0566532    .000101  -561.05   0.000     -.056856   -.0564504
                                 vermont  |   .0083417    .000756    11.03   0.000     .0068232    .0098602
                                virginia  |  -.0465189   .0003345  -139.09   0.000    -.0471907   -.0458472
                              washington  |  -.0174756   .0005158   -33.88   0.000    -.0185116   -.0164396
                            west virgi..  |  -.0852678   .0001112  -767.10   0.000    -.0854911   -.0850446
                               wisconsin  |   .0492858    .000379   130.03   0.000     .0485245    .0500471
                                 wyoming  |  -.0742549   .0005674  -130.88   0.000    -.0753945   -.0731153
                                          |
                                     year |
                                    1984  |   .0468768   .0046794    10.02   0.000     .0374778    .0562757
                                    1986  |   .0061268   .0045516     1.35   0.184    -.0030153     .015269
                                    1988  |   .0314728   .0059299     5.31   0.000     .0195622    .0433834
                                    1990  |    .002353   .0059247     0.40   0.693    -.0095471    .0142532
                                    1992  |   .0634687   .0061362    10.34   0.000     .0511439    .0757936
                                    1994  |   .0048732    .006623     0.74   0.465    -.0084294    .0181758
                                    1996  |   .0523482   .0073225     7.15   0.000     .0376406    .0670558
                                    1998  |   .0245392   .0077904     3.15   0.003     .0088917    .0401867
                                    2000  |   .0675903   .0077751     8.69   0.000     .0519736    .0832071
                                    2002  |   .0354962   .0086831     4.09   0.000     .0180556    .0529368
                                    2004  |   .0979956   .0076852    12.75   0.000     .0825594    .1134318
                                    2006  |   .0593739   .0088469     6.71   0.000     .0416044    .0771435
                                    2008  |   .1070713   .0090163    11.88   0.000     .0889616     .125181
                                    2010  |   .0636579    .008792     7.24   0.000     .0459987    .0813171
                                    2012  |   .1027669   .0095466    10.76   0.000     .0835919    .1219418
                                    2014  |   .0602205   .0098251     6.13   0.000     .0404863    .0799547
                                          |
                                    _cons |   .7464395   .0056862   131.27   0.000     .7350184    .7578606
                            -------------------------------------------------------------------------------
                            or in the other case:
                            Code:
                            regress register i.ps#i.event_time_var i.statefip i.year, cluster(statefip) 
                            note: 0b.ps#1.event_time_var identifies no observations in the sample
                            note: 0b.ps#3.event_time_var identifies no observations in the sample
                            note: 0b.ps#5.event_time_var identifies no observations in the sample
                            note: 0b.ps#7.event_time_var identifies no observations in the sample
                            note: 0b.ps#8.event_time_var identifies no observations in the sample
                            note: 1.ps#8.event_time_var omitted because of collinearity
                            
                            Linear regression                               Number of obs     =  1,350,537
                                                                            F(20, 50)         =          .
                                                                            Prob > F          =          .
                                                                            R-squared         =     0.0189
                                                                            Root MSE          =     .41782
                            
                                                           (Std. Err. adjusted for 51 clusters in statefip)
                            -------------------------------------------------------------------------------
                                          |               Robust
                                 register |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
                            --------------+----------------------------------------------------------------
                                       ps#|
                            event_time_~r |
                                    0#-4  |          0  (empty)
                                    0#-2  |          0  (empty)
                                     0#0  |          0  (empty)
                                     0#2  |          0  (empty)
                                     0#3  |          0  (empty)
                                    1#-5  |  -.0075756   .0249932    -0.30   0.763     -.057776    .0426248
                                    1#-4  |   .0012419   .0171135     0.07   0.942    -.0331315    .0356154
                                    1#-2  |   .0083122   .0178038     0.47   0.643    -.0274479    .0440722
                                     1#0  |  -.0023188   .0144806    -0.16   0.873    -.0314038    .0267663
                                     1#2  |   .0084604   .0119609     0.71   0.483    -.0155638    .0324845
                                     1#3  |          0  (omitted)
                                          |
                                 statefip |
                                  alaska  |   .0308861   .0001915   161.29   0.000     .0305014    .0312707
                                 arizona  |  -.0927812   .0001679  -552.58   0.000    -.0931184   -.0924439
                                arkansas  |  -.0868887    .000134  -648.28   0.000    -.0871579   -.0866194
                              california  |  -.0303314   .0202296    -1.50   0.140    -.0709638     .010301
                                colorado  |   -.011723   .0227306    -0.52   0.608    -.0573787    .0339328
                             connecticut  |   .0009516   .0008769     1.09   0.283    -.0008096    .0027129
                                delaware  |  -.0312718   .0193946    -1.61   0.113     -.070227    .0076835
                            district o..  |    .032114   .0191758     1.67   0.100    -.0064018    .0706298
                                 florida  |  -.0349765   .0196953    -1.78   0.082    -.0745357    .0045826
                                 georgia  |  -.0680808   .0004669  -145.81   0.000    -.0690186    -.067143
                                  hawaii  |   -.121699   .0086999   -13.99   0.000    -.1391732   -.1042249
                                   idaho  |  -.0602836   .0001294  -465.79   0.000    -.0605435   -.0600236
                                illinois  |   .0047676   .0004448    10.72   0.000     .0038742    .0056609
                                 indiana  |  -.0617863   .0002381  -259.50   0.000    -.0622646   -.0613081
                                    iowa  |   .0002549   .0004214     0.60   0.548    -.0005916    .0011014
                                  kansas  |   -.053148   .0002981  -178.29   0.000    -.0537468   -.0525492
                                kentucky  |  -.0440332   .0004061  -108.43   0.000    -.0448488   -.0432175
                               louisiana  |   .0206413   .0226309     0.91   0.366    -.0248143    .0660969
                                   maine  |   .0745082   .0214191     3.48   0.001     .0314866    .1175299
                                maryland  |   -.011765   .0191605    -0.61   0.542      -.05025      .02672
                            massachuse~s  |   .0274763   .0236844     1.16   0.252    -.0200952    .0750477
                                michigan  |   .0438619   .0007103    61.75   0.000     .0424353    .0452886
                               minnesota  |    .078792   .0007331   107.48   0.000     .0773196    .0802644
                             mississippi  |   .0312137   .0003136    99.52   0.000     .0305837    .0318437
                                missouri  |   .0059264   .0003565    16.62   0.000     .0052104    .0066424
                                 montana  |  -.0111077   .0001853   -59.93   0.000      -.01148   -.0107354
                                nebraska  |  -.0270129   .0002678  -100.86   0.000    -.0275508    -.026475
                                  nevada  |  -.1381774   .0005891  -234.57   0.000    -.1393606   -.1369943
                            new hampsh..  |  -.0388454   .0012625   -30.77   0.000    -.0413812   -.0363096
                              new jersey  |  -.0087847    .000886    -9.91   0.000    -.0105644    -.007005
                              new mexico  |  -.0722432   .0002705  -267.11   0.000    -.0727864      -.0717
                                new york  |  -.0350971   .0005965   -58.84   0.000    -.0362952   -.0338991
                            north caro..  |  -.0482693   .0216882    -2.23   0.031    -.0918313   -.0047073
                            north dakota  |   .1224431   .0001484   825.07   0.000      .122145    .1227412
                                    ohio  |  -.0354814   .0005419   -65.47   0.000    -.0365698   -.0343929
                                oklahoma  |  -.0589376   .0001088  -541.54   0.000    -.0591562    -.058719
                                  oregon  |   .0254931   .0183625     1.39   0.171     -.011389    .0623752
                            pennsylvania  |  -.0779009   .0004892  -159.23   0.000    -.0788836   -.0769183
                            rhode island  |  -.0025628   .0194303    -0.13   0.896    -.0415897    .0364642
                            south caro..  |   -.080478   .0003175  -253.45   0.000    -.0811158   -.0798403
                            south dakota  |   .0095469    .000185    51.60   0.000     .0091753    .0099185
                               tennessee  |  -.0659307   .0002355  -279.96   0.000    -.0664038   -.0654577
                                   texas  |  -.0566178    .000174  -325.43   0.000    -.0569673   -.0562684
                                    utah  |  -.0566532    .000101  -561.05   0.000     -.056856   -.0564504
                                 vermont  |   .0083417    .000756    11.03   0.000     .0068232    .0098602
                                virginia  |  -.0465189   .0003345  -139.09   0.000    -.0471907   -.0458472
                              washington  |  -.0174756   .0005158   -33.88   0.000    -.0185116   -.0164396
                            west virgi..  |  -.0852678   .0001112  -767.10   0.000    -.0854911   -.0850446
                               wisconsin  |   .0492858    .000379   130.03   0.000     .0485245    .0500471
                                 wyoming  |  -.0742549   .0005674  -130.88   0.000    -.0753945   -.0731153
                                          |
                                     year |
                                    1984  |   .0468768   .0046794    10.02   0.000     .0374778    .0562757
                                    1986  |   .0061268   .0045516     1.35   0.184    -.0030153     .015269
                                    1988  |   .0314728   .0059299     5.31   0.000     .0195622    .0433834
                                    1990  |    .002353   .0059247     0.40   0.693    -.0095471    .0142532
                                    1992  |   .0634687   .0061362    10.34   0.000     .0511439    .0757936
                                    1994  |   .0048732    .006623     0.74   0.465    -.0084294    .0181758
                                    1996  |   .0523482   .0073225     7.15   0.000     .0376406    .0670558
                                    1998  |   .0245392   .0077904     3.15   0.003     .0088917    .0401867
                                    2000  |   .0675903   .0077751     8.69   0.000     .0519736    .0832071
                                    2002  |   .0354962   .0086831     4.09   0.000     .0180556    .0529368
                                    2004  |   .0979956   .0076852    12.75   0.000     .0825594    .1134318
                                    2006  |   .0593739   .0088469     6.71   0.000     .0416044    .0771435
                                    2008  |   .1070713   .0090163    11.88   0.000     .0889616     .125181
                                    2010  |   .0636579    .008792     7.24   0.000     .0459987    .0813171
                                    2012  |   .1027669   .0095466    10.76   0.000     .0835919    .1219418
                                    2014  |   .0602205   .0098251     6.13   0.000     .0404863    .0799547
                                          |
                                    _cons |   .7464395   .0056862   131.27   0.000     .7350184    .7578606
                            -------------------------------------------------------------------------------

                            Comment


                            • #44
                              The second results you show look very close to what I was expecting, and I apologize for having suggested ## here, when # is easier to work with in this situation. All the 0#... empty notifications are expected: by construction, when ps = 0, event_time_var is always 0 (labeled as -5). The only concern I have is with -1.ps#8.event_time_var omitted because of collinearity-. It may not be a problem, but I can't tell just from the regression output. Please show the results of:

                              Code:
                              tab event_time_var ps if e(sample)

                              Comment


                              • #45
                                Here the results:
                                Code:
                                . tab event_time_var ps if e(sample)
                                
                                event_time |          ps
                                      _var |         0          1 |     Total
                                -----------+----------------------+----------
                                        -5 |   971,329    265,220 | 1,236,549 
                                        -4 |         0     21,081 |    21,081 
                                        -2 |         0     21,215 |    21,215 
                                         0 |         0     23,008 |    23,008 
                                         2 |         0     19,227 |    19,227 
                                         3 |         0     29,457 |    29,457 
                                -----------+----------------------+----------
                                     Total |   971,329    379,208 | 1,350,537
                                Then, using # instead of ## gives me a different result, but yes I prefer
                                regress register i.ps#i.event_time_var i.statefip i.year, cluster(statefip)
                                as you. Concerning t=-1, is the omitted election year, thus I think it is not a proper problem the fact it is absent; at the same time, as shown in #35 they compute the mean of this omitted time variable, even if it does not appear in any regression.
                                More, in the original paper, they used
                                [pweight= wtfinl]
                                , I was wondering if I should do the same...

                                Comment

                                Working...
                                X