I want to estimate equation below with 'ln' command and the program.
But it returns error message 198 or 197 again and again.
I don't know how can I debug them.
Equation
lnwage=
beta0 + beta1(1-delta1)exp_prox(edu_year+gamma1*edu_year2) + beta2( (1-(1-delta2)exp_prox)/delta2)(alpha1+(alpha1/(65-gradu_age))((1-delta2)/delta2)-alpha2*exp_prox)/(65-gradu_age)delta2)
Code for program
program nldep
version 13
syntax varlist(min=5 max=5) if, at(name)
local lnwage : word 1 of 'varlist'
local exp_prox : word 2 of 'varlist'
local edu_year : word 3 of 'varlist'
local edu_year_sq : word 4 of 'varlist'
local gradu_age : word 5 of 'varlist'
//Retrieve parameters out of at
tempname beta0 beta1 delta1 gamma1 beta2 delta2 alpha1
scalar 'beta0' = 'at'[1,1]
scalar 'beta1' = 'at'[1,3]
scalar 'delta1' = 'at'[1,3]
scalar 'gamma1' = 'at'[1,4]
scalar 'beta2' = 'at'[1,2]
scalar 'delta2' = 'at'[1,2]
scalar 'alpha1' = 'at'[1,5]
//Some temporary variables
tempvar Eduterm Expterm
generate double 'Eduterm' = 'beta1'((1-'delta1')^'exp_prox')*('edu_year'+'gamma1'*'edu_ye ar_sq') 'if'
generate double 'Expterm' = 'beta2'(((1-(1-'delta2')^'exp_prox')/'delta2')*('alpha1'+('alpha1'/(65-'gradu_age'))*((1-'delta2')/'delta2')-'alpha1'*'exp_prox'/(65-'gradu_age')*'delta2') 'if'
//Now fill in dependent variable
replace 'lnwage'='beta0'+'Eduterm'+'Expterm' 'if'
end
Code for command
nl dep @ lnwage exp_prox edu_year edu_year_sq gradu_age, parameters(beta0 beta1 delta1 gamma1 beta2 delta2 alpha1) ///
initial(beta1 0.5 delta1 0.5 gamma1 0.5 beta2 0.5 delta2 0.5 alpha1 0.5)
I think my variables are defined well.
And I didn't miss any variables or parameters in the command.
The only suspicious part is matching. I mean other examples or equations in FAQ,
have sequential matching between variables and parameters.
But I think this cannot be a problem because 'ln' in STATA doesn't restrict this kind of matching concept.
Could you please help me to solve this problem? Thanks.
Related Posts with matching variables in the varlist with parameters is needed in 'ln'?
What does -teffects ipwra- actually do?Dear Statalist I am trying to figure out to understand what -teffects ipwra- actually does. I unde…
Testing difference between BLUPS after mixedDear Statalisters, I'm running a two-level empty mixed model, with levels individuals, city and st…
Estimate impact of a dummy variable in term of other variablesHello, I estimated utility from going to school conditional on some variables including a dummy var…
Creating variable from searching multiple stringsHi there - probably an easy question for most of you, but I'm new to STATA and can't find the answer…
Intraday Data (1 Minute data)Hello, I appreciate if you could help me on formatting 1-minute data. I have datetime variable as “2…
Subscribe to:
Post Comments (Atom)
0 Response to matching variables in the varlist with parameters is needed in 'ln'?
Post a Comment