Announcement

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

  • "option mlabformat() not allowed" error after boottest

    Hey there,

    I have a question on a user-written package boottest.

    when I run a regression with clustered error and then perform a boottest

    reg charlindex treat, cluster(StudyWard)
    boottest treat=0

    I get an error
    option mlabformat() not allowed
    which seems unusual considering that this a figure option

    Code:
    . reg charlindex treat, cluster(StudyWard)
    
    Linear regression                               Number of obs     =         36
    F(1, 16)          =       0.27
    Prob > F          =     0.6101
    R-squared         =     0.0102
    Root MSE          =     1.3216
    
    (Std. Err. adjusted for 17 clusters in StudyWard)
    
    Robust
    charlindex       Coef.   Std. Err.      t    P>t     [95% Conf. Interval]
    
    treat      -.2625   .5047524    -0.52   0.610    -1.332527    .8075274
    _cons       .8125   .4625186     1.76   0.098    -.1679956    1.792996
    
    
    . boottest treat=0
    
    Wild bootstrap-t, null imposed, 999 replications, Wald test, bootstrap clustering    by
    >  StudyWard, Rademacher weights:
    treat=0
    
    t(16) =    -0.5201
    Prob>t =     0.6146
    option mlabformat() not allowed
    r(198);

    The data
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input int StudyWard byte charlindex float treat
     19 0 1
    142 0 1
    114 0 0
    119 0 1
    157 0 0
    114 3 0
    119 0 1
    143 0 0
    216 0 1
    157 0 0
    143 0 0
    211 0 1
    142 0 1
    215 1 1
    217 0 0
     19 0 1
    142 2 1
    213 2 0
    120 0 0
    216 0 1
    119 0 1
    113 0 0
    112 0 1
    217 0 0
    143 0 0
     15 6 0
     11 0 1
    215 2 1
    114 2 0
    211 3 1
     16 0 0
    113 0 0
    112 1 1
    211 0 1
    119 0 1
    112 2 1
    end
    label values StudyWard labels2
    label def labels2 11 "1-7AS", modify
    label def labels2 15 "1-8AS", modify
    label def labels2 16 "1-8BN", modify
    label def labels2 19 "1-9AN", modify
    label def labels2 112 "2-TW", modify
    label def labels2 113 "2-W1A", modify
    label def labels2 114 "2-W1B", modify
    label def labels2 119 "2-W2B", modify
    label def labels2 120 "2-W2C", modify
    label def labels2 142 "3-L5W", modify
    label def labels2 143 "3-L6W", modify
    label def labels2 157 "4-2A", modify
    label def labels2 211 "5-X10N", modify
    label def labels2 213 "5-X7N", modify
    label def labels2 215 "5-X8N", modify
    label def labels2 216 "5-X8S", modify
    label def labels2 217 "5-X9N", modify
    Attached Files
    Kind regards,
    Sergey Alexeev | ​The University of Sydney
    https://alexeev.pw/

  • #2
    Oh gosh, all I needed was nograph option. I am terribly sorry for spamming the forum. I could not find an option to delete the original post.
    Kind regards,
    Sergey Alexeev | ​The University of Sydney
    https://alexeev.pw/

    Comment


    • #3
      Originally posted by Sergey Alexeev View Post
      Oh gosh, all I needed was nograph option. I am terribly sorry for spamming the forum. I could not find an option to delete the original post.
      Your posts aren't spam. Statalist isn't structured as a "help desk" but rather as a community forum where we learn from each other's experience. Your post and this discussion now are part of that searchable knowledge base. Your discussion of what worked for you is important and appreciated.

      With that said, the error message
      Code:
      option mlabformat() not allowed
      describes an option you did not specify. So I infer that somewhere in the depths of boottest.ado the code supplied an incorrect or inappropriate option to a graph command.

      The boottest package is a community contributed package authored by David Roodman and available through SSC (an older version remains available from the Stata Journal). After installing the version from SSC today I see
      Code:
      . which boottest
      /Users/lisowskiw/Library/Application Support/Stata/ado/plus/b/boottest.ado
      *! boottest 4.1.0 13 July 2022
      *! Copyright (C) 2015-22 David Roodman
      *! Version history at bottom
      When I run your code on your data with this version, the error does not occur.

      Perhaps you have an older version installed and the current version includes a fix for the problem. The version history at the bottom of boottest.ado is extensive: TL;DR so I can't tell you if that is indeed the case.

      You might try
      Code:
      ado uninstall boottest
      ssc install boottest
      and see if your luck is similar to mine.

      Or if you have the version from SJ installed
      Code:
      ado uninstall st0549
      ssc install boottest
      In any event, this workaround is useful for those who aren't easily able to update their community-contributed commands.
      Last edited by William Lisowski; 25 Aug 2022, 08:51.

      Comment


      • #4
        What William said. Sergey, regardless of whether you want a graph, that crash should not happen. However, the immediate question is whether you have the latest version. If the problem persists with the latest version, let me know.

        Comment


        • #5
          I am receiving the same error message with a recent install on a new machine (running STATA 15.1).

          I first installed boottest on this machine via st0549
          After running boottest and receiving the message that the installation was likely out of date, and I ran:
          Code:
          ssc install boottest, replace
          The boottest command began failing with the same error message Sergey noted.

          Running the following:
          Code:
          use https://raw.githubusercontent.com/droodman/boottest/master/data/collapsed
          regress hasinsurance selfemployed post post_self, cluster(year)
          boottest post_self=.04
          The boottest command was failing with the following error message: "option mlabformat() not allowed"

          I uninstalled st0549 AND uninstalled boottest and then installed boottest again
          Code:
          ssc install boottest
          and received the same error message (also restarted PC to clear memory).

          The boottest installation appeared to be up to date:

          Code:
          . which boottest
          c:\ado\plus\b\boottest.ado
          *! boottest 4.3.0 17 November 2022
          *! Copyright (C) 2015-22 David Roodman
          *! Version history at bottom


          I uninstalled boottest and installed st0549 again, and the code exercept example from above now, again, runs without issue (except for the prompt noting that it is likely out of date).

          Comment


          • #6
            So if I understand right, the issue is not with boottest per se but with the installation, which should be controlled by the built-in ssc and ado commands. Clearly old and new versions are being mixed somehow. Not sure how to help...

            Comment


            • #7
              Dear David Roodman,

              Thank you very much for your careful reply. My apologies for being silent.

              After updating Stata and boottest, the issue was resolved.

              Regards,
              Sergey
              Kind regards,
              Sergey Alexeev | ​The University of Sydney
              https://alexeev.pw/

              Comment


              • #8
                Hi, I am facing the same problem. I have a bigger chunk of code as given below. Please do let me know where I am erring

                ssc install boottest, replace

                program drop _all
                program define cluster, rclass
                syntax[, obs(integer 1) states(integer 1) ]

                *** PART I: Create the simulated dataset ***

                drop _all // Drop all variables
                set obs `states' // Create one observation for each simulated U.S. state
                gen state = _n // Give each simulated state an ID number
                gen x = runiform(0.04,0.12) // Draw a "state unemployment rate" from a uniform distribution
                gen eta = rnormal(0,1) // Grouped error term; notice it will be uncorrelated with x
                expand `obs' // Expand the dataset so there are `obs' people in each state
                * Now draw the outcome variable: "Log of earned income" for each person
                * Notice that x is not in this data-generation process, so the true coefficient on x is 0
                gen y = log(40000) + eta + rnormal(0,2)

                * Run the regression with OLS variance estimator
                reg y x
                return scalar beta = _b[x] // Tell program to return the estimated coefficient on x
                return scalar se_ols = _se[x] // Tell program to return the estimated OLS standard error
                matrix A=r(table)
                return scalar rej_ols = (A[4,1]<=.05) // This will be 1 if p-value less than 0.05, 0 otherwise

                * Now run the regression with clustering at the state level
                reg y x, vce(cluster state)
                return scalar se_clu = _se[x] // Tell program to return cluster-robust SE
                matrix B=r(table)
                return scalar rej_clu = (B[4,1]<=.05) // =1 if p-value less than .05, 0 otherwise

                * Now run the regression with a block bootstrap
                reg y x, vce(bootstrap, reps(10) cl(state)) // I reduce the bootstrap reps to make it faster!
                return scalar se_bbs = _se[x] // Block-bootstrap standard error
                matrix C=r(table)
                return scalar rej_bbs = (C[4,1]<=.05) // =1 if p-value less than .05, 0 otherwise

                * Now run the regression with a wild bootstrap
                reg y x, cluster(state) // I reduce the bootstrap reps to make it faster!
                *waldtest x, cluster(state)
                boottest x, reps(10)
                return scalar se_wild = _se[x] // Wildcluster bootstrap
                matrix D=r(table)
                return scalar rej_wild = (D[4,1]<=.05)
                end


                * Now that the program has been created, this portion of the code uses
                * the "simulate" command to run the "cluster" program 1,000 times. This
                * simulates the sampling distribution of the OLS estimator of the coefficient on x.
                * Note that the "rej_ols" and "rej_clu" variables should be very close to 0.05
                * if my variance estimator is unbiased
                set seed 12345
                simulate beta=r(beta) se_ols=r(se_ols) se_clu=r(se_clu) se_bbs=r(se_bbs) se_wild=r(se_wild) ///
                rej_ols=r(rej_ols) rej_clu=r(rej_clu) rej_bbs=r(rej_bbs) rej_wild=r(rej_wild), reps(1000): ///
                cluster, obs(100) states(6)

                * Now I'll summarize the results
                su beta se_* rej_*

                Comment


                • #9
                  I have Stata 14.2 and have run "ssc install boottest, replace," but the question "option mlabformat() not allowed" still exists.

                  Code:
                  ssc install boottest, replace
                  which boottest
                  webuse nlsw88, clear
                  regress wage tenure ttl_exp collgrad, cluster(industry)
                  boottest tenure, svmat
                  I then used remote desktop to connect to a University computer which has Stata 15, but the same question persists.

                  From discussions in this post I understand that it may be a version issue, but I still don't know how to solve it after trying all the recommendations.

                  Could anyone help me with this? Many thanks!

                  Click image for larger version

Name:	boottest1.png
Views:	1
Size:	509.7 KB
ID:	1724704


                  Click image for larger version

Name:	boottest2.png
Views:	1
Size:	389.3 KB
ID:	1724703








                  Comment


                  • #10
                    Thanks for reporting this. Yes, the code is using the mlabformat() option of the -scatter- command, which wasn't introduced till Stata 16.

                    I've just posted a new version of boottest on Github that I think prevents this crash. It should be on SSC soon.

                    Unfortunately, there is not a neat command to install from Github into Stata 14. Until the new version of boottest is on SSC, I recommend you manually download boottest.ado from github.com/droodman/boottest and save it over your current boottest.ado.

                    Comment


                    • #11
                      The problem has been resolved! Thank you, David!

                      Comment


                      • #12
                        Hi all,

                        Does anyone here also have the problem with boottest for the interaction between two categorical variables with the following error message?

                        "Null constraint applies only to omitted variables or base levels of factor variables."

                        Thank you in advance.

                        Best regards,
                        Evelyn

                        Comment

                        Working...
                        X