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'?
Cumulative incidence proportions by covariateHi Stata forum, I would like to estimate the cumulative incidence proportions with a competing risk …
Strings. Selecting the first occurrence of specific words in a string then ordering the selected words in a consistent way.Hello Statalist I have a data set with a variable haart1 (combination antiretroviral) as shown below…
Destring and generate hundreds of variables with an underscore in the nameHi I have a question on how to destring and generate hundreds of variables that have a similar name…
Matched pair identifierDear Statalisters, I have a dataset which matches romantic partners in the following way: Code: c…
Structural Break Tests with an unknown date - Ambiguous information given in STATA output.Hello, I am running a structural break test with an unknown data (command in STATA: estat sbsingle)…
Subscribe to:
Post Comments (Atom)
0 Response to matching variables in the varlist with parameters is needed in 'ln'?
Post a Comment