Hello sir, I am doing MLE estimation experimental data, and putting programs for the estimation. it is showing the error "too few variables specified". this problem I can not able to solve myself. I request you to please let me know the problem in the estimation.
*define procpect theory considering Holt Laury experimental model
*define program name
program define HL_cpt0
*specify the argument of the program
args lnf alpha gamma
*declare the temporary variables to be use in the model
tempvar choices prob1l prob2l prob1r prob2r y1 y2 y3 y4 euL euR euDiff
quietly {
*define probability weighting
gen double `tmp' = (($ML_y2^`gamma')+((1-$ML_y2)^`gamma'))
replace `tmp' = `tmp'^(1/`gamma')
generate double `prob1l' = ($ML_y2^`gamma')/`tmp'
generate double `prob2l' = (1-$ML_y2^`gamma')/`tmp'
replace `tmp' = (($ML_y3^`gamma')+((1-$ML_y3)^`gamma'))
replace `tmp' = `tmp'^(1/`gamma')
generate double `prob1r' = ($ML_y3^`gamma')/`tmp'
generate double `prob2r' = ((1-$ML_y3)^(`gamma'))/`tmp'
*define utility function
generate double `y1' = ( $ML_y4)^(1-`alpha') if $ML_y4>=0
generate double `y2' = ( $ML_y5)^(1-`alpha') if $ML_y5>=0
generate double `y3' = ( $ML_y6)^(1-`alpha') if $ML_y6>=0
generate double `y4' = ( $ML_y5)^(1-`alpha') if $ML_y5>=0
*generate Expected Utility
gen double `euL'=(`prob1l'*`y1')+(`prob2l'*`y2') if `y1'>=`y2'>=0
gen double `euR'=(`prob1r'*`y3')+(1-`prob2r'*`y4') if `y3'=<0=<`y4'
*get the Fechner index
generate double `euDiff' = `euR' - `euL'
*likelihood function
replace `lnf' = ln(normal( `euDiff')) if $ML_y1==1
replace `lnf' = ln(normal(-`euDiff')) if $ML_y1==0
}
end
ml model lf HL_cpt0 (alpha: choices prob1l prob2l prob1r prob2r prize0 prize1 prize2 prize3= )(gamma: ), cluster(id) technique(nr) maximize
ml display
Related Posts with Error in MLE "too few variables specified"
Finding a target variabel across datasets in the same directory*Hi, I've several datasets in the directory, and want to know which ones contain my variable of inter…
How to use the foreach code with multiple varlists.Hello Statalister's Im using Stata 12.1, my dataset has around 50000 participants, each participant…
estpost with xtsumHi all I have used the command estpost sum esttab using nsw_12_summary_all.csv, cells("mean") to …
How to draw bivariate random vector (v,u) which is bivariate normal, but with a correlation which depends on a third variable x?Dear all, I would like to simulate some data: a bivariate random vector (v,u) which is bivariate no…
Fixed effects model with high rho and negative corr(u_i, Xb): a problem?I'm running some regression models with panel data from Brazilian municipalities (N = 64,708, Number…
Subscribe to:
Post Comments (Atom)
0 Response to Error in MLE "too few variables specified"
Post a Comment