Announcement

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

  • Question about the command fuzzydid

    Dear all, When I run the codes of fuzzydid help file,but I get an error.I don't know why.

    Code:
         use turnout_dailies_1868-1928.dta,clear
    
       gen G1872=(fd_numdailies>0)-(fd_numdailies<0) if  (year==1872)&fd_numdailies!=.&sample==1
    
       sort cnty90 year
    
       replace G1872=G1872[_n+1] if cnty90==cnty90[_n+1]&year==1868
    
       fuzzydid pres_turnout G1872 year numdailies, did tc cic newcateg(0 1 2 45)   breps(200) cluster(cnty90)
    
      When only one G variable is specified by the user, that variable must either be equal to 0, 1, or be 
      missing. See section 4.2 of the paper in the Stata journal for more details on how to create the G 
      variables.
    Best
    Raymond
    Best regards.

    Raymond Zhang
    Stata 17.0,MP

  • #2
    I encountered this issue before. If you look at

    Code:
    . tab G1872
    
          G1872 |      Freq.     Percent        Cum.
    ------------+-----------------------------------
             -1 |         54        3.65        3.65
              0 |      1,234       83.49       87.14
              1 |        190       12.86      100.00
    ------------+-----------------------------------
          Total |      1,478      100.00
    You can see that there is a -1 value in G1872 (the G variable). In the case of the example in the help file you can get fuzzydid (from Stata Journal) to work using

    Code:
    . fuzzydid pres_turnout G1872 year numdailies if G1872 != -1, did tc cic newcateg(0 1 2 45) breps(200) cluster(cnty9
    > 0)
    (running estim_wrapper on estimation sample)
    
    Bootstrap replications (200)
    ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5
    ..................................................    50
    ..................................................   100
    ..................................................   150
    ..................................................   200
    
    Estimator(s) of the local average treatment effect with bootstrapped standard errors.  Cluster variable: cnty90.
    Number of observations:  1424 .
    
                 |      LATE    Std_Err          t    p_value   lower_ic   upper_ic
    -------------+------------------------------------------------------------------
           W_DID |  .0047699   .0156527   .3047304   .7605715  -.0243498   .0370637
            W_TC |  .0266618   .0153468   1.737291   .0823359  -.0023919   .0537235
           W_CIC |  .0133223   .0128159   1.039512   .2985666  -.0180014   .0348044

    Comment


    • #3
      Thanks a lot.You solved my problem.
      Best regards.

      Raymond Zhang
      Stata 17.0,MP

      Comment

      Working...
      X