Announcement

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

  • GLS for non-linear equation

    ln (Pit) = a*ln(Rit + b*Vit) + uit

    I want to estimate a, b for wide panel data (i = 1~16, t = 2007~1016) by using GLS

    The problem is that b is in the logarithm

    please help me out


  • #2
    You could use -nl-

    Code:
    . clear
    
    . set obs 1000
    number of observations (_N) was 0, now 1,000
    
    . gen R = runiform()
    
    . gen V = runiform()
    
    . gen u = rnormal()
    
    . gen P = ((5*V + R)^2.5)*exp(u)
    
    . gen lnP = ln(P)
    
    . nl (lnP = {a=1}*ln(R + {b=1}*V)), nolog
    (obs = 1,000)
    
    
          Source |      SS            df       MS
    -------------+----------------------------------    Number of obs =      1,000
           Model |  8427.5155          2  4213.75775    R-squared     =     0.8949
        Residual |  990.18942        998  .992173766    Adj R-squared =     0.8946
    -------------+----------------------------------    Root MSE      =   .9960792
           Total |  9417.7049       1000  9.41770493    Res. dev.     =   2828.018
    
    ------------------------------------------------------------------------------
             lnP |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
              /a |   2.504446   .0568576    44.05   0.000     2.392872    2.616021
              /b |   5.058831   .1660434    30.47   0.000     4.732996    5.384665
    ------------------------------------------------------------------------------

    Comment

    Working...
    X