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
Related Posts with nlsur aids returned 198
How do I save the mean as well as the confidence interval results from bootstrap in every interation and plot it in a graph? I want to save the mean value as well as the confidence interval in every iteration and plot it in …
DiD for binary outcomesHow to run the difference in difference estimates for binary outcomes? …
Proper model for highly skewed dependent variable.Hello, I had previously asked a similar question, but it was partly unanswered, so I'm narrowing do…
How to pairwise t-test slopes of a three-way interaction?Hi, I hope you had a merry Christmas. Currently I face difficulties on how to pairwise t-test a th…
Nested logit model VS two binary logit modelsHello, I have a quick question regarding the nested logit model. I am trying to develop a model as …
Subscribe to:
Post Comments (Atom)
0 Response to nlsur aids returned 198
Post a Comment