Hello everyone,
I'm trying to estimate this system of 2 nonlinear equations through this program. When I'm running my program, STATA gives me this error message r(198).
Could anyone be so kind to help me to identify and solve my problem? Here is my program:
program nlsuraids
version 16
syntax varlist(min=11 max=11) if , at(name)
tokenize `varlist'
args lh_m lh_f yw_m lw_m lw_f ly yw_f l2w_m l2w_f D lN
tempname am0 am1 am2 af0 af1 af2
scalar `am0' = `at'[1,1]
scalar `am1' = `at'[1,2]
scalar `am2' = `at'[1,3]
scalar `af0' = 1 - `am0'
scalar `af1' = - `am1'
scalar `af2' = - `am2'
/*scalar `am0' + `am1' + `am2' = 1 - `af0' - `af1' - `af2'*/
tempname bm bf
scalar `bm' = `at'[1,4]
scalar `bf' = - `bm'
tempname gm2 gmf
tempname gfm gf2
scalar `gm2' = `at'[1,5]
scalar `gmf' = `at'[1,6]
scalar `gfm' = `gmf'
scalar `gf2' = `gmf'
quietly {
tempvar a
gen double `a' = 5 + `am'*`lw_m' + `af'*`lw_f' + 0.5*`gm2'*`l2w_m' + `gmf'*`lw_m'*`lw_f' + 0.5*`gff'*`l2w_f'
gen double `am' = `am0' + `am1'*`lN' + `am2'*`D'
gen double `af' = `af0' + `af1'*`lN' + `af2'*`D'
// Fill in the dependant variables
replace `lh_m' = (`yw_m')*(`am' + `gm2'*`lw_m' + `gmf'*`lw_f' + `bm'*`ly' - `bm'*`a')
replace `lh_f' = (`yw_f')*(`af' + `gfm'*`lw_m' + `gf2'*`lw_f' + `bf'*`ly' - `bf'*`a')
}
end
nlsur aids @ lh_m lh_f yw_m lw_m lw_f ly yw_f l2w_m l2w_f D lN, parameters (am0 am1 am2 af0 af1 af2 bm bf gm2 gmf gfm gf2) ///
initial (am0 0.64 am1 -0.04 am2 -0.03 af0 0.36 af1 0.04 af2 0.03 bm -0.84 bf 0.84 gm2 0.15 gmf 0.15 gfm 0.15 gf2 0.15) neq(2) ifgnls
0 Response to nlsur aids returned 198
Post a Comment