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'?
ANCOVA - planned contrast tests codeHello. I fit the following ANCOVA model and want to conduct some planned contrasts tests within fac…
sparklines (or similar) with varying y-axis values by caseHello. I wish to graph the within-state (US states) variation of a performance measure over time for…
Help with specifying a multi-line localDear All, This should be straightforward, but I am really struggling with specifying a multiple line…
Interpreting regression results if some clusters are not treatedI am a bit confused about how to interpret the regression results in the following scenario: I comp…
Data format reshapeDear Statalists, I have one simple question. At the moment, I am dealing with the data which is rel…
Subscribe to:
Post Comments (Atom)
0 Response to matching variables in the varlist with parameters is needed in 'ln'?
Post a Comment