Announcement

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

  • khb

    Hello,
    Im using stata 14. Is the khb command not executable in this version? Im getting the following message after running the command.

    What can I do to get this decompostion of direct and indirect effec?

    khb regress outcome treated|| mediator_var
    this is version 14.0 of Stata; it cannot run version 17.0 programs
    You can purchase the latest version of Stata by visiting
    http://www.stata.com.
    r(9);

  • #2
    The latest version of khb from SSC indeed declares version 17. You can either use an old version of khb from SJ or try changing the version statements in khb.ado (you also want to change the version in lkhb.mata and recompile the mata library). Why do you want khb for a linear model in the first place?

    Comment


    • #3
      Personally, I think that the loss of downward compatibility for KHB in the latest update to Stata 17 is a big problem. I attached the version I use with Stata 16.1, maybe this works for you.

      Attached Files
      Best wishes

      Stata 18.0 MP | ORCID | Google Scholar

      Comment


      • #4
        #3 lacks the respective Mata library ...

        I agree that it is unfortunate that khb will now break old do-files unless older ado (and Mata) files have been copied to the respective projects. Perhaps Uli Kohler could at least post an older version to the SSC; call it khb11.

        Comment


        • #5
          A more optimistic point is that the update on SSC doesn't override the fact that earlier versions of khb remain accessible from the Stata Journal as

          Code:
          search khb
          will show.

          Comment


          • #6
            It can be annoying when an old version of a program is downloaded from SJ when a more current version is available from SSC. People have contacted me about bugs in an SJ version of my programs that I fixed several years ago!

            However, I hadn’t thought about the fact that SJ can serve as an archive for older versions of programs. That might be handy on some occasions. It might be nice if SSC kept old versions around too, but that might add a great deal of maintenance costs.

            When multiple versions of a program are around I usually go with the SSC version. But, that isn’t always the best choice.
            -------------------------------------------
            Richard Williams, Notre Dame Dept of Sociology
            StataNow Version: 19.5 MP (2 processor)

            EMAIL: [email protected]
            WWW: https://academicweb.nd.edu/~rwilliam/

            Comment


            • #7
              SSC is not really set up to house previous versions as such. They can always be housed if given a different command (more specifically, package) name. This is a side-effect of SSC being a subset of RePEc, which isn't primarily a software repository at all.

              Conversely, the archive function of the Stata Journal can be traced back to the Stata Technical Bulletin in 1991. Although originally code was distributed via floppy disks and snail mail, long since code going back to STB-1 can be downloaded directly in the now usual way.

              There are various small issues to do with packages available through both SSC and the Stata Journal, but where and how packages are maintained boils down primarily to author choice and convenience. But just in case anyone is in doubt: There is no formal link, and plenty of code is posted in just one place of those two.

              Someone is going to mention GitHub if I don't. I don't use GitHub but that's only because what I want is supported fine by the places where I post my code. Other way, GitHub is not only invaluable but even just about essential for the way that many people wish their code to be distributed and maintained, and it's my understanding that support for holding multiple versions is a strong feature of GitHub.

              Comment


              • #8
                Ok, I am considering myself guilty of not offering backward compatibility of -khb- to older versions of Stata. So I am now offering a solution that should also work in the future. Basically, I created a GitLab (not: GitHub) repository that gives you access to older versions. You will have to compile the Mata library yourself, but that is just one -do- command away. There is a readme file on the repository that explains the details. In creating the repository, I also invite others to contribute to -khb-. For the sake of completeness, here are the steps to install older versions of -khb-:
                1. Point your browser to https://gitup.uni-potsdam.de/ukohler/khb
                2. In the menu on the left hand side move your mouse over "Repository" and then click on "Commits".
                3. In the list there, click on the "Browse Files" symbol for the Stata version you have.
                4. Download all the files (they will be downloaded in a compressed archive).
                5. Unpack the downloaded files.
                6. Open Stata and type
                  . adopath
                7. Move all the files into your personal ado directory.
                8. Assuming that your personal ado directory is c:/ado/personal issue the following Stata commands:
                  . cd c:/ado/personal
                  . do lkhb.mata
                  . exit
                This should be all. khb should work if you start Stata the next time. Note however that I will not fix bugs in older versions of khb.
                Last edited by Ulrich Kohler; 21 Jun 2023, 06:54.

                Comment


                • #9
                  Thank you so much for your help

                  Comment

                  Working...
                  X