Announcement

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

  • p>[z] in nlcom results

    I have a large survey data set. After estimating means (proportions), I use nlcom to estimate rate ratios and use post to store results. The first output includes p>[z], which is almost always <0.000, while the confidence intervals cover 1. The test command produces a more expected p value, usually >>0.05. What is p>[z] reporting?
    Thanks,
    Arnold

  • #2
    It would be helpful if you showed your output to better illustrate your question. For nlcom and most commands, the null hypothesis of the test is whether the estimated coefficient (in your case, the ratio) is equal to zero. This may be uninteresting if you are instead interested in whether the ratio is equal to one. In that case, simply use the test command following nlcom.

    Code:
    sysuse auto, clear
    regress mpg weight displacement
    nlcom _b[weight]/ _b[displacement], post
    test _b[_nl_1]=0
    test _b[_nl_1]=1
    Res.:

    Code:
    . nlcom _b[weight]/ _b[displacement], post
    
           _nl_1: _b[weight]/ _b[displacement]
    
    ------------------------------------------------------------------------------
             mpg | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
           _nl_1 |  -1.243587   2.128868    -0.58   0.559    -5.416092    2.928917
    ------------------------------------------------------------------------------
    
    . 
    . test _b[_nl_1]=0
    
     ( 1)  _nl_1 = 0
    
               chi2(  1) =    0.34
             Prob > chi2 =    0.5591
    
    . 
    . test _b[_nl_1]=1
    
     ( 1)  _nl_1 = 1
    
               chi2(  1) =    1.11
             Prob > chi2 =    0.2919

    Comment


    • #3
      Andrew,
      Yes this is what I was asking, and your example is like my situation. I see that the reported P>|z| is for coeffiicient==0, and for a rate ratio the test is against coefficient==1. Thanks for the helpful feedback.

      Comment


      • #4
        Originally posted by Arnold Levinson View Post
        I see that the reported P>|z| is for coeffiicient==0, and for a rate ratio the test is against coefficient==1
        Subtracting 1 from the ratio would also serve as an appropriate reparameterization to test the hypothesis that the ratio is equal to 1.

        Code:
        sysuse auto, clear
        regress mpg weight displacement
        nlcom _b[weight]/ _b[displacement], post
        test _b[_nl_1]=1
        
        qui regress mpg weight displacement
        *REPARAMETRIZE
        nlcom _b[weight]/ _b[displacement] -1, post
        Res.:

        Code:
        . nlcom _b[weight]/ _b[displacement], post
        
               _nl_1: _b[weight]/ _b[displacement]
        
        ------------------------------------------------------------------------------
                 mpg | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
        -------------+----------------------------------------------------------------
               _nl_1 |  -1.243587   2.128868    -0.58   0.559    -5.416092    2.928917
        ------------------------------------------------------------------------------
        
        . 
        . test _b[_nl_1]=1
        
         ( 1)  _nl_1 = 1
        
                   chi2(  1) =    1.11
                 Prob > chi2 =    0.2919
        
        . 
        . 
        . 
        . qui regress mpg weight displacement
        
        . 
        . *REPARAMETRIZE
        
        . 
        . nlcom _b[weight]/ _b[displacement] -1, post
        
               _nl_1: _b[weight]/ _b[displacement] -1
        
        ------------------------------------------------------------------------------
                 mpg | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
        -------------+----------------------------------------------------------------
               _nl_1 |  -2.243587   2.128868    -1.05   0.292    -6.416092    1.928917
        ------------------------------------------------------------------------------
        
        .

        Comment


        • #5
          Yes, I see. Thank you again. Now I have a new question, please advise whether I should create a new thread.
          I have calculated weight ratios from survey data, and ignoring z and P>|z| because they're irrelevant, I want to determine whether the rate-ratio increasing trend is significant. Test won't accept a series of inequalities, or even a single inequality. I tried creating a data set of the rate ratios and standard errors, then regressing with pweights = 1/se^2. But there are only five observations that way, which seems fishy.

          Here's the code and output


          svyset hh_id_allyr [pw=phonewt], strata(geowt)
          svy, subpop(if single!=1): mean quitterb, over(year inequity)

          nlcom (Rate_ratio_2008: _b[[email protected]#1.inequity] / _b[[email protected]#0.inequity]) (Rate_ratio_2012: _b[[email protected]#1.inequity] / _b[[email protected]#0.inequity]) (Rate_ratio_2015: _b[[email protected]#1.inequity] / _b[[email protected]#0.inequity]) (Rate_ratio_2018: _b[[email protected]#1.inequity] / _b[[email protected]#0.inequity]) (Rate_ratio_2022: _b[[email protected]#1.inequity] / _b[[email protected]#0.inequity]), post


          Survey: Mean estimation

          Number of strata = 113 Number of obs = 4,883
          Number of PSUs = 4,842 Population size = 1,950,480
          Subpop. no. obs = 4,883
          Subpop. size = 1,950,480
          Design df = 4,729

          --------------------------------------------------------------------------
          | Linearized
          | Mean Std. Err. [95% Conf. Interval]
          -------------------------+------------------------------------------------
          c.quitterb@year#inequity |
          2008 0 | .1676293 .0299719 .1088705 .2263882
          2008 1 | .074061 .0110659 .0523667 .0957552
          2012 0 | .1251159 .0364989 .0535611 .1966707
          2012 1 | .0878328 .0146444 .0591229 .1165427
          2015 0 | .1406765 .0416307 .0590609 .2222921
          2015 1 | .0981557 .0164493 .0659075 .1304039
          2018 0 | .2122044 .0416318 .1305866 .2938222
          2018 1 | .1602063 .0181833 .1245585 .195854
          2022 0 | .1902246 .0596587 .0732657 .3071835
          2022 1 | .1772962 .0249485 .1283854 .226207
          --------------------------------------------------------------------------
          Note: 2 strata omitted because they contain no subpopulation members.

          .
          .
          .
          . nlcom (Rate_ratio_2008: _b[[email protected]#1.inequity] / _b[[email protected]#0.inequity]) (Rate_ratio_2012: _b[[email protected]#1.inequity] / _b[quitterb@20
          > 12.year#0.inequity]) (Rate_ratio_2015: _b[[email protected]#1.inequity] / _b[[email protected]#0.inequity]) (Rate_ratio_2018: _b[[email protected]#1.inequity] /
          > _b[[email protected]#0.inequity]) (Rate_ratio_2022: _b[[email protected]#1.inequity] / _b[[email protected]#0.inequity]), post

          Rate_ra~2008: _b[[email protected]#1.inequity] / _b[[email protected]#0.inequity]
          Rate_ra~2012: _b[[email protected]#1.inequity] / _b[[email protected]#0.inequity]
          Rate_ra~2015: _b[[email protected]#1.inequity] / _b[[email protected]#0.inequity]
          Rate_ra~2018: _b[[email protected]#1.inequity] / _b[[email protected]#0.inequity]
          Rate_ra~2022: _b[[email protected]#1.inequity] / _b[[email protected]#0.inequity]

          ---------------------------------------------------------------------------------
          Mean | Coef. Std. Err. z P>|z| [95% Conf. Interval]
          ----------------+----------------------------------------------------------------
          Rate_ratio_2008 | .4418138 .1019554 4.33 0.000 .2419849 .6416426
          Rate_ratio_2012 | .7020116 .2357582 2.98 0.003 .239934 1.164089
          Rate_ratio_2015 | .6977409 .2377938 2.93 0.003 .2316736 1.163808
          Rate_ratio_2018 | .754962 .1711076 4.41 0.000 .4195974 1.090327
          Rate_ratio_2022 | .932036 .3217958 2.90 0.004 .3013277 1.562744
          ---------------------------------------------------------------------------------


          Comment


          • #6
            Correction: Rate ratios (actually prevalence ratios), not "weight ratios".

            Comment


            • #7
              Originally posted by Arnold Levinson View Post
              I want to determine whether the rate-ratio increasing trend is significant.
              It depends on how you define the slope—for example, whether you take the difference between the first and last estimates and divide by the number of survey waves, or instead compute an average slope based on all successive differences across waves. For the latter:

              \[
              \text{slope} \;=\; \frac{1}{4} \Big[
              \big( \hat{\theta}_{2012} - \hat{\theta}_{2008} \big) \;+\;
              \big( \hat{\theta}_{2015} - \hat{\theta}_{2012} \big) \;+\;
              \big( \hat{\theta}_{2018} - \hat{\theta}_{2015} \big) \;+\;
              \big( \hat{\theta}_{2022} - \hat{\theta}_{2018} \big)
              \Big].
              \]

              To test that it is significantly > 0, you can use nlcom as follows:

              Code:
              nlcom (slope: ( (_b[Rate_ratio_2012] - _b[Rate_ratio_2008]) ///
                            + (_b[Rate_ratio_2015] - _b[Rate_ratio_2012]) ///
                            + (_b[Rate_ratio_2018] - _b[Rate_ratio_2015]) ///
                            + (_b[Rate_ratio_2022] - _b[Rate_ratio_2018]) ) / 4 )
              Last edited by Andrew Musau; 17 Sep 2025, 09:36.

              Comment


              • #8
                Thanks! The second option is what I wanted.

                Comment

                Working...
                X