代码拉取完成,页面将自动刷新
同步操作将从 连享会/chowtest 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
*! version 2011-August-23, Q.wang@yahoo.cn
cap program drop chowtest
program define chowtest, rclass
version 11.2
syntax varlist(ts fv) [if] [in] , Group(varname) [ Restrict(varlist ts fv) Het Detail ]
marksample touse
markout `touse' `restrict'
gettoken dep indeps : varlist
if "`detail'"=="" local qui = "qui"
if ("`het'"!="") {
qui reg `varlist' `restrict' i.`group' i.`group'#c.(`indeps')
}
else {
`qui' reg `varlist' `restrict' i.`group' i.`group'#c.(`indeps')
}
local n = e(N)
local k = e(rank)
qui levelsof `group' if `touse', local(id)
if ("`het'"!="") {
tempvar u v usq
qui predict `u' if `touse', res
qui gen `usq' = `u'^2 if `touse'
qui gen `v' = .
foreach i of numlist `id' {
qui summ `usq' if (`group'==`i' & `touse')
local s = r(sum)
qui replace `v' = `s'/(`n'-`k') if (`group'==`i' & `touse')
}
`qui' reg `varlist' `restrict' i.`group' i.`group'#c.(`indeps') [aw=1/`v']
}
gettoken base ido: id
`qui' testparm i(`ido').`group' i(`ido').`group'#c.(`indeps')
local chow = r(F)
local chowp= r(p)
local df1 = r(df)
local df2 = r(df_r)
dis _n in g "Chow's Structural Change Test:"
di as txt _col(3) "{bf:Ho: no Structural Change}"
di as txt _col(3) "Chow Test = " as res %6.2f `chow' _c
di _skip(8) as txt "P-Value > F(" `df1' " , " `df2' ") = " as res %5.4f `chowp'
return scalar chow = r(F)
ret scalar chowp= r(p)
end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。