Announcement

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

  • callagain command is not working

    Hi Everyone

    I am trying to estimate bounds for my treatment effect with Behaghel et al.'s command "callagain" (which can be found here). For it to run one needs the following:
    • dependent variable y: in my case it is a standardized index variable called; laoindex
    • treatment variable Z: in my case this is just a binary treatment variable; treatment
    • response variable R: in my case this is a binary variable that indicate nonmissingness; nonmissing
    • number of calls variable N: in my case this is how many reminders were sent out {0,1,2}; reminder

    The command looks the following way:
    callagain laoindex treatment nonmissing reminder, ytype("cont") graph

    However, whenever I run this command, Stata tells me:
    "variable Z not found"



    I also tried to run it on another computer and with a Stata-provided example data set, leaving me with the same error.
    Did anyone encounter a similar problem with this command? If so, were you able to fix it?

    Thanks a lot for the help!
    Best,
    Arto


    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float(laoindex treatment nonmissing reminder)
      -.2879483 0 1 2
     -1.9779216 0 1 2
     -1.5065705 0 1 0
      1.1951087 0 1 0
     -.09251682 0 1 0
     -.11548679 1 1 1
              . 0 0 2
              . 1 0 2
       1.746948 1 1 0
     -.56386805 0 1 0
              . 0 0 2
    -.012028575 0 1 1
     -1.0352192 0 1 0
              . 1 1 2
      -.2879483 0 1 0
       -.575353 1 1 0
     -1.5065705 1 1 1
              . 0 1 2
              . 1 1 2
      -.4718948 1 1 1
      2.2182992 0 1 0
              . 1 0 2
              . 0 0 2
      1.1951087 1 1 0
       1.275597 0 1 0
     -1.0352192 1 1 0
      1.5630016 0 1 0
      -1.322624 0 1 0
      -2.449273 1 1 1
     -1.0352192 0 1 1
              . 0 0 2
              . 0 0 2
      2.2182992 0 1 2
              . 0 0 2
       1.379055 0 1 0
     -.11548679 1 1 2
     -.58683795 0 1 0
      -2.449273 1 1 1
              . 0 0 2
       1.746948 0 1 0
       1.746948 0 1 0
              . 0 0 2
       .9077039 0 1 1
              . 1 1 2
      -.2994333 1 1 0
       .5398109 0 1 0
      -.2994333 0 1 2
              . 0 0 2
       1.746948 0 1 0
       .6317841 0 1 0
       1.379055 1 1 0
              . 0 0 2
              . 0 0 2
              . 0 0 2
              . 0 1 2
              . 0 0 2
     -.58683795 1 1 0
       .6432691 0 1 0
              . 0 0 2
              . 0 0 2
              . 1 0 2
              . 0 0 2
      2.2182992 0 1 1
              . 0 0 2
      1.5630016 0 1 0
     -1.9779216 0 1 0
     -1.5065705 1 1 2
              . 0 0 2
       .3558644 0 1 1
     -.09251682 0 1 2
      2.2182992 0 1 0
     -1.0352192 0 1 0
              . 0 0 2
              . 0 0 2
              . 0 0 2
              . 1 0 2
              . 0 0 2
              . 0 0 2
     -1.0352192 0 1 2
              . 1 0 2
     -1.6100286 0 1 0
      -.7707845 0 1 1
              . . 1 .
              . 1 0 2
              . 1 0 2
       1.746948 1 1 0
              . 0 0 2
              . 0 0 2
              . 0 0 2
       .7237574 1 1 0
     -1.5065705 1 1 1
      2.2182992 0 1 1
      .25240618 1 1 0
              . 0 1 2
              . 0 0 2
              . 0 0 2
     -.20746003 1 1 0
       -.575353 1 1 0
              . 0 1 2
              . 0 0 2
    end


  • #2
    It's a bug. The authors have a line

    Code:
    qui sum Z if `touse' [`weight'`exp']
    which fails as you noticed. They probably intended

    Code:
    qui sum `Z' if `touse' [`weight'`exp']

    While you're fixing that it would be better as

    Code:
    sum Z if `touse' [`weight'`exp'], meanonly
    There may be other bugs.

    Comment


    • #3
      That last line in #2 should be

      Code:
       
       sum `Z' if `touse' [`weight'`exp'], meanonly

      Comment


      • #4
        Hello,

        I have the same problem. Arto Arman did you figure it out?

        Thanks!

        Comment


        • #5
          Antonio Ponce Why refer to the OP when you have suggestions about fixes?

          Comment


          • #6
            Hello!

            I finally figured out how to make the command work. The solution was to rename my variables with the same notations that the authors use. Therefore, what will work for you is:

            rename laoindex Y
            rename treatment Z
            rename nonmissing R
            rename reminder N

            Good luck!
            Last edited by Antonio Ponce; 04 May 2023, 11:54.

            Comment


            • #7
              Antonio Ponce Nick Cox Thank you guys so much! It's working now!

              Comment


              • #8
                Hello,
                I am trying to work with this command. Nevertheless, it is not working even when I am renaming my variables. Here is my code :

                rename bribe Y
                rename treatment Z
                rename nonmissing R
                rename tentative N

                callagain Y Z R N, ytype("bin")


                I obtain this error : invalid syntax

                Did you modify anything in the ado file ?


                Thanks @Antonio Ponce @Nick Cox Arto Arman for your previous messages.

                Comment

                Working...
                X