h3327156 发表于 2012-11-4 00:44 
1. 那个文件,请贴在do file editor下执行 【该文件算是有些许不完美,会有错误讯息,但不影响重要结果】
...
你计算的那个两个结果相近,是因为那个命令先是执行qreg的。
其中一段程序为
qui qreg `lhs' `dhat' `inexog' if `touse', q(`quantil')
predict iner if `touse', resid
matrix btwo=e(b)
scalar bdht=btwo[1,1]
matrix vtwo=e(V)
local vnames `endo' `inexog' _cons
matrix rownames vtwo = `vnames'
matrix colnames vtwo = `vnames'
matrix colnames btwo = `vnames'
ereturn post btwo vtwo, depname(`lhs') obs(`e(N)') esample(`touse')
ereturn display
display _newline in yellow "Grid search is in progress (200)"
marksample touse
markout `touse'
tempname intv nn nz dh_se
*但是到下面这行就出错了
mata: ivqr_initial("`lhs'", "`endo'", "`inexog'", "`instr'", "`dhat'", "iner", "`touse'")