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'?
 Original data source for colon.dta in strsHello! everyone,
I use "colon.dta" in strs to estimate relative survival in my job, but the difficu… Original data source for colon.dta in strsHello! everyone,
I use "colon.dta" in strs to estimate relative survival in my job, but the difficu…
 How to generate count/ average no. of personi want to generate count of activity/average no. person.
… How to generate count/ average no. of personi want to generate count of activity/average no. person.
…
 Spatial shocks: when is collinearity too much?Hi,
I am working with a municipality-level dataset. I am analysing the effect of immigration shocks… Spatial shocks: when is collinearity too much?Hi,
I am working with a municipality-level dataset. I am analysing the effect of immigration shocks…
 Trouble with stata outputs: graphing multiple catvars in a stacked bar format in stata, help with using Floatplot
I’m not a data scientist so my jargon is going to be really off here but let me try to break this d… Trouble with stata outputs: graphing multiple catvars in a stacked bar format in stata, help with using Floatplot
I’m not a data scientist so my jargon is going to be really off here but let me try to break this d…
 Major concern about xtdidregress after checkingDear all Statalist, I am concerning the syntax for checking did released by Stata called xtdidregres… Major concern about xtdidregress after checkingDear all Statalist, I am concerning the syntax for checking did released by Stata called xtdidregres…
Subscribe to:
Post Comments (Atom)
0 Response to matching variables in the varlist with parameters is needed in 'ln'?
Post a Comment