stata门限回归(门板回归)代码解读

门限回归(门板回归)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, threshvar(Z1) nthresholds(1)

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

  • 6
    点赞
  • 53
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值