Announcement

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

  • How to conduct the NLSUR


    I am a new user of STATA. I hope somebody give me a light.

    Right now, I am trying to estimate system equations with nonlinear in parameters using NLSUR.
    Here, I attached the system equations, the stata command and the result.

    The Command in Stata

    nlsur ( Rc = {s=0.5}*{τ=2.5}*(({δ=0.12}+{theta=0.616})/({δ=0.12}+{s=0.5}*{theta=0.616}))*Nc - {τ=2.5}*xkab) ( Rcu = {s=0.5}*{τ=2.5}*Nc + {s=0.5}*{τ=2.5}*xkab) (Lc = ({s=0.5}*{theta=0.616}/({δ=0.12}+{s=0.5}*{theta=0.616}))*N - ({s=0.5}*{theta=0.616}/({δ=0.12}+{s=0.5}*{theta=0.616}))*Lr) ( jcurban= (({r=0.1}+{δ=0.12}+{β=0.2}*{s=0.5}*{theta=0.616}) / (1-{β=0.2}*({r=0.1}+{δ=0.12}))*({fsc=0.15}*{r=0.1}+{f sc=0.15}*{δ=0.12}) + ({s=0.5}*{theta=0.616}*{τ=2.5}-{s=0.5}*{theta=0.616}*{s=0.5}*{τ=2.5})/({δ=0.12}+{s=0.5}*{theta=0.616})*N - ({s=0.5}*{theta=0.616}*{τ=2.5}-{s=0.5}*{theta=0.616}*{s=0.5}*{τ=2.5})/({δ=0.12}+{s=0.5}*{theta=0.616})*Lr)) (wc=((({β=0.2}*{r=0.1}+{β=0.2}*{δ=0.12}+{β=0.2}*{s =0.5}*{theta=0.616})*({fsc=0.01}*({r=0.1}+{δ=0.12} ))) / (({r=0.1}+{δ=0.12}-{β=0.2}*{r=0.1}-{β=0.2}*{δ=0.12})*{theta=0.616}))+(({r=0.1}+({β=0. 2}*({r=0.1}+{s=0.5}*{theta=0.616}+{δ=0.12}))) + ({δ=0.12}*{τ=2.5}-{δ=0.12}*{s=0.5}*{τ=2.5})) / ({r=0.1}+{δ=0.12}+{β=0.2}*{s=0.5}*{theta=0.616})*( ( {s=0.5}*{theta=0.616})/({δ=0.12}+{s=0.5}*{theta=0.616}))*N-(({r=0.1}+({β=0.2}*({r=0.1}+{s=0.5}*{theta=0.616}+ {δ=0.12}))) + ({δ=0.12}*{τ=2.5}-{δ=0.12}*{s=0.5}*{τ=2.5})) / ({r=0.1}+{δ=0.12}+{β=0.2}*{s=0.5}*{theta=0.616})*( ( {s=0.5}*{theta=0.616})/({δ=0.12}+{s=0.5}*{theta=0.616}))*Lr)

    The Result:

    Calculating NLS estimates...
    Iteration 0: Residual SS = 1.41e+16
    Iteration 1: Residual SS = 1.37e+16
    Iteration 2: Residual SS = 1.37e+16
    Iteration 3: Residual SS = 1.37e+16
    Iteration 4: Residual SS = 1.37e+16
    Iteration 5: Residual SS = 1.37e+16
    Iteration 6: Residual SS = 1.37e+16
    Iteration 7: Residual SS = 1.37e+16
    Iteration 8: Residual SS = 1.37e+16
    Iteration 9: Residual SS = 1.37e+16
    Iteration 10: Residual SS = 1.37e+16
    Iteration 11: Residual SS = 1.37e+16
    Iteration 12: Residual SS = 1.37e+16
    Iteration 13: Residual SS = 1.37e+16
    Calculating FGNLS estimates...
    Iteration 0: Scaled RSS = 2457.553
    Iteration 1: Scaled RSS = 2437.816
    Iteration 2: Scaled RSS = 2435.802
    Iteration 3: Scaled RSS = 2435.8
    Iteration 4: Scaled RSS = 2435.8

    FGNLS regression
    ---------------------------------------------------------------------
    Equation | Obs Parms RMSE R-sq Constant
    ----------------+----------------------------------------------------
    1 Rc | 492 4 3494019 0.2344* (none)
    2 Rcu | 492 2 3959116 0.1811* (none)
    3 Lc | 492 3 64264.35 0.9049* (none)
    4 jcurban | 492 7 58396.85 0.6779 r
    5 wc | 492 7 187692.6 -0.0248 fsc
    ---------------------------------------------------------------------
    * Uncentered R-sq

    ------------------------------------------------------------------------------
    | Coef. Std. Err. z P>|z| [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    /s | .8927031 .0072136 123.75 0.000 .8785646 .9068415
    /t | 4.651894 .309321 15.04 0.000 4.045636 5.258152
    /d | 4.214471 1.323854 3.18 0.001 1.619764 6.809177
    /theta | 2.216726 .7013804 3.16 0.002 .8420457 3.591406
    /r | -3.906808 1.240583 -3.15 0.002 -6.338305 -1.475311
    /ß | .9887485 .000669 1478.02 0.000 .9874374 .9900597
    /fsc | 2956.139 . . . . .
    ------------------------------------------------------------------------------




    My Questions are::
    1. If I want to know the relationship between variables, It was right what I’ve done?
    2. If the step is yes, how to make an interpretation in every equation ?
    3. If the step is wrong, please give me the light how to conduct rightly to estimate non linear in parameters of system equations.
    Thank You.
    Best Regard
    Gidion
    Attached Files

  • #2
    Nonlinear system of equations or any nonlinear function must has an economic meaning.
    Check the name of your model and then look for how to calculate marginal effects and elasticities.
    Emad A. Shehata
    Professor (PhD Economics)
    Agricultural Research Center - Agricultural Economics Research Institute - Egypt
    Email: [email protected]
    IDEAS: http://ideas.repec.org/f/psh494.html
    EconPapers: http://econpapers.repec.org/RAS/psh494.htm
    Google Scholar: http://scholar.google.com/citations?...r=cOXvc94AAAAJ

    Comment


    • #3
      Gidion.

      I'm afraid your questions are too broad to give you a meaningful answer. We can not know whether what you're doing is "right" or "wrong" without knowing what you're trying to achieve.

      You should check the advice given in the FAQ on how to ask questions on Statalist. I'd be happy to answer specific questions after you tell us exactly what you're looking for.
      http://www.stata.com/support/faqs/re...statalist-faq/

      Jorge Eduardo Pérez Pérez
      www.jorgeperezperez.com

      Comment


      • #4
        Dear Emad Shehata and Jorge Eduardo Perez Perez.

        Thank you for your advices, and I will explain generally about the model:.

        About the economic meaning. I try to test is there any relationship between land rent differentials (between urban and rural) to urban labor market (major issues) and also urban land market (minor issues). In Urban labor market I am trying to know how land rent differentials cause job creation and wages in urban labor market. In urban land rent, I want to know how land rent differentials cause land rent for employee and unemployee in urban area. Actually, I want to modify Zenou model and test impirically. Theoritical background of this research was inspiring by Harris-Todaro Model of migration, but I will see from another side using Zenou's model. I hope this will make it clear.

        Questions:
        1. Am I right to do what Emad Shehata suggestion ? I attached below the command and the results
        2. If then, on the process stata give message : Maximum number of iterations exceeded. How should I do ?

        This is more complete and technically I have done:

        The Equations (for clear letter, please look at attachment)
        Rc(x)=sτ [ (δ+θ^c) / (δ+sθ^c) ]*N^c - τx
        R_U^c (x)=s.τ (N^c - x)
        L^(C*)= (s〖θ^c〗^(*1-μ))/(δ+s〖θ^(c*)〗^(1-μ) ) (N-L^(R*) )
        w_L^C=(1-β)(r+δ)(1-s)τ/(r+δ+βs ̅〖θ^C〗^(1-μ) ) L^(C*) +β(r+δ+s ̅〖θ^C〗^(1-μ) )/(r+δ+βs ̅〖θ^C〗^(1-μ) ) y^(C*)
        y^(C*)=(r+δ+βs ̅〖θ^C〗^(1-μ))/(1-β)(r+δ) γ(r+δ)/〖θ^C〗^(-μ) + (s〖θ^c〗^(1-μ) (1-s)τ)/(δ+s〖θ^c〗^(1-μ) ) (N-L^(R*) )



        The Variables:
        The Variables: R_L^(c*) (x)=Urban Land Rent for worker , N^c=Total Population in urban area, x=xkab=distance from cbd , R_U^c (x)=urban land rent for unemployment, N=total population , L^R=number of working labor in rural, w_L^C=wages in urban , L^(C*)=number of working labor in urban , y^(C*)=job creation in urban

        The parameters: s=searc effort of labor to find job τ=commuter cost of worker, δ=job destroying rate , 〖θ^c=theta〗^ =market tightness in urban labor market , r=discount rate , β=bargaining power of labor , μ=cobb douglas coef between 0-1, γ=fsc=firm search cost, x=distance from CBD


        The Command in Stata

        nlsur ( Rc = {s=0.5}*{τ=2.5}*(({δ=0.12}+{theta=0.616})/({δ=0.12}+{s=0.5}*{theta=0.616}))*Nc - {τ=2.5}*xkab) ( Rcu = {s=0.5}*{τ=2.5}*Nc + {s=0.5}*{τ=2.5}*xkab) (Lc = ({s=0.5}*{theta=0.616}/({δ=0.12}+{s=0.5}*{theta=0.616}))*N - ({s=0.5}*{theta=0.616}/({δ=0.12}+{s=0.5}*{theta=0.616}))*Lr) ( jcurban= (({r=0.1}+{δ=0.12}+{β=0.2}*{s=0.5}*{theta=0.616}) / (1-{β=0.2}*({r=0.1}+{δ=0.12}))*({fsc=0.15}*{r=0.1}+{f sc=0.15}*{δ=0.12}) + ({s=0.5}*{theta=0.616}*{τ=2.5}-{s=0.5}*{theta=0.616}*{s=0.5}*{τ=2.5})/({δ=0.12}+{s=0.5}*{theta=0.616})*N - ({s=0.5}*{theta=0.616}*{τ=2.5}-{s=0.5}*{theta=0.616}*{s=0.5}*{τ=2.5})/({δ=0.12}+{s=0.5}*{theta=0.616})*Lr)) (wc=((({β=0.2}*{r=0.1}+{β=0.2}*{δ=0.12}+{β=0.2}*{s =0.5}*{theta=0.616})*({fsc=0.01}*({r=0.1}+{δ=0.12} ))) / (({r=0.1}+{δ=0.12}-{β=0.2}*{r=0.1}-{β=0.2}*{δ=0.12})*{theta=0.616}))+(({r=0.1}+({β=0. 2}*({r=0.1}+{s=0.5}*{theta=0.616}+{δ=0.12}))) + ({δ=0.12}*{τ=2.5}-{δ=0.12}*{s=0.5}*{τ=2.5})) / ({r=0.1}+{δ=0.12}+{β=0.2}*{s=0.5}*{theta=0.616})*( ( {s=0.5}*{theta=0.616})/({δ=0.12}+{s=0.5}*{theta=0.616}))*N-(({r=0.1}+({β=0.2}*({r=0.1}+{s=0.5}*{theta=0.616}+ {δ=0.12}))) + ({δ=0.12}*{τ=2.5}-{δ=0.12}*{s=0.5}*{τ=2.5})) / ({r=0.1}+{δ=0.12}+{β=0.2}*{s=0.5}*{theta=0.616})*( ( {s=0.5}*{theta=0.616})/({δ=0.12}+{s=0.5}*{theta=0.616}))*Lr)

        The Result:

        Calculating NLS estimates...
        Iteration 0: Residual SS = 1.41e+16
        Iteration 1: Residual SS = 1.37e+16
        Iteration 2: Residual SS = 1.37e+16
        Iteration 3: Residual SS = 1.37e+16
        Iteration 4: Residual SS = 1.37e+16
        Iteration 5: Residual SS = 1.37e+16
        Iteration 6: Residual SS = 1.37e+16
        Iteration 7: Residual SS = 1.37e+16
        Iteration 8: Residual SS = 1.37e+16
        Iteration 9: Residual SS = 1.37e+16
        Iteration 10: Residual SS = 1.37e+16
        Iteration 11: Residual SS = 1.37e+16
        Iteration 12: Residual SS = 1.37e+16
        Iteration 13: Residual SS = 1.37e+16
        Calculating FGNLS estimates...
        Iteration 0: Scaled RSS = 2457.553
        Iteration 1: Scaled RSS = 2437.816
        Iteration 2: Scaled RSS = 2435.802
        Iteration 3: Scaled RSS = 2435.8
        Iteration 4: Scaled RSS = 2435.8

        FGNLS regression
        ---------------------------------------------------------------------
        Equation | Obs Parms RMSE R-sq Constant
        ----------------+----------------------------------------------------
        1 Rc | 492 4 3494019 0.2344* (none)
        2 Rcu | 492 2 3959116 0.1811* (none)
        3 Lc | 492 3 64264.35 0.9049* (none)
        4 jcurban | 492 7 58396.85 0.6779 r
        5 wc | 492 7 187692.6 -0.0248 fsc
        ---------------------------------------------------------------------
        * Uncentered R-sq

        ------------------------------------------------------------------------------
        | Coef. Std. Err. z P>|z| [95% Conf. Interval]
        -------------+----------------------------------------------------------------
        /s | .8927031 .0072136 123.75 0.000 .8785646 .9068415
        /t | 4.651894 .309321 15.04 0.000 4.045636 5.258152
        /d | 4.214471 1.323854 3.18 0.001 1.619764 6.809177
        /theta | 2.216726 .7013804 3.16 0.002 .8420457 3.591406
        /r | -3.906808 1.240583 -3.15 0.002 -6.338305 -1.475311
        /ß | .9887485 .000669 1478.02 0.000 .9874374 .9900597
        /fsc | 2956.139 . . . . .
        ------------------------------------------------------------------------------

        Questions:
        1. If I want to know the relationship between variables, It was right what I’ve done?
        2. If the step is yes, how to make an interpretation in every equation ?
        3. If the step is wrong, please give me the light how to conduct rightly to estimate non linear in parameters of system equations.
        New Step Follow the Emad Shehata’s suggestion

        Command:nlcom
        %one by one equation%
        Eq: Rc
        nlcom ((_b[/b0]*_b[/b1])*((_b[/b2]+_b[/b3])/(_b[/b2]+_b[/b0])*_b[/b3])) (_b[/b1])
        Eq: Ru
        nlcom (_b[/b0]*_b[/b1]) (-_b[/b0]*_b[/b1])
        Eq: Lc
        nlcom (_b[/b0]*_b[/b3]/(_b[/b2]+_b[/b0]*_b[/b3]))(-_b[/b0]*_b[/b3]/(_b[/b2]+_b[/b0]*_b[/b3]))
        Eq: Jcurban
        nlcom (((_b[/b5]+_b[/b2]+_b[/b4]*_b[/b0]*_b[/b3]) / (1-_b[/b4]*(_b[/b5]+_b[/b2])))*((_b[/b6]*_b[/b5]+_b[/b6]*_b[/b2]) /_b[/b11]))(((_b[/b0]*_b[/b3]*_b[/b1])-(_b[/b0]*_b[/b3]*_b[/b0]*_b[/b1]))/(_b[/b2]+_b[/b0]*_b[/b3])) (-((_b[/b0]*_b[/b3]*_b[/b1])-(_b[/b0]*_b[/b3]*_b[/b0]*_b[/b1]))/(_b[/b2]+_b[/b0]*_b[/b3]))

        Eq: Wc
        nlcom ((_b[/b4] *_b[/b5] +_b[/b4]*_b[/b2]+_b[/b4]*_b[/b0]*_b[/b3])*(_b[/b6]*(_b[/b5]+_b[/b2])) / (_b[/b5]+_b[/b2]-_b[/b4]*_b[/b5]_b[/b4]*_b[/b2]*_b[/b3]))(((_b[/b5]+_b[/b4]*(_b[/b5]+_b[/b0]
        *_b[/b3]+_b[/b2]))+ (_b[/b2] *_b[/b1])*(1-_b[/b0])) / (_b[/b5]+_b[/b2]+_b[/b4]*_b[/b0]
        *_b[/b3]))*(( _b[/b0]*_b[/b3])/(_b[/b2]+_b[/b0]*_b[/b3]))(-((_b[/b5]+_b[/b4]*(_b[/b5]
        +_b[/b0]*_b[/b3]+_b[/b2]))+ (_b[/b2] *_b[/b1])*(1-_b[/b0])) / (_b[/b5]+_b[/b2]+_b[/b4]*_b[/b0]
        *_b[/b3]))*(( _b[/b0]*_b[/b3])/(_b[/b2]+_b[/b0]*_b[/b3]))
        (((_b[/r]+_b[/ß]*(_b[/r]+_b[/s]*_b[/T1µ]+_b[/d]))+ (_b[/d] *_b[/t])*(1-_b[/s])) /(_b[/r]+_b[/d]+_b[/ß]*_b[/s]*_b[/T1µ]))*(( _b[/s]*_b[/T1µ])/(_b[/d]+_b[/s]*_b[/T1µ]))
        (-((_b[/r]+_b[/ß]*(_b[/r]+_b[/s]*_b[/T1µ]+_b[/d]))+ (_b[/d] *_b[/t])*(1-_b[/s])) / (_b[/r]+_b[/d]+_b[/ß]*_b[/s]*_b[/T1µ]))*(( _b[/s]*_b[/T1µ])/(_b[/d]+_b[/s]*_b[/T1µ]))

        %Simultanously Command%
        nlcom ((_b[/b0]*_b[/b1])*((_b[/b2]+_b[/b3])/(_b[/b2]+_b[/b0])*_b[/b3])) (_b[/b1]) (_b[/b0]*_b[/b1]) (-_b[/b0]*_b[/b1]) (_b[/b0]*_b[/b3]/(_b[/b2]+_b[/b0]*_b[/b3]))(-_b[/b0]*_b[/b3]/(_b[/b2]+_b[/b0]*_b[/b3])) (((_b[/b5]+_b[/b2]+_b[/b4]*_b[/b0]*_b[/b3]) / (1-_b[/b4]*(_b[/b5]+_b[/b2])))*((_b[/b6]*_b[/b5]+_b[/b6]*_b[/b2]) /_b[/b11]))
        (((_b[/b0]*_b[/b3]*_b[/b1])-(_b[/b0]*_b[/b3]*_b[/b0]*_b[/b1]))/(_b[/b2]+_b[/b0]*_b[/b3])) (-((_b[/b0]*_b[/b3]*_b[/b1])-(_b[/b0]*_b[/b3]*_b[/b0]*_b[/b1]))/(_b[/b2]+_b[/b0]*_b[/b3]))
        ((_b[/b4] *_b[/b5] +_b[/b4]*_b[/b2]+_b[/b4]*_b[/b0]*_b[/b3])*(_b[/b6]*(_b[/b5]+_b[/b2])) / (_b[/b5]+_b[/b2]-_b[/b4]*_b[/b5]_b[/b4]*_b[/b2]*_b[/b3]))(((_b[/b5]+_b[/b4]*(_b[/b5]+_b[/b0]
        *_b[/b3]+_b[/b2]))+ (_b[/b2] *_b[/b1])*(1-_b[/b0])) / (_b[/b5]+_b[/b2]+_b[/b4]*_b[/b0]
        *_b[/b3]))*(( _b[/b0]*_b[/b3])/(_b[/b2]+_b[/b0]*_b[/b3]))(-((_b[/b5]+_b[/b4]*(_b[/b5]
        +_b[/b0]*_b[/b3]+_b[/b2]))+ (_b[/b2] *_b[/b1])*(1-_b[/b0])) / (_b[/b5]+_b[/b2]+_b[/b4]*_b[/b0]
        *_b[/b3]))*(( _b[/b0]*_b[/b3])/(_b[/b2]+_b[/b0]*_b[/b3]))
        (((_b[/r]+_b[/ß]*(_b[/r]+_b[/s]*_b[/T1µ]+_b[/d]))+ (_b[/d] *_b[/t])*(1-_b[/s])) /(_b[/r]+_b[/d]+_b[/ß]*_b[/s]*_b[/T1µ]))*(( _b[/s]*_b[/T1µ])/(_b[/d]+_b[/s]*_b[/T1µ]))
        (-((_b[/r]+_b[/ß]*(_b[/r]+_b[/s]*_b[/T1µ]+_b[/d]))+ (_b[/d] *_b[/t])*(1-_b[/s])) / (_b[/r]+_b[/d]+_b[/ß]*_b[/s]*_b[/T1µ]))*(( _b[/s]*_b[/T1µ])/(_b[/d]+_b[/s]*_b[/T1µ]))
        The Result
        ------------------------------------------------------------------------------
        | Coef. Std. Err. z P>|z| [95% Conf. Interval]
        -------------+----------------------------------------------------------------
        _nl_1 | .0056013 .0003659 15.31 0.000 .0048843 .0063184
        _nl_2 | 4.648134 .3089781 15.04 0.000 4.042548 5.25372
        _nl_3 | 4.140423 .3068229 13.49 0.000 3.539061 4.741785
        _nl_4 | -4.140423 .3068229 -13.49 0.000 -4.741785 -3.539061
        _nl_5 | .31955 .00465 68.72 0.000 .3104361 .3286639
        _nl_6 | -.31955 .00465 -68.72 0.000 -.3286639 -.3104361
        _nl_7 | -.0003123 .0001464 -2.13 0.033 -.0005992 -.0000254
        _nl_8 | .162239 .0041954 38.67 0.000 .1540162 .1704618
        _nl_9 | -.162239 .0041954 -38.67 0.000 -.1704618 -.1540162
        _nl_10 | -8.429482 2.243205 -3.76 0.000 -12.82608 -4.032882
        _nl_11 | .064887 .0159501 4.07 0.000 .0336254 .0961486
        _nl_12 | -.064887 .0159501 -4.07 0.000 -.0961486 -.0336254
        ------------------------------------------------------------------------------

        Thank U
        Attached Files

        Comment

        Working...
        X