Announcement

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

  • Confall issue with STATA 16

    Hello,

    I have a question for you. I am using STATA 16. I would like to know if someone have issue with Confall. It is not running in STATA 16.


    Many thanks for considering my request.

    Juan




  • #2
    confall is community-contributed from the Stata Journal.

    "not running" in Stata 16 could mean

    1. It's not been installed. Use your operating system to search for files on your computer.

    2. It has been installed, but Stata can't see it. Same as #1, but check

    Code:
    adopath
    3. Something else: you need to tell us what "not running" means.

    Comment


    • #3
      I did find a problem with confall, though of course I cannot be sure it is the same problem as the one OP is facing.

      I downloaded the ancillary file diabdata.dta available with the package, and then tried running the commands in the "examples" section of the command help. I get this:

      Code:
      . use diabdata, clear
      . logistic diabetes BMI Age Sex IGT ACR CRP Cholesterol DiastolicBP GGT Smoking Drinking
      [output omitted]
      
      . confall, lockterm(Age Sex) eform(OR)
      Please wait........{ required
      r(100);
      The error does not appear to be specific to Stata 16; I get the same thing on Stata 18.5/MP as well.

      I ran a trace on the command, and the problem appears to happen on line 327 of the confall.ado file, which calls scatter. The error itself appears to be generated by scatter.ado:
      Code:
      - scatter `b' `showvar1' `baicm' `bbicm' `b0' `bfull' `xforgr', `saving' `options' `ytitle' `prxlab'
      = scatter __000001    __000005 __00000A __00000B,   ytitle("OR")
        --------------------------------------------------------------------------------------------------------------------- begin scatter ---
        - if (_caller() < 8.2) version 8
      { required
        ----------------------------------------------------------------------------------------------------------------------- end scatter ---
      I find this confusing, because if (_caller() < 8.2) version 8 is legal code, as far as I know. Perhaps someone else can chime in?

      Incidentally, both my Stata installations use scatter.ado version 1.2.0 dated 16apr2007.
      Last edited by Hemanshu Kumar; 15 May 2025, 00:01.

      Comment


      • #4
        Hello Nick and Hemanshu,
        Apologies for not being so clear. The problem that Hemanshu exposed is the same problem that I face, too. The stata does not run the command and the " (required" shows too. It also happens with other datasets that I used. I send an email to the original author Zhiqiang Wang- [email protected]) but it seems that he move on.

        I would appreciate if anyone has an idea of how to solve this. Confall is quite good, but it is an old program, and I don't know who may fix it.

        Many thanks.

        Juan


        Comment


        • #5
          Can you show us the exact command you are trying to execute? Even better, please also include an extract of your data using the dataex command so that we can replicate your situation.

          Comment


          • #6
            Okay, I may have a workaround; for this you will need to make a small edit to the confall.ado file. You can find the location of this file on your machine by typing
            Code:
            which confall
            Once you have the file path, type
            Code:
            doedit "the/filepath/to/confall.ado"
            This will open up the file to edit in the Do-file editor. You will see that line 6 of the file has a version command. Comment it out:
            Code:
            * version 7.0
            Now save the file. To make sure your next call to confall uses the new version of the file, simply enter
            Code:
            capture program drop confall
            in the Command window, so that the current version is dropped from memory. Now you should be able to run the command fine.

            Further note: the code in the examples.do file included in the ancillary files of the project still doesn't run without errors, because those examples pass a variable to the command, whereas the program syntax does not permit this. However, the three examples of the command in its help page work with the above change.
            Last edited by Hemanshu Kumar; 18 Jun 2025, 14:28.

            Comment


            • #7
              To expand on why this is happening, the version of -scatter- included with the last several Stata releases can only be called from version 8 and later, because it includes the line
              Code:
              if (_caller() < 8.2) version 8
              In Stata version 7, if required braces:

              . version 7 : if 1 {assert 1}

              . version 7 : if 1 assert 1
              { required
              r(100);

              In Stata version 8, if no longer required braces:

              . version 8 : if 1 assert 1

              This is explained in the version 8 release notes:

              . help whatsnew7to8

              In the case of if, you may omit the braces altogether:

              if (exp) ...
              So because -confall- runs as version 7 and calls -scatter-, it will break on every Stata version since version 9 (or thereabouts).

              Comment


              • #8
                Thank you Hemanshu Kumar, Nils Enevoldsen. Follow your guide, just make a small modification in confall.ado.
                Locate your confall.ado, open it, find the following code:
                Code:
                scatter  `b' `showvar1' `baicm' `bbicm' `b0' `bfull' `xforgr', `saving' `options' `ytitle' `prxlab'
                and replace it with:
                Code:
                version 8: twoway scatter  `b' `showvar1' `baicm' `bbicm' `b0' `bfull' `xforgr', `saving' `options' `ytitle' `prxlab'
                Code:
                webuse lbw
                logit low age lwt race smoke ptl ht ui
                confall, eform(OR)
                Click image for larger version

Name:	Graph.png
Views:	1
Size:	147.6 KB
ID:	1778987

                Comment

                Working...
                X