Announcement

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

  • tobit has disappeared

    Out of nowhere I can't use the `tobit` command. For example:

    Code:
    sysuse auto, clear
    tobit price mpg
    Throws the error

    Code:
    unknown function _caer()
    r(133);
    r(133) says "You specified a function that is unknown to Stata". That is strange because it looks like all the .ado and such files are there in Stata/ado/base:
    Click image for larger version

Name:	Screen Shot 2017-07-06 at 11.21.10 PM.png
Views:	1
Size:	19.5 KB
ID:	1400752



    Other commands (e.g. `reg price mpg` or `logit foreign mpg`) work fine.

    What gives?


  • #2
    What version of Stata are you using? When have you last updated (i.e. type update in the command window)? What do you get when you type viewsource tobit.ado?

    At some point the ado file refers to _caller(), it looks as if the mid ll's dropped out for you. A find-replace might fix this...

    PS: You can use intreg instead of tobit, it is much more powerful.

    Comment


    • #3
      Using Stata 13.1. `viewsource tobit.ado` shows me to the .ado file I see in my directory.

      What do you mean by "the mid ll's dropped out for you" and "a find-replace might fix this"?

      Comment


      • #4
        Can I also point out the strange error message? (`unknown function _caer()`) It does not appear anywhere in the .ado file, nor in any posts on Statalist.

        When I run `which tobit, all` I see two versions:

        Code:
        . cd ..
        /Applications/Stata/ado/base
        
        . which tobit, all
        
        /Applications/Stata/ado/base/t/tobit.ado
        *! version 1.3.6  03feb2011
        
        ./t/tobit.ado
        *! version 1.3.6  03feb2011
        Here is my adopath

        Code:
        . adopath
          [1]  (BASE)      "/Applications/Stata/ado/base/"
          [2]  (SITE)      "/Applications/Stata/ado/site/"
          [3]              "."
          [4]  (PERSONAL)  "~/Library/Application Support/Stata/ado/personal/"
          [5]  (PLUS)      "~/Library/Application Support/Stata/ado/plus/"
          [6]  (OLDPLACE)  "~/ado/"
        What on Earth is going on? Everything was working fine one day ago. I did not touch the .ado file and I cannot find any information on this cryptic error message.

        I wonder if the problem is with that that hidden file "./t/tobit.ado", but I have no idea how it got there, and I am unsure if I should delete it.

        UPDATE

        I think I am incorrect about the "hidden" file. There are two .ado files for each command. For example:

        Code:
        . findfile tobit.ado, all
        /Applications/Stata/ado/base/t/tobit.ado
        ./t/tobit.ado
        
        . findfile logit.ado, all
        /Applications/Stata/ado/base/l/logit.ado
        ./l/logit.ado
        Last edited by Jack Serck; 07 Jul 2017, 05:54.

        Comment


        • #5
          Can you copy the first lines of the ado file? In my case they start with

          Code:
          *! version 1.4.0  29aug2014
          program define tobit, eclass byable(onecall) prop(swml svyb svyj svyr)
                  version 9, missing
                  local version : di "version " string(_caller()) ", missing :"
          Emphasis mine. Note that it refers to the function _caller(), which is remarkably similar to the _caer() function refered to by the error message. Can you verify that your file also refers to _caller instead of _caer? If you see _caer instead, a simple find replace of _caer into _caller in the .ado file should fix the issue. That said, I have no idea how the .ado file could have gotten edited. What is the date modified?

          Comment


          • #6
            Thanks. Here is the intro to the .ado file:

            Code:
            *! version 1.3.6  03feb2011
            program define tobit, eclass byable(onecall) prop(swml svyb svyj svyr)
                    version 9, missing
                    local version : di "version " string(_caller()) ", missing :"
            Looks identical to yours, except it is an older version. I looked at this file the other day, but I did not enter it, let alone edit it. "_caer()" appears nowhere.



            Comment


            • #7
              Mysterious. Is it possible to update Stata? Your version of tobit is outdated. I.e. type "update query" and install all available updates. I don't know how it interacts with Stata versions (which do you have?).

              Comment


              • #8
                No, can't update Stata any more (university copy). Anyways, that does not explain why it worked one day and not the other. This is a bit bogus.

                Comment


                • #9
                  At this point all you can do is contact your administrator and/or the Stata helpdesk I'm afraid... Since that might take a while, here's a tutorial on how to use the built-in intreg command to do everything tobit does: http://www.stata.com/support/faqs/st...ors-for-tobit/

                  What's even better is that intreg will allow you to use robust and/or clustered standard errors, which tobit won't.

                  Comment


                  • #10
                    You might reboot and try tobit again first - it sometimes fixed mysterious problems.

                    Comment


                    • #11
                      What? The help file for tobit clearly states that one can specify robust or clustered standard errors. The link you sent was for Stata 9.
                      Click image for larger version

Name:	Screen Shot 2017-07-07 at 3.15.43 PM.png
Views:	1
Size:	50.0 KB
ID:	1400866

                      Last edited by Jack Serck; 07 Jul 2017, 13:21.

                      Comment


                      • #12
                        Looks like I'm behind the times

                        Comment

                        Working...
                        X