Announcement

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

  • Utest command by Lind and Mehlum (2010) - variables not found

    Hi everyone,

    I am currently working on a research model that includes several interaction terms as well as some non-linear effects. In order to ensure the latter are really non-linear I am trying to apply the procedure as suggested by Lind and Mehlum (2010), i.e. by running the utest command. However, Stata repeatedly cannot find the according variables (r(111)) - even though I used them in my logit regression, double-checked spelling, upper/lower case and so on. Has anyone experienced this before or is otherwise familiar with the utest command?

    Thanks a lot,
    Lina

  • #2
    at the bottom of the help file, you are asked to contact the authors if you find problems; that is likely to be by far the fastest way to resolve this

    Comment


    • #3
      From the helpfile:
      Estimation commands that prefixes saved results by equation names can be handled with the prefix-option. This includes estimations on multi-equation models (e.g. mlogit) and commands with additional saved results (e.g. nbreg).
      This holds for logit as well.

      Code:
      . sysuse auto,clear
      (1978 Automobile Data)
      
      . gen mpg2 = mpg^2
      
      . qui logit fore mpg mpg2
      
      . utest mpg mpg2
      mpg not found
      r(111);
      
      . mat list e(b)
      
      e(b)[1,3]
             foreign:    foreign:    foreign:
                 mpg        mpg2       _cons
      y1   .18979637  -.00062108  -4.7227994
      
      . utest mpg mpg2, prefix(foreign)
      
      Specification: f(x)=x^2
      Extreme point:  152.7949
      
      Test:
           H1: Inverse U shape
       vs. H0: Monotone or U shape 
      
      -------------------------------------------------
                       |   Lower bound      Upper bound
      -----------------+-------------------------------
      Interval         |          12               41
      Slope            |    .1748904         .1388676
      -------------------------------------------------
      
      Extremum outside interval - trivial rejection of H0
      
      .

      Comment


      • #4
        Thank you for you help. However it still doesn't work even though I tried as you suggested, Scott. Stata tells me "option prefix () not allowed". Does anybody know how to fix this? Many thanks again!

        Comment


        • #5
          Gabriella05: Please study the FAQ Advice, especially Section 6, 12 and 13. Most immediately

          Say exactly what you typed and exactly what Stata typed (or did) in response. N.B. exactly! If you can, reproduce the error with one of Stata's provided datasets, a small fragment of your dataset, or a simple concocted dataset that you include in your posting.
          That's to say: You got a syntax error. Until we see your syntax, we can't add to Stata's error message. If you're thinking that you did what Scott did, there has to be explanation for the difference, and it is likely be some mistake you made.
          Last edited by Nick Cox; 17 Oct 2014, 04:09.

          Comment


          • #6
            I'm sorry, Nick. Please see my code below; I ran a logisitc regression using Stata 12.1 and am referring to the Utest command by Lind & Mehlum (2010).


            Lind, J. T., & Mehlum, H. (2010). With or Without U? The Appropriate Test for a U‐Shaped Relationship*. Oxford Bulletin of Economics and Statistics, 72(1), 109-118.

            Code:
            . logit entrymode c_DivEQ_sum DivEQ_sum_squared
            
            Iteration 0:   log likelihood = -157.81819  
            Iteration 1:   log likelihood = -137.74551  
            Iteration 2:   log likelihood = -137.58163  
            Iteration 3:   log likelihood = -137.58029  
            Iteration 4:   log likelihood = -137.58029  
            
            Logistic regression                               Number of obs   =        228
                                                              LR chi2(2)      =      40.48
                                                              Prob > chi2     =     0.0000
            Log likelihood = -137.58029                       Pseudo R2       =     0.1282
            
            ---------------------------------------------------------------------------------------
            entrymode_dichotomous |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
            ----------------------+----------------------------------------------------------------
                      c_DivEQ_sum |   .2061185   .0441955     4.66   0.000      .119497    .2927401
                DivEQ_sum_squared |  -.0038237   .0031075    -1.23   0.219    -.0099143    .0022668
                            _cons |  -.0513933   .1624038    -0.32   0.752    -.3696989    .2669122
            ---------------------------------------------------------------------------------------
            
            . utest c_DivEQ_sum DivEQ_sum_squared
            c_DivEQ_sum not found
            r(111);
            
            . mat list e(b)
            
            e(b)[1,3]
            
                 entrymode~s:  entrymode~s:  entrymode~s:
                 c_DivEQ_sum  DivEQ_sum_~d         _cons
            y1     .20611855    -.00382372    -.05139331
            
             
            . utest c_DivEQ_sum DivEQ_sum_squared, prefix(entrymode)
            option prefix() not allowed
            r(198);
            
            end of do-file

            I am very grateful for your help.
            Last edited by Gabriella05; 17 Oct 2014, 04:24.

            Comment


            • #7
              Thanks. That's progress, as you have a visible problem. I think you may need to download the latest utest for this to work from SSC. It's not clear that you can abbreviate the equation name in the call to prefix() either.

              Comment


              • #8
                Thank you very much for your quick response. I will do as you suggest and contact the authors.

                Comment


                • #9
                  You're responding to something I deleted, but then replaced, because I think I have a better answer, which should now be visible above your post.

                  Comment


                  • #10
                    I installed the new version and it is working!! You're a star, Nick, thank you ever so much!

                    Comment


                    • #11
                      Before posting any question about a program not working, I recommend running -update all- and -adoupdate-. Sometimes you luck out and the problem has already been taken care of. In fact that might be a good addition to point 3 of the FAQ, "Before you post."

                      I got an inquiry a few weeks ago about a problem with one of my programs. There was indeed a bug, but it had already been fixed -- in 2006.
                      -------------------------------------------
                      Richard Williams, Notre Dame Dept of Sociology
                      StataNow Version: 19.5 MP (2 processor)

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

                      Comment


                      • #12
                        Hi Everyone, I encountered the same issue asGabriella05. I did install the newest version of utest, but when I used utest after running a logit regression, it showed that the variable being tested is not found. When I run a OLS regression using the same set of variables, the utest did work. Is this because utest only work for OLS but not logit?

                        Comment


                        • #13
                          Originally posted by Emma Chenz View Post
                          Hi Everyone, I encountered the same issue asGabriella05. I did install the newest version of utest, but when I used utest after running a logit regression, it showed that the variable being tested is not found. When I run a OLS regression using the same set of variables, the utest did work. Is this because utest only work for OLS but not logit?
                          You may want to add , pref(y), then it would run.

                          Comment


                          • #14
                            Hi Nitin, Could you provide a complete example? The following does not work.
                            Code:
                            sysuse auto, clear
                            gen mpg2 = mpg^2
                            reg foreign mpg mpg2
                            utest mpg mpg2, fieller pref(foreign)
                            Thanks.
                            Ho-Chuan (River) Huang
                            Stata 19.0, MP(4)

                            Comment

                            Working...
                            X