Announcement

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

  • #16
    I gather you may just type "help" - such as "help firthlogit" - to get examples with the installed datasets.

    Usually, you won't need to bother about the directory where Stata keeps the ancillary files (by the way, I guess it is the PLUS).

    You may wish to type - sysdir - and see a list with all the directories. My advice is: if you are not experienced with this kind of procedure, please let Stata "decide" everytime you install a package.

    To end, here (http://www.stata.com/support/finding-resources/) you find general information on how to deal with user-written programs in Stata.

    Hopefully that helps.

    Best,

    Marcos
    Best regards,

    Marcos

    Comment


    • #17
      Originally posted by Joseph Coveney View Post

      If you're using firthlogit because of separation or quasiseparation, then as described in the help file you shouldn't be using Wald tests. Use the likelihood-ratio test as shown in the command's help file and ancillary files.
      Actually predictor 11 had o count for an outcome (?quasi separation).

      I tried using likelihood ratio.
      But I get this message: (note: constraint number 1 caused error r(198))

      I have attached pdf of my data analysis
      Attached Files

      Comment


      • #18

        Code:
        * Example generated by -dataex-. To install: ssc install dataex
        clear
        input str16 response str13(pred1 pred2) str11 pred3 str8 pred4 str9 pred5 str8 pred6 str9(pred7 pred8) str17 pred9 str12 pred10 str7 pred11
        "2" "0" "1" "0" "0" "1" "0" "0" "1" "0" "0" "1"
        "2" "0" "0" "1" "0" "1" "0" "0" "0" "0" "0" "1"
        "2" "1" "0" "0" "0" "1" "1" "0" "0" "0" "0" "0"
        "2" "1" "1" "0" "0" "1" "0" "1" "1" "1" "0" "1"
        "2" "0" "1" "0" "0" "1" "0" "0" "0" "0" "0" "0"
        "2" "1" "1" "0" "0" "1" "0" "0" "1" "1" "0" "0"
        "2" "0" "0" "0" "0" "1" "0" "0" "0" "0" "0" "1"
        "2" "0" "1" "0" "0" "1" "0" "0" "0" "0" "0" "0"
        "2" "0" "0" "1" "0" "1" "1" "0" "1" "0" "0" "0"
        "2" "0" "1" "1" "0" "1" "0" "0" "1" "0" "0" "1"
        "2" "1" "1" "0" "0" "1" "1" "0" "0" "0" "0" "0"
        "2" "0" "1" "1" "0" "1" "0" "0" "1" "0" "0" "0"
        "2" "0" "1" "1" "0" "1" "0" "0" "0" "0" "0" "1"
        "2" "0" "1" "1" "0" "1" "0" "0" "1" "0" "1" "1"
        "2" "0" "0" "1" "0" "1" "0" "0" "1" "1" "0" "1"
        "2" "0" "0" "1" "0" "0" "0" "0" "1" "0" "0" "1"
        "2" "0" "1" "1" "0" "1" "0" "0" "1" "0" "0" "1"
        "2" "1" "1" "0" "0" "1" "0" "0" "0" "0" "0" "0"
        "2" "0" "0" "1" "0" "1" "0" "0" "1" "0" "0" "0"
        "2" "0" "1" "1" "0" "1" "1" "0" "1" "1" "0" "0"
        "2" "0" "1" "1" "0" "0" "1" "0" "0" "0" "0" "0"
        "2" "0" "0" "1" "0" "0" "0" "0" "1" "0" "0" "0"
        "2" "0" "0" "1" "0" "1" "0" "0" "0" "0" "0" "1"
        "2" "0" "1" "1" "0" "1" "1" "0" "1" "0" "0" "0"
        "2" "0" "1" "1" "0" "1" "1" "0" "1" "1" "0" "0"
        "2" "0" "1" "1" "0" "1" "0" "0" "0" "0" "0" "1"
        "2" "0" "1" "1" "0" "1" "1" "0" "0" "0" "0" "0"
        "2" "0" "1" "0" "0" "0" "1" "0" "0" "1" "0" "0"
        "2" "0" "1" "1" "0" "1" "1" "0" "0" "1" "0" "0"
        "2" "0" "1" "1" "0" "1" "0" "0" "0" "0" "0" "1"
        "2" "0" "0" "0" "0" "1" "0" "0" "0" "0" "0" "0"
        "2" "0" "1" "1" "0" "1" "0" "0" "1" "1" "0" "1"
        "2" "1" "1" "0" "1" "1" "1" "0" "1" "1" "0" "0"
        "2" "1" "0" "0" "1" "1" "0" "0" "1" "0" "0" "0"
        "2" "1" "1" "1" "1" "1" "0" "0" "0" "0" "0" "1"
        "2" "0" "1" "0" "1" "1" "0" "0" "1" "0" "0" "1"
        "2" "0" "0" "1" "1" "1" "1" "0" "0" "0" "0" "0"
        "2" "0" "1" "1" "1" "0" "0" "0" "1" "0" "0" "1"
        "2" "0" "1" "1" "1" "0" "0" "0" "1" "0" "0" "0"
        "2" "0" "0" "0" "1" "1" "0" "1" "0" "0" "0" "0"
        "2" "0" "1" "1" "0" "1" "0" "0" "0" "0" "0" "1"
        "2" "0" "1" "1" "0" "1" "0" "0" "1" "1" "1" "1"
        "2" "0" "1" "1" "0" "1" "1" "0" "1" "0" "1" "0"
        "2" "0" "1" "1" "0" "1" "1" "0" "0" "0" "1" "0"
        "1" "0" "1" "1" "0" "1" "0" "0" "1" "0" "1" "1"
        "2" "0" "1" "1" "0" "0" "0" "0" "1" "1" "1" "1"
        "1" "0" "1" "1" "0" "0" "0" "0" "0" "1" "1" "1"
        "2" "0" "1" "1" "0" "1" "0" "0" "0" "0" "1" "0"
        "2" "0" "1" "1" "0" "1" "0" "0" "0" "1" "1" "1"
        "2" "0" "0" "0" "0" "1" "1" "0" "0" "0" "1" "0"
        "2" "0" "1" "0" "0" "1" "1" "0" "1" "0" "1" "0"
        "2" "0" "1" "0" "0" "1" "0" "0" "0" "0" "1" "1"
        "2" "0" "1" "1" "0" "1" "0" "0" "0" "1" "1" "1"
        "2" "0" "0" "1" "0" "1" "0" "0" "0" "0" "1" "1"
        "2" "0" "1" "1" "0" "1" "0" "0" "1" "0" "1" "1"
        "2" "0" "1" "1" "0" "1" "1" "0" "1" "0" "1" "1"
        "2" "0" "1" "1" "0" "0" "0" "0" "0" "0" "1" ""
        "1" "0" "1" "1" "0" "1" "0" "0" "0" "0" "1" "1"
        "2" "0" "0" "1" "0" "1" "0" "0" "0" "0" "1" "1"
        "2" "0" "0" "1" "0" "1" "1" "1" "1" "0" "1" "0"
        "2" "0" "1" "1" "0" "1" "0" "0" "1" "0" "1" "1"
        "2" "0" "1" "1" "0" "1" "1" "0" "0" "1" "1" "0"
        "2" "0" "0" "1" "0" "1" "1" "1" "1" "1" "0" "0"
        "2" "0" "1" "0" "0" "1" "0" "0" "1" "0" "1" "1"
        "1" "0" "0" "1" "1" "1" "0" "0" "0" "0" "1" "1"
        "2" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1"
        "2" "0" "1" "1" "1" "0" "0" "0" "1" "0" "1" "1"
        "2" "0" "1" "1" "1" "1" "0" "0" "0" "0" "1" "1"
        "2" "0" "1" "0" "1" "1" "0" "0" "1" "0" "1" "0"
        "2" "0" "0" "1" "1" "1" "1" "0" "1" "0" "1" "0"
        "2" "0" "0" "1" "1" "1" "1" "0" "1" "0" "1" "0"
        "1" "0" "1" "1" "0" "1" "0" "0" "0" "0" "1" "1"
        "2" "0" "0" "0" "0" "1" "0" "1" "1" "0" "0" "1"
        "2" "0" "1" "0" "0" "1" "0" "0" "0" "0" "0" "1"
        "2" "0" "1" "0" "0" "0" "0" "0" "1" "0" "0" "1"
        "2" "0" "1" "0" "0" "1" "0" "0" "0" "0" "0" "1"
        "2" "0" "0" "0" "0" "1" "1" "0" "0" "0" "0" "0"
        "2" "0" "0" "0" "0" "1" "1" "0" "0" "0" "0" "0"
        "2" "0" "1" "0" "0" "1" "0" "0" "0" "0" "0" "1"
        "2" "0" "1" "0" "0" "1" "1" "0" "1" "0" "0" "0"
        "2" "0" "0" "0" "1" "1" "0" "1" "1" "0" "0" "1"
        "2" "0" "0" "0" "1" "1" "0" "1" "1" "0" "0" "1"
        "2" "0" "1" "0" "1" "1" "1" "0" "0" "0" "0" "0"
        "2" "0" "0" "0" "1" "1" "0" "1" "1" "0" "0" "1"
        "2" "0" "0" "0" "1" "1" "0" "1" "1" "0" "0" "1"
        "2" "0" "1" "0" "1" "1" "0" "0" "1" "0" "0" "1"
        "2" "0" "1" "0" "1" "0" "1" "0" "0" "0" "0" "0"
        "2" "0" "1" "0" "0" "1" "0" "1" "1" "0" "1" "1"
        "2" "0" "1" "0" "0" "1" "0" "0" "1" "0" "1" "0"
        "2" "0" "1" "0" "0" "1" "0" "0" "1" "0" "1" "1"
        "2" "0" "0" "0" "0" "1" "1" "0" "0" "0" "1" "0"
        "2" "0" "1" "0" "0" "0" "0" "1" "0" "0" "1" "0"
        "1" "0" "1" "0" "0" "1" "0" "0" "1" "0" "1" "1"
        "2" "0" "1" "0" "0" "1" "0" "1" "1" "0" "1" "1"
        "2" "0" "0" "0" "0" "1" "0" "0" "0" "0" "0" "0"
        "1" "1" "1" "0" "0" "1" "0" "1" "1" "1" "0" "1"
        "2" "0" "0" "1" "0" "1" "0" "1" "1" "0" "0" "0"
        "2" "1" "1" "0" "0" "1" "0" "1" "0" "0" "0" "0"
        "2" "1" "0" "0" "0" "0" "0" "1" "0" "1" "0" "1"
        "2" "0" "1" "0" "0" "1" "1" "0" "0" "1" "0" "0"
        end

        Comment


        • #19
          Originally posted by Joseph Coveney View Post
          As Nick said, no one can really read your example well, but it seems as if every one of your variables takes on values of 1 or 2, including the response variable.
          Code:
          * Example generated by -dataex-. To install: ssc install dataex
          clear
          input byte(responsen PRED1 PRED2 PRED3 PRED4 PRED5 PRED6 PRED7 PRED8 PRED9 PRED10 PRED11)
          2 0 1 0 0 1 0 0 1 0 0 1
          2 0 0 1 0 1 0 0 0 0 0 1
          2 1 0 0 0 1 1 0 0 0 0 0
          2 1 1 0 0 1 0 1 1 1 0 1
          2 0 1 0 0 1 0 0 0 0 0 0
          2 1 1 0 0 1 0 0 1 1 0 0
          2 0 0 0 0 1 0 0 0 0 0 1
          2 0 1 0 0 1 0 0 0 0 0 0
          2 0 0 1 0 1 1 0 1 0 0 0
          2 0 1 1 0 1 0 0 1 0 0 1
          2 1 1 0 0 1 1 0 0 0 0 0
          2 0 1 1 0 1 0 0 1 0 0 0
          2 0 1 1 0 1 0 0 0 0 0 1
          2 0 1 1 0 1 0 0 1 0 1 1
          2 0 0 1 0 1 0 0 1 1 0 1
          2 0 0 1 0 0 0 0 1 0 0 1
          2 0 1 1 0 1 0 0 1 0 0 1
          2 1 1 0 0 1 0 0 0 0 0 0
          2 0 0 1 0 1 0 0 1 0 0 0
          2 0 1 1 0 1 1 0 1 1 0 0
          2 0 1 1 0 0 1 0 0 0 0 0
          2 0 0 1 0 0 0 0 1 0 0 0
          2 0 0 1 0 1 0 0 0 0 0 1
          2 0 1 1 0 1 1 0 1 0 0 0
          2 0 1 1 0 1 1 0 1 1 0 0
          2 0 1 1 0 1 0 0 0 0 0 1
          2 0 1 1 0 1 1 0 0 0 0 0
          2 0 1 0 0 0 1 0 0 1 0 0
          2 0 1 1 0 1 1 0 0 1 0 0
          2 0 1 1 0 1 0 0 0 0 0 1
          2 0 0 0 0 1 0 0 0 0 0 0
          2 0 1 1 0 1 0 0 1 1 0 1
          2 1 1 0 1 1 1 0 1 1 0 0
          2 1 0 0 1 1 0 0 1 0 0 0
          2 1 1 1 1 1 0 0 0 0 0 1
          2 0 1 0 1 1 0 0 1 0 0 1
          2 0 0 1 1 1 1 0 0 0 0 0
          2 0 1 1 1 0 0 0 1 0 0 1
          2 0 1 1 1 0 0 0 1 0 0 0
          2 0 0 0 1 1 0 1 0 0 0 0
          2 0 1 1 0 1 0 0 0 0 0 1
          2 0 1 1 0 1 0 0 1 1 1 1
          2 0 1 1 0 1 1 0 1 0 1 0
          2 0 1 1 0 1 1 0 0 0 1 0
          1 0 1 1 0 1 0 0 1 0 1 1
          2 0 1 1 0 0 0 0 1 1 1 1
          1 0 1 1 0 0 0 0 0 1 1 1
          2 0 1 1 0 1 0 0 0 0 1 0
          2 0 1 1 0 1 0 0 0 1 1 1
          2 0 0 0 0 1 1 0 0 0 1 0
          2 0 1 0 0 1 1 0 1 0 1 0
          2 0 1 0 0 1 0 0 0 0 1 1
          2 0 1 1 0 1 0 0 0 1 1 1
          2 0 0 1 0 1 0 0 0 0 1 1
          2 0 1 1 0 1 0 0 1 0 1 1
          2 0 1 1 0 1 1 0 1 0 1 1
          2 0 1 1 0 0 0 0 0 0 1 .
          1 0 1 1 0 1 0 0 0 0 1 1
          2 0 0 1 0 1 0 0 0 0 1 1
          2 0 0 1 0 1 1 1 1 0 1 0
          2 0 1 1 0 1 0 0 1 0 1 1
          2 0 1 1 0 1 1 0 0 1 1 0
          2 0 0 1 0 1 1 1 1 1 0 0
          2 0 1 0 0 1 0 0 1 0 1 1
          1 0 0 1 1 1 0 0 0 0 1 1
          2 0 1 1 1 1 0 0 0 0 1 1
          2 0 1 1 1 0 0 0 1 0 1 1
          2 0 1 1 1 1 0 0 0 0 1 1
          2 0 1 0 1 1 0 0 1 0 1 0
          2 0 0 1 1 1 1 0 1 0 1 0
          2 0 0 1 1 1 1 0 1 0 1 0
          1 0 1 1 0 1 0 0 0 0 1 1
          2 0 0 0 0 1 0 1 1 0 0 1
          2 0 1 0 0 1 0 0 0 0 0 1
          2 0 1 0 0 0 0 0 1 0 0 1
          2 0 1 0 0 1 0 0 0 0 0 1
          2 0 0 0 0 1 1 0 0 0 0 0
          2 0 0 0 0 1 1 0 0 0 0 0
          2 0 1 0 0 1 0 0 0 0 0 1
          2 0 1 0 0 1 1 0 1 0 0 0
          2 0 0 0 1 1 0 1 1 0 0 1
          2 0 0 0 1 1 0 1 1 0 0 1
          2 0 1 0 1 1 1 0 0 0 0 0
          2 0 0 0 1 1 0 1 1 0 0 1
          2 0 0 0 1 1 0 1 1 0 0 1
          2 0 1 0 1 1 0 0 1 0 0 1
          2 0 1 0 1 0 1 0 0 0 0 0
          2 0 1 0 0 1 0 1 1 0 1 1
          2 0 1 0 0 1 0 0 1 0 1 0
          2 0 1 0 0 1 0 0 1 0 1 1
          2 0 0 0 0 1 1 0 0 0 1 0
          2 0 1 0 0 0 0 1 0 0 1 0
          1 0 1 0 0 1 0 0 1 0 1 1
          2 0 1 0 0 1 0 1 1 0 1 1
          2 0 0 0 0 1 0 0 0 0 0 0
          1 1 1 0 0 1 0 1 1 1 0 1
          2 0 0 1 0 1 0 1 1 0 0 0
          2 1 1 0 0 1 0 1 0 0 0 0
          2 1 0 0 0 0 0 1 0 1 0 1
          2 0 1 0 0 1 1 0 0 1 0 0
          end

          Comment


          • #20
            Finally I think I got the correct dataset example with quasi separartion (pred11). How do I do firth penalised likelihood ratio?

            Code:
            * Example generated by -dataex-. To install: ssc install dataex
            clear
            input byte(responsen PRED1 PRED2 PRED3 PRED4 PRED5 PRED6 PRED7 PRED8 PRED9 PRED10 PRED11)
            1 1 1 0 0 0 0 1 1 0 0 1
            1 0 0 1 0 1 0 0 1 1 1 1
            1 0 1 1 0 1 0 0 0 0 1 1
            1 0 1 0 1 1 1 1 1 0 0 1
            1 0 1 0 0 1 0 0 1 0 1 1
            1 0 1 1 0 1 0 0 1 0 1 1
            1 0 1 1 0 1 1 0 1 0 1 1
            1 0 0 1 0 1 0 0 0 0 0 1
            1 0 1 1 0 1 0 0 0 0 1 1
            1 1 1 0 0 1 0 1 1 0 0 1
            1 0 0 1 0 1 0 1 0 0 1 1
            1 0 1 1 0 0 0 0 0 1 1 1
            1 0 1 1 0 1 0 1 0 0 0 1
            1 1 0 1 0 0 1 0 0 0 0 1
            1 1 1 0 0 1 0 1 1 1 0 1
            1 0 1 1 0 1 0 0 1 1 1 1
            1 1 0 1 0 1 0 1 1 0 0 1
            1 0 0 1 1 1 0 0 0 0 1 1
            0 0 1 1 1 1 0 1 1 0 1 1
            0 0 1 1 1 1 0 1 1 0 1 1
            0 1 1 0 0 1 0 0 0 0 0 0
            0 0 1 0 0 1 0 0 1 0 1 1
            0 0 1 1 0 1 1 0 1 0 1 1
            0 0 1 1 1 1 1 1 1 0 1 0
            0 0 1 0 1 0 1 0 0 0 0 0
            0 0 0 1 1 1 0 1 1 0 1 1
            0 0 0 1 0 0 0 1 1 0 0 1
            0 0 1 0 0 1 0 0 0 0 0 1
            0 0 0 1 0 1 0 0 0 0 0 1
            0 0 1 1 0 1 0 1 0 0 1 1
            0 0 1 0 0 1 0 0 1 1 1 0
            0 0 1 1 0 1 1 0 0 0 1 0
            0 0 1 0 0 0 0 0 0 0 0 1
            0 0 1 0 1 1 1 1 1 1 1 0
            0 0 0 1 1 1 1 1 1 0 1 0
            0 0 0 0 0 1 0 1 1 1 1 1
            0 0 1 1 1 1 0 0 0 0 1 .
            0 0 1 1 0 1 1 1 1 0 1 0
            0 0 1 0 0 1 0 0 0 1 1 0
            0 0 1 0 1 1 0 0 0 1 1 1
            0 0 1 1 0 1 1 1 1 0 1 1
            0 0 0 1 0 1 0 1 1 0 1 1
            0 0 1 0 0 0 0 1 1 0 1 1
            0 0 1 0 0 1 1 1 1 0 0 0
            0 0 1 0 0 1 0 0 0 0 1 1
            0 0 1 0 0 1 0 0 0 0 1 1
            0 0 1 1 1 1 1 0 0 0 0 1
            0 0 0 0 1 1 1 1 1 1 0 0
            0 0 1 1 0 0 0 1 0 0 0 1
            0 0 1 0 0 1 1 1 1 0 1 0
            0 0 1 0 0 1 0 0 0 0 1 .
            0 0 1 0 0 1 0 0 1 1 1 1
            0 0 1 0 0 1 0 0 1 0 1 1
            0 0 1 0 0 1 0 0 0 1 1 0
            0 0 1 0 1 1 0 1 1 0 1 1
            0 0 1 0 0 1 0 0 1 0 1 0
            0 0 1 0 0 1 0 0 1 0 1 1
            0 0 0 0 0 1 1 1 1 0 0 0
            0 0 0 1 1 1 1 1 1 0 0 1
            0 0 1 1 0 1 1 0 0 1 1 0
            0 0 0 1 1 0 0 1 1 0 0 1
            0 0 1 0 0 1 0 1 1 0 1 1
            0 0 1 1 0 0 1 0 0 0 0 0
            0 0 1 0 0 1 0 1 0 0 1 1
            0 0 1 1 0 1 1 0 0 1 0 0
            0 0 1 1 1 1 1 0 1 0 0 0
            0 0 1 0 0 1 0 0 0 1 1 0
            0 1 0 0 1 1 1 1 0 0 0 .
            0 0 1 1 0 1 0 0 0 0 1 0
            0 0 1 0 0 1 0 0 0 0 1 1
            0 0 0 1 1 1 1 0 1 0 1 0
            0 0 1 0 0 1 0 1 1 0 1 1
            0 1 1 0 0 1 0 1 0 0 0 1
            0 1 1 0 1 1 1 0 1 1 0 0
            0 0 1 0 0 1 0 0 0 0 0 0
            0 0 0 1 0 1 0 1 0 0 0 0
            0 0 0 1 1 1 0 1 1 0 0 1
            0 0 0 0 0 1 0 0 0 0 1 1
            0 0 1 0 0 1 1 1 1 0 0 0
            0 1 0 0 0 1 1 1 1 0 0 0
            0 0 1 0 1 1 0 0 1 0 1 0
            0 0 0 0 0 1 1 0 0 0 1 0
            0 0 0 1 0 1 1 1 0 0 0 0
            0 0 1 0 0 1 0 1 1 0 1 1
            0 0 0 1 1 1 0 1 1 0 1 1
            0 1 1 0 0 1 0 1 0 0 0 1
            0 0 1 1 0 1 1 1 0 0 1 0
            0 0 1 0 1 0 1 1 0 0 1 0
            0 0 0 1 0 1 1 1 1 0 0 0
            0 0 1 0 1 1 0 1 1 0 1 1
            0 0 1 0 0 1 0 0 0 1 1 0
            0 0 1 1 0 0 0 0 1 0 0 1
            0 0 1 1 0 1 1 0 1 1 0 0
            0 0 1 0 0 1 1 0 0 0 1 1
            0 0 1 1 0 1 0 0 1 0 0 0
            0 0 0 0 1 1 0 0 1 0 1 0
            0 0 1 0 0 1 0 1 1 1 1 1
            0 0 0 0 0 1 0 0 0 0 0 1
            0 0 1 0 0 1 1 0 1 0 1 1
            0 0 0 1 0 1 0 1 1 1 0 0
            end

            Comment


            • #21
              Finally I managed to do firthlogit and likelihood ratio test. How do I interpret/report the likelihood test results? Pvalue was 0.0001. Does it mean that I should take p and CI of the unconstrained model? Or should I report everything? How do I state the findings of the test. My values are attached.

              Likelihood-ratio test LR chi2(1) = 14.44

              (Assumption: . nested in Full) Prob > chi2 = 0.0001
              Attached Files

              Comment


              • #22
                You can get the requested information about - lrtest - plus several examples in the Stata manual:http://www.stata.com/manuals13/rlrtest.pdf
                Best regards,

                Marcos

                Comment


                • #23
                  Originally posted by Joseph Coveney View Post

                  If you're using firthlogit because of separation or quasiseparation, then as described in the help file you shouldn't be using Wald tests. Use the likelihood-ratio test as shown in the command's help file and ancillary files.
                  Stated in the help file "Heinze and coworkers recommend using likelihood ratio tests and profile likelihood confidence intervals in lieu of Wald-based statistics"

                  How do you get profile likelihood confidence intervals by firthlogit?

                  Comment


                  • #24
                    Originally posted by john jose View Post
                    How do you get profile likelihood confidence intervals by firthlogit?
                    Code:
                    search profile likelihood
                    brings up a user-written program pllf. You might want to try that. It claims to work with a variety of estimation commands, and so it might work with firthlogit.

                    Otherwise, you can write a minimizer program and use official Stata minbound, which is what I do. See attached do-file and log file for an example.
                    Attached Files

                    Comment


                    • #25
                      Originally posted by Joseph Coveney View Post

                      Code:
                      search profile likelihood
                      brings up a user-written program pllf. You might want to try that. It claims to work with a variety of estimation commands, and so it might work with firthlogit.

                      Otherwise, you can write a minimizer program and use official Stata minbound, which is what I do. See attached do-file and log file for an example.
                      The minimizer program and minbound worked perfectly with logit but when using them with firthlogit, I received the following error message:

                      command chi2em not found
                      r(199);

                      Any additional suggestions for Profile Log Likelihood Confidence Intervals using firthlogit? I was not able to get pllf to work with firthlogit either.
                      Last edited by Jennifer Coulson; 25 Mar 2017, 19:02.

                      Comment


                      • #26
                        firthlogit doesn't set the ereturn macro e(cmdline) and so you need to manually enter it. Change the line
                        Code:
                        scalar define `cmdline' = e(cmdline)
                        to substitute whatever it was you typed when invoking firthlogit. You can see the attached do-file and log file for an example.
                        Attached Files

                        Comment


                        • #27
                          Originally posted by Joseph Coveney View Post
                          firthlogit doesn't set the ereturn macro e(cmdline) and so you need to manually enter it. Change the line
                          Code:
                          scalar define `cmdline' = e(cmdline)
                          to substitute whatever it was you typed when invoking firthlogit. You can see the attached do-file and log file for an example.
                          That worked perfectly. Thank you!

                          Comment


                          • #28
                            You might want to also check out Ben Jann's eret2 command, available from SSC. According to its help file,

                            eret2 is a hack to save a macro, scalar, or matrix in e() and may be used after any estimation command (see help estcom) to add additional results to the e()-returns. It is implemented as a wrapper for the ereturn command (see help ereturn). However, eret2 can be used in any context whereas ereturn can only be used within an e-class program (see help program).
                            So, rather than having to edit a do file everytime you made a change, you could probably write a do file that called firthlogit and that then used eret2 to ereturn whatever extra things you needed.
                            -------------------------------------------
                            Richard Williams, Notre Dame Dept of Sociology
                            Stata Version: 17.0 MP (2 processor)

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

                            Comment


                            • #29
                              Can't you do that in the wrapper, itself?
                              Code:
                              program define wrapper, eclass
                                  version 14.2
                              
                                  firthlogit `0'
                                  ereturn local cmdline `e(cmd)' `0'
                              end
                              .ÿversionÿ14.2

                              .ÿ
                              .ÿclearÿ*

                              .ÿsetÿmoreÿoff

                              .ÿ
                              .ÿsysuseÿauto
                              (1978ÿAutomobileÿData)

                              .ÿ
                              .ÿwrapperÿforeignÿc.turn,ÿnolog

                              ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿÿÿÿÿ=ÿÿÿÿÿÿÿÿÿ74
                              ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿWaldÿchi2(1)ÿÿÿÿÿÿ=ÿÿÿÿÿÿ17.73
                              Penalizedÿlogÿlikelihoodÿ=ÿ-23.120377ÿÿÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿÿÿÿÿÿÿ=ÿÿÿÿÿ0.0000

                              ------------------------------------------------------------------------------
                              ÿÿÿÿÿforeignÿ|ÿÿÿÿÿÿCoef.ÿÿÿStd.ÿErr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿConf.ÿInterval]
                              -------------+----------------------------------------------------------------
                              ÿÿÿÿÿÿÿÿturnÿ|ÿÿ-.4957903ÿÿÿ.1177524ÿÿÿÿ-4.21ÿÿÿ0.000ÿÿÿÿ-.7265809ÿÿÿ-.2649998
                              ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ18.05467ÿÿÿ4.368354ÿÿÿÿÿ4.13ÿÿÿ0.000ÿÿÿÿÿ9.492859ÿÿÿÿ26.61649
                              ------------------------------------------------------------------------------

                              .ÿ
                              .ÿdisplayÿinÿsmclÿasÿtextÿ"`e(cmdline)'"
                              firthlogitÿforeignÿc.turn,ÿnolog

                              .ÿ
                              .ÿ//ÿVerifyingÿthatÿtheÿrestÿdidn'tÿgetÿwipedÿout
                              .ÿmatrixÿlistÿe(b)

                              e(b)[1,2]
                              ÿÿÿÿÿÿÿÿÿÿÿÿxb:ÿÿÿÿÿÿÿÿÿxb:
                              ÿÿÿÿÿÿÿÿÿÿturnÿÿÿÿÿÿÿ_cons
                              y1ÿÿ-.49579034ÿÿÿ18.054675

                              .ÿ
                              .ÿexit

                              endÿofÿdo-file


                              .


                              If I get time, I'll update firthlogit to include the ereturn macro, include an example file for profile likelihood confidence bounds, and add what Richard has suggested privately.
                              Last edited by Joseph Coveney; 27 Mar 2017, 22:57.

                              Comment


                              • #30
                                Can't you do that in the wrapper, itself?
                                Yes, that sounds good. Indeed, if one were so inclined, you could write your own post-estimation commands (e.g. for estat, predict) and ereturn the values that are needed for those commands to be recognized. Or ereturn whatever other values might be needed for an existing post-estimation command. I've occasionally fixed buggy programs by adding the ereturns they were missing.
                                -------------------------------------------
                                Richard Williams, Notre Dame Dept of Sociology
                                Stata Version: 17.0 MP (2 processor)

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

                                Comment

                                Working...
                                X