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

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

因变量:Y
自变量: X1, X2, X3, X4, X5
门限变量:X3

1. Stata 实现

(1) 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()
    —————————————————————————————————————

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

  • 例1.2:在Z为1条件下的门限回归
    threshold Y X1 X2 X3 X4 X5 if Z == 1, threshold(X3) nehreshold(1)

你可能感兴趣的:(统计分析,stata)