Announcement

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

  • Error with eventdd

    Hi all,

    First of all, here are my data:

    Code:
    input float(count_appr_compbased time_to_treat) long ONETSOCCODE float(yearmonth event_time_CBOF) byte(IndustryFE1 stateFE1)
    0 -246 51 480 726 0 0
    0 -246 51 480 726 0 0
    0 -246 51 480 726 0 0
    0 -246 51 480 726 0 0
    0 -246 51 480 726 0 0
    0 -246 51 480 726 0 0
    0 -246 51 480 726 0 0
    0 -246 51 480 726 0 0
    3 -244 51 482 726 0 0
    4 -244 51 482 726 1 0
    1 -243 51 483 726 0 0
    2 -243 51 483 726 0 0
    3 -243 51 483 726 0 0

    At certain dates, frameworks called CBOFs were implemented at the occupation level (ONETSOCCODE), and I would like to study the impact of this implementation on the number of apprentices pursuing certain programmes (count_appr_compbased; this is a count variable). My data are repeated cross-sections.

    This is the code I ran:

    Code:
    eventdd count_appr_compbased i.IndustryFE* i.yearmonth i.stateFE* if time_to_treat!=., timevar(time_to_treat) method(ols, cluster(ONETSOCCODE)) leads(5) lags(5) keepbal(ONETSOCCODE) balance graph_op(ytitle("Number of CB apprenticeships as a function of CBOF") xlabel(-10(1)10))
    And this is the error message I received:

    variable _lf_Ptime_3 not found

    Please could someone let me know what I've done wrong?

    Best regards,
    Maxence Morlet


  • #2
    Why do you have wildcards next to your industry and state variables?

    Comment


    • #3
      I want to include all of these variables and there are hundreds. I took the example FE1 in the dataex, but there are a lot of them.

      Comment


      • #4
        I want to include all of these variables and there are hundreds. I took the example FE1 in the dataex, but there are a lot of them.

        Comment


        • #5
          Rerun your code, but before you do put "set tr on" before it.

          Comment


          • #6
            Thanks Jared, the trace is absolutely massive, but here is the excerpt of interest:

            Code:
             ---------------------------------------------------------------------------------- begin rename ---
                  - version 12
                  - mata: rename_cmd("`3'")
                  = mata: rename_cmd("")
                  ------------------------------------------------------------------------------------ end rename ---
                - qui lab var lead`i' "t=-`i'"
                = qui lab var lead2 "t=-2"
                  ------------------------------------------------------------------------------------- begin lab ---
                  - label `0'
                  = label var lead2 "t=-2"
                    --------------------------------------------------------------------------------- begin label ---
                    - version 10.0
                    - local vv : display "version " string(_caller()) ", missing:"
                    - gettoken val : 0
                    - if (strpos("`val'", "val") > 0 ) {
                    = if (strpos("var", "val") > 0 ) {
                      gettoken val 0 : 0
                      syntax anything [, nofix]
                      if "`fix'" != "" {
                      local fix ", nofix"
                      }
                      gettoken var rest : anything
                      while `"`rest'"' != "" {
                      gettoken lab rest : rest
                      local label "`lab'"
                      }
                      local vlist : list anything - lab
                      if "`lab'" == "." {
                      local lab ""
                      }
                      foreach var of varlist `vlist' {
                      `vv' _label `val' `var' `lab' `fix'
                      }
                      }
                    - else {
                    - `vv' _label `macval(0)'
                    = version 13, missing: _label var lead2 "t=-2"
                    - }
                    ----------------------------------------------------------------------------------- end label ---
                  --------------------------------------------------------------------------------------- end lab ---
                - local ++i
                - }
                - qui rename _lf_Ptime_`n' lead`i'
                = qui rename _lf_Ptime_3 lead3
                  ---------------------------------------------------------------------------------- begin rename ---
                  - version 12
                  - mata: rename_cmd("`3'")
                  = mata: rename_cmd("")
            variable _lf_Ptime_3 not found
                  ------------------------------------------------------------------------------------ end rename ---
                  qui lab var lead`i' "t=-`i'"
                  local ++i
                  }
                  }
                  else {
                  local i = 1
                  foreach n of numlist `t_1'(-1)`postbase' `prebase'(-1)1{
                  qui rename _lf_Ptime_`n' lead`i'
                  qui lab var lead`i' "t=-`i'"
                  local ++i
                  if `n'== `postbase'{
                  local ++i
                  }
                  }
                  }
                  local k = 0
                  foreach n of numlist `t0'(1)`tot'{
                  qui rename _lf_Ptime_`n' lag`k'
                  qui lab var lag`k' "t=`k'"
                  local ++k
                  }
                  local tot_lags lag*
                  local tot_leads lead*
                  }
                ------------------------------------------------------------------------- end eventdd._LaGs_LeAdS ---
              --------------------------------------------------------------------------------------- end eventdd ---
            r(111);

            Comment


            • #7
              Maxence Morlet Did you figure this out? I have incurred the same problem.

              TIA,
              Aarushi

              Comment


              • #8
                Hi all, did you find a solution to this?

                Comment

                Working...
                X