Announcement

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

  • Calculate the CI/SE/p-value of an inverse transformed variable in Stata after regression

    This problem halfway between Stata and Statistics - which is why I am putting it here.

    In this modelling problem, I have X = log (wage_educated/wage_uneducated) and Y = log (labor_educated/labor_uneducated)
    After I do this:

    Code:
    reg Y X
    The elasticity of substitution is the inverse of the coefficient of X. Now I need to also calculate the Confidence Interval, Std. Error and p-value for this elasticity. How do I use Stata commands to do them?

    I do need help with this for a thesis I am writing. And, as I said this, I know this problem is halfway between Stata and Stats, so, do let me know if you want me to take this question down.

  • #2
    help nlcom
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      What Maarten said, but explicitly:

      Code:
      . sysuse auto, clear
      (1978 Automobile Data)
      
      . reg price mpg
      
            Source |       SS           df       MS      Number of obs   =        74
      -------------+----------------------------------   F(1, 72)        =     20.26
             Model |   139449474         1   139449474   Prob > F        =    0.0000
          Residual |   495615923        72  6883554.48   R-squared       =    0.2196
      -------------+----------------------------------   Adj R-squared   =    0.2087
             Total |   635065396        73  8699525.97   Root MSE        =    2623.7
      
      ------------------------------------------------------------------------------
             price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
               mpg |  -238.8943   53.07669    -4.50   0.000    -344.7008   -133.0879
             _cons |   11253.06   1170.813     9.61   0.000     8919.088    13587.03
      ------------------------------------------------------------------------------
      
      . nlcom 1/_b[mpg]
      
             _nl_1:  1/_b[mpg]
      
      ------------------------------------------------------------------------------
             price |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
             _nl_1 |   -.004186     .00093    -4.50   0.000    -.0060088   -.0023631
      ------------------------------------------------------------------------------

      Comment


      • #4
        OMG. Thanks so much, both of you. This was far easier than the manual calculation I was doing.

        Comment


        • #5
          Joro Kolev Maarten Buis One more additional question - how do I store the confidence intervals/SE/p-value/t-value that I get from nlcom? I type in
          Code:
          return list
          and I don't see the place where Stata has stored the values for CI/SE/p/t values. I type
          Code:
          ereturn list
          and all I get are the list from the original regressions not from nlcom.

          Comment


          • #6
            Yes, indeed, these are a little bit hard to retrieve. You might want to file a complaint with Stata Corp.

            You can get them manually like this:

            Code:
            . nlcom 1/_b[mpg]
            
                   _nl_1:  1/_b[mpg]
            
            ------------------------------------------------------------------------------
                   price |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
            -------------+----------------------------------------------------------------
                   _nl_1 |   -.004186     .00093    -4.50   0.000    -.0060088   -.0023631
            ------------------------------------------------------------------------------
            
            . dis "Point estimate = " el(r(b),1,1)
            Point estimate = -.00418595
            
            . dis "Lower Bound = " el(r(b),1,1) - 1.96*sqrt(el(r(V),1,1))
            Lower Bound = -.00600879
            
            . dis "Upper Bound = " el(r(b),1,1) + 1.96*sqrt(el(r(V),1,1))
            Upper Bound = -.00236311
            Originally posted by Uma Ravi View Post
            Joro Kolev Maarten Buis One more additional question - how do I store the confidence intervals/SE/p-value/t-value that I get from nlcom? I type in
            Code:
            return list
            and I don't see the place where Stata has stored the values for CI/SE/p/t values. I type
            Code:
            ereturn list
            and all I get are the list from the original regressions not from nlcom.

            Comment


            • #7
              There is a Stata tip that discusses what Joro just did: https://journals.sagepub.com/doi/pdf...867X0800700408
              ---------------------------------
              Maarten L. Buis
              University of Konstanz
              Department of history and sociology
              box 40
              78457 Konstanz
              Germany
              http://www.maartenbuis.nl
              ---------------------------------

              Comment

              Working...
              X