<>门限回归(门板回归)Stata 代码解读

因变量:Y
自变量: X1, X2, X3, X4, X5, Z1
其中门限变量为:Z1

threshold 函数

*
基础格式:threshold depvar [indepvars] [if] [in], threshvar(varname) [, options]

*
解读
depvar: 被解释变量
indepvars:解释变量(包含门限变量)
if :条件
in :范围「in a/b:从a开始到b结束的范围内进行」
threshvar(varname):门限变量
options:需要就写,不写按默认值运行;options与前面的变量间注意需要加逗号“,”
其中 options 有:
—————————————————————————————————————
regionvars(varlist) include region-varying coefficients for specified
covariates
consinvariant replace region-varying constant with a region-invariant constant
用区域可变常数替换区域不变常数
noconstant suppress region-varying constant terms 抑制区域变化的常数项
trim(#) trimming percentage; default is trim(10) 调整比例
nthresholds(#) number of thresholds; default is nthresholds(1); not allowed
with optthresh();门槛数设定,未设定时默认为1个门槛
optthresh(#[, ictype]) select optimal number of thresholds less than or equal
to #; not allowed with nthresholds() 选择小于或等于#的最佳阈值数量; 不允许使用nthresholds()
—————————————————————————————————————

*
例1.1:1 门槛-普通门限回归
threshold Y X1 X2 X3 X4 X5 Z1, threshold(Z1) nthresholds(1)

*
例1.2:在X5为1条件下,2门槛-门限回归
threshold Y X1 X2 X3 X4 X5 Z1 if X5 == 1, threshold(Z1) nehreshold(2)

技术
今日推荐
PPT
阅读数 128
下载桌面版
GitHub
百度网盘(提取码:draw)
Gitee
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:ixiaoyang8@qq.com
QQ群:766591547
关注微信