代码拉取完成,页面将自动刷新
*! Version 3.0
*revised at 2017-5-17
*revised at 2017-6-2
*30Jun 2017
capture program drop scheckmerge
program define scheckmerge, eclass prop(xt)
version 12.1
syntax varname, ///
club(varname) kq(numlist max=1) [ MDiv NOMata]
local cmdline `0'
//qui xtset
//local id `r(panelvar)'
//local time `r(timevar)'
qui tab `club', nofreq
local nclub=r(r)-1
//disp "logtreg`stata'"
tempname beta tvalue
mat `beta'=J(1,`nclub',.)
mat `tvalue'=J(1,`nclub',.)
//dis _n
forvalues j=1/`nclub' {
local i=`j'+1
local cnames `cnames' " Club`j'+`i'"
disp _n
//disp _s(10) as green "The log t test for " as red "Club `j'+`i'"
disp _s(10) as green "The log t test for " " Club `j'+`i'"
logtreg `varlist' if `club'==`i' | `club'==`j',kq(`kq') `nomata'
disp "------------------------------------------------------"
//local b=e(beta)
//local tval=e(tstat)
mat `beta'[1,`j']=e(beta)
mat `tvalue'[1,`j']=e(tstat)
}
qui count if missing(`club')
if ("`mdiv'"!="" & r(N)>0){
local j=`i'+1
local cnames `cnames' "Club`i'+Group `j'"
//disp _s(6) as green "The log t test for " as red "Club `i' + Group `j'"
disp _s(6) as green "The log t test for " " Club `i' + Group `j'"
logtreg `varlist' if `club'==`i' | missing(`club'), kq(`kq') `nomata'
disp "------------------------------------------------------"
//local b=e(beta)
//local tval=e(tstat)
mat `beta'=(`beta',e(beta))
mat `tvalue'=(`tvalue',e(tstat))
}
mat colnames `beta' = `cnames'
mat rownames `beta' = "Coeff"
mat colnames `tvalue' = `cnames'
mat rownames `tvalue' = "T-stat"
ereturn matrix bm=`beta'
ereturn matrix tm=`tvalue'
ereturn local cmd="scheckmerge"
ereturn local varlist `varlist'
ereturn local cmdline scheckmerge `cmdline'
end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。