Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Separability Restrictions Nlsur Quaids


From   Jorge Eduardo Pérez Pérez <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Separability Restrictions Nlsur Quaids
Date   Sat, 23 Nov 2013 11:44:45 -0500

Hello Guilherme.

I found two mistakes in your restricted model code:

- As stated before, you were defining the parameters g17, g27, g37,
g47 and g57 twice in the code. You have to define them only once. I
commented out the unnecessary definitions.
- You were making calls to some parameters before defining them. For
example, in your original call, g71 is defined to be equal to g17 but
g17 is defined after g71. I changed the order of the definitions of
the parameters.

Here is the revised code for the restricted model 1 (You have to make
similar changes to restricted model 2) I was able to execute it
successfully on a subsample of your data. You may want to consider
using the coefficients of the unrestricted model as initial values for
the restricted model to speed things up, instead of using 0.1 as as
the initial value for all the coefficients.

program nlsurquaidsr
* scalar `g17' = - `g11' - `g12' - `g13' - `g14' - `g15' - `g16'


scalar `g21' = `g12'
scalar `g22' = `at'[1, 19]
scalar `g23' = `at'[1, 20]
scalar `g24' = `at'[1, 21]
scalar `g25' = `at'[1, 22]
scalar `g26' = `at'[1, 23]
* scalar `g27' = - `g21' - `g22' - `g23' - `g24' - `g25' - `g26'


scalar `g31' = `g13'
scalar `g32' = `g23'
scalar `g33' = `at'[1, 24]
scalar `g34' = `at'[1, 25]
scalar `g35' = `at'[1, 26]
scalar `g36' = `at'[1, 27]
* scalar `g37' = - `g31' - `g32' - `g33' - `g34' - `g35' - `g36'


scalar `g41' = `g14'
scalar `g42' = `g24'
scalar `g43' = `g34'
scalar `g44' = `at'[1, 28]
scalar `g45' = `at'[1, 29]
scalar `g46' = `at'[1, 30]
* scalar `g47' = - `g41' - `g42' - `g43' - `g44' - `g45' - `g46'


scalar `g51' = `g15'
scalar `g52' = `g25'
scalar `g53' = `g35'
scalar `g54' = `g45'
scalar `g55' = `at'[1, 31]
scalar `g56' = `at'[1, 32]
* scalar `g57' = - `g51' - `g52' - `g53' - `g54' - `g55' - `g56'


scalar `g61' = `g16'
scalar `g62' = `g26'
scalar `g63' = `g36'
scalar `g64' = `g46'
scalar `g65' = `g56'
scalar `g66' = `at'[1, 33]
scalar `g67' = - `g61' - `g62' - `g63' - `g64' - `g65' - `g66'


* tempname g17

scalar `g17' = ((`a1' + `b1')/(`a6' + `b6'))*(`g67' + `a6'*`a7') - `a1'*`a7'


* tempname g27

scalar `g27' = ((`a2' + `b2')/(`a6' + `b6'))*(`g67' + `a6'*`a7') - `a2'*`a7'


* tempname g37
scalar `g37' = ((`a3' + `b3')/(`a6' + `b6'))*(`g67' + `a6'*`a7') - `a3'*`a7'


* tempname g47

scalar `g47' = ((`a4' + `b4')/(`a6' + `b6'))*(`g67' + `a6'*`a7') - `a4'*`a7'


* tempname g57

scalar `g57' = ((`a5' + `b5')/(`a6' + `b6'))*(`g67' + `a6'*`a7') - `a5'*`a7'


scalar `g71' = `g17'
scalar `g72' = `g27'
scalar `g73' = `g37'
scalar `g74' = `g47'
scalar `g75' = `g57'
scalar `g76' = `g67'
* scalar `g77' = - `g71' - `g72' - `g73' - `g74' - `g75' - `g76'



tempname l1 l2 l3 l4 l5 l6 l7
scalar `l1' = `at'[1, 34]
scalar `l2' = `at'[1, 35]
scalar `l3' = `at'[1, 36]
scalar `l4' = `at'[1, 37]
scalar `l5' = `at'[1, 38]
scalar `l6' = `at'[1, 39]
scalar `l7' = - `l1' - `l2' - `l3' - `l4' - `l5' - `l6'


****Demográficas: urban (ri1) norte (ri2) nordeste (ri3) sudeste (ri4)
centro_oeste (ri5) anosestudo (ri6) mulherchefe (ri7) crian_adolesc
(ri8) idoso (ri9)
****Função Densidade de Probabilidade
nlsur quaidsr @ w1 w2 w3 w4 w5 w6 lnp1 lnp2 lnp3 lnp4 lnp5 lnp6 lnp7
lnexp lnpindex urban norte nordeste sudeste centro_oeste anosestudo
mulherchefe crian_adolesc idoso lnMa_est fe1 fe2 fe3 fe4 fe5 fe6 F1 F2
F3 F4 F5 F6, init(ivals) ifgnls nequations(6) param(a1 a2 a3 a4 a5 a6
b1 b2 b3 b4 b5 b6 g11 g12 g13 g14 g15 g16 g22 g23 g24 g25 g26 g33 g34
g35 g36 g44 g45 g46 g55 g56 g66 l1 l2 l3 l4 l5 l6 r11 r12 r13 r14 r15
r16 r17 r18 r19 r21 r22 r23 r24 r25 r26 r27 r28 r29 r31 r32 r33 r34
r35 r36 r37 r38 r39 r41 r42 r43 r44 r45 r46 r47 r48 r49 r51 r52 r53
r54 r55 r56 r57 r58 r59 r61 r62 r63 r64 r65 r66 r67 r68 r69 u1 u2 u3
u4 u5 u6 d1 d2 d3 d4 d5 d6)

Hope this helps,

--------------------------------------------
Jorge Eduardo Pérez Pérez
Graduate Student
Department of Economics
Brown University

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index