Announcement

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

  • Error when running Wald test.

    I have tried several times, from different computers, to run wald test. I always get r(111); error , which means that one of the variables i am using is not available. However, i have used all my variables more than once for the regressions I ran. Do i need a plugin or smth? My supervisor could run Wald test perfectly today. What do i do wrong? the command i am using is " test LN_TOBINSQ + ENV_SCORE = 0 "

  • #2
    I imagine that there are a few ways that this error can arise. (see below for one example).
    You need to show us the output or, at the very least the regression equation.


    Code:
    . sysuse auto, clear
    (1978 Automobile Data)
    
    . regress weight displacement length i.foreign
    
          Source |       SS       df       MS              Number of obs =      74
    -------------+------------------------------           F(  3,    70) =  316.41
           Model |  41065826.8     3  13688608.9           Prob > F      =  0.0000
        Residual |  3028351.61    70  43262.1659           R-squared     =  0.9313
    -------------+------------------------------           Adj R-squared =  0.9284
           Total |  44094178.4    73  604029.841           Root MSE      =     208
    
    ------------------------------------------------------------------------------
          weight |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    displacement |   2.896668   .5059436     5.73   0.000     1.887595    3.905741
          length |    22.8555   2.005438    11.40   0.000     18.85578    26.85522
                 |
         foreign |
        Foreign  |  -15.84603   67.60297    -0.23   0.815    -150.6759    118.9838
           _cons |  -1842.624    316.136    -5.83   0.000    -2473.137    -1212.11
    ------------------------------------------------------------------------------
    
    . test length + displacement = 0
    
     ( 1)  displacement + length = 0
    
           F(  1,    70) =  240.30
                Prob > F =    0.0000
    
    . test length + foreign = 0
    regressor foreign not found
    r(111);
    
    .

    Comment


    • #3
      Thank you for you response. Here is the output and the regression equation i am using. Apparently, I am doing something wrong but i don't know what.

      Comment


      • #4
        Your LN_TOBINSQ is the response (outcome, dependent variable). Therefore it is not a predictor (covariate, independent variable). Therefore, there is no coefficient associated with it.

        What hypothesis do you want to test?

        By the way, you missed the request to use full real names on Statalist. "v. ch" is not your full real name, I will bet. Please use the "Contact us" button on the home page to send a message with your full real name to the administrators. That could be something like Vincent Chan or Victoria Cholmondeley.

        Comment


        • #5
          I apologise for the misuse of full name request. I only use STATA at university, I do not have a license myself and that is why i chose to put the first letters. I will correct that asap.
          As for the hypothesis, i want to test the relation between ln toxin's q and ENV score whether is statistically sign. below than zero.

          Comment


          • #6
            The regress results already provide the test you need.

            The request for full real names is quite independent of how you are and how you use Stata [NB[,

            Comment


            • #7
              Indeed, but my supervisor asked me to do so. he ran the wald test in front of me with the same variables and some additional ones, he got results. But i cannot. I am not insane. There should be a way to ran it correctly and apparently i don't know what i am doing wrong.

              Comment


              • #8
                You are treating the response as if it were a predictor. That's wrong.

                Comment


                • #9
                  I don't know what your supervisor did but it must have been different than what you are doing. I am guessing he ran a model where the dependent variable was different and your variables were both explanatory variables. Try to copy exactly what he did and I think you'll see why what you are doing is different. If not, then post his code and results.
                  -------------------------------------------
                  Richard Williams, Notre Dame Dept of Sociology
                  StataNow Version: 19.5 MP (2 processor)

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

                  Comment


                  • #10
                    Hi!

                    I am having the same problem. I estimate a regression model and when testing with Wald test, the command does not find my variables. See the output:


                    . quietly svy, subpop(if rsex==0): ologit sfrint_rec i.partnertype i.agerec3 Partduration2 i.nochall_rec i.hafsex_rec afsex i.totsexp2 i.ppnum_rec ///
                    > i.viotry2_rec i.employstatus_rec ib2.educ3_r, or

                    .
                    . test hafsex_rec afsex totsexp2 ppnum_rec viotry2_rec

                    Adjusted Wald test
                    hafsex_rec not found
                    r(111);

                    end of do-file

                    r(111);

                    Can anyone, please, help?
                    Thank you!

                    Comment


                    • #11
                      The ologit command says i.hafsex_rec and the test command says hafsex_rec. You want something like

                      Code:
                      webuse nhanes2f, clear
                      svy: ologit health i.sex weight height
                      test 2.sex
                      testparm i.sex
                      -------------------------------------------
                      Richard Williams, Notre Dame Dept of Sociology
                      StataNow Version: 19.5 MP (2 processor)

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

                      Comment

                      Working...
                      X