📄 stcox.dlg
字号:
/*
stcox
*! VERSION 1.1.4 21mar2005
*/
VERSION 9.0
INCLUDE _std_large
INCLUDE _ht320
INCLUDE header
HELP hlp1, view("help stcox")
RESET res1
DIALOG main, label("stcox - Fit Cox proportional hazards model") ///
tabtitle("Model")
BEGIN
DEFINE _x _xsetbu
DEFINE _y _top
INCLUDE _bu_stset
TEXT tx_iv _lft _topph _comb4_3 ., /*
*/ label("Independent variables:") /*
*/
VARLIST vl_iv _lft _ss _iwd ., /*
*/ label("Independent variables") /*
*/
CHECKBOX ck_est @ _ms @ ., /*
*/ label("Fit model without covariates") /*
*/ option("estimate") /*
*/ onclickon(main.vl_iv.disable) /*
*/ onclickoff(main.vl_iv.enable)
GROUPBOX gb_output _lft _ls _cwd1 _ht15, /*
*/ label("Options") /*
*/
DEFINE y @y
TEXT tx_strata _ilft _ss _inwd ., /*
*/ label("Strata ID variables:") /*
*/
VARLIST vn_strata @ _ss @ ., /*
*/ label("Strata ID variables") /*
*/ option("strata") /*
*/
TEXT tx_shared @ _ls _cwd3 ., /*
*/ label("Shared frailty ID variable:") /*
*/
VARNAME vn_shared @ _ss _vnwd ., /*
*/ label("Shared frailty ID variable") /*
*/ option("shared") /*
*/
TEXT tx_offset _ilft _ls _cwd3 ., /*
*/ label("Offset variable:") /*
*/
VARNAME vn_offset @ _ss _vnwd ., /*
*/ label("Offset variable") /*
*/ option("offset") /*
*/
GROUPBOX gb_tied _lft2 y _cwd1 _ht15, /*
*/ label("Method to handle tied failures") /*
*/
RADIO rb_breslow _indent _ls _cwd3 ., /*
*/ label("Breslow") /*
*/ clickon("program exact_off") /*
*/ first /*
*/ option("NONE") /*
*/
DEFINE y @y
RADIO rb_efron @ _ss @ ., /*
*/ label("Efron") /*
*/ clickon("program exact_off") /*
*/ option("efron") /*
*/
RADIO rb_exactm @ _ss @ ., /*
*/ label("Exact marginal likelihood") /*
*/ clickon("program exact_on") /*
*/ option("exactm") /*
*/
RADIO rb_exactp @ _ss @ ., /*
*/ label("Exact partial likelihood") /*
*/ clickon("program exact_on") /*
*/ last /*
*/ option("exactp") /*
*/
END
PROGRAM exact_on
BEGIN
if stcox_robust {
call script se_setClRobust_off
call stcox_robust.setfalse
}
call script exacton
END
SCRIPT exacton
BEGIN
tv.ck_tvc.disable
script tvc_off
rpt2.tx_sch.disable
rpt2.ed_sch.disable
rpt2.tx_sca.disable
rpt2.ed_sca.disable
END
PROGRAM exact_off
BEGIN
if !stcox_robust {
call script se_setClRobust_on
call stcox_robust.settrue
}
call script exactoff
if tv.ck_tvc {
call script tvc_on
}
END
SCRIPT exactoff
BEGIN
tv.ck_tvc.enable
rpt2.tx_sch.enable
rpt2.ed_sch.enable
rpt2.tx_sca.enable
rpt2.ed_sca.enable
END
DIALOG tv, tabtitle("Time varying")
BEGIN
CHECKBOX ck_tvc _lft _top _iwd _ht8, /*
*/ label("Time-varying covariates") /*
*/ clickon("script tvc_on") /*
*/ clickoff("script tvc_off") /*
*/ groupbox /*
*/
VARLIST vl_tvc _indent _ms _ibwd ., /*
*/ label("Time-varying covariates") /*
*/ option("tvc") /*
*/
TEXT tx_texp @ _ls @ ., /*
*/ label("Multiplier for time-varying covariates: (default: _t)") /*
*/
EDIT ed_texp @ _ss @ ., /*
*/ label("Multiplier for time-varying covariates") /*
*/ option("texp") /*
*/ default(_t) /*
*/
END
INCLUDE byifin
INCLUDE se
SCRIPT PREINIT
BEGIN
script se_createAsInternalML
script se_setNoAdjust_on
create BOOLEAN stcox_robust
END
DIALOG rpt, tabtitle("Reporting")
BEGIN
DEFINE _x _lft
DEFINE _cx _spr2b
DEFINE _y _top
INCLUDE _sp_level
CHECKBOX ck_nohr _lft _ls _cwd0 ., /*
*/ label("Report coefficients, not hazard ratios") /*
*/ option("nohr") /*
*/
CHECKBOX ck_noshow @ _ms @ ., /*
*/ label("Do not show st setting information") /*
*/ option("noshow") /*
*/
END
SCRIPT tvc_on
BEGIN
tv.vl_tvc.enable
tv.tx_texp.enable
tv.ed_texp.enable
END
SCRIPT tvc_off
BEGIN
tv.vl_tvc.disable
tv.tx_texp.disable
tv.ed_texp.disable
END
DIALOG rpt2, tabtitle("Reporting 2")
BEGIN
GROUPBOX gb_name _lft _top _iwd _ht27, /*
*/ label("Generate new variables") /*
*/
TEXT tx_mgale _ilft _ss _cwd1 ., /*
*/ label("Partial martingale residuals:") /*
*/
DEFINE y @y
EDIT ed_mgale @ _ss _vnwd ., /*
*/ label("Partial martingale residuals") /*
*/ max(32) /*
*/ option("mgale") /*
*/
TEXT tx_basehc @ _ms _cwd1 ., /*
*/ label("Baseline hazard contributions:") /*
*/
EDIT ed_basehc @ _ss _vnwd ., /*
*/ label("Baseline hazard contributions") /*
*/ max(32) /*
*/ option("basehc") /*
*/
TEXT tx_basehz _lft2 y _cwd2 ., /*
*/ label("Cumulative baseline hazard:") /*
*/
EDIT ed_basehz @ _ss _vnwd ., /*
*/ label("Cumulative baseline hazard") /*
*/ max(32) /*
*/ option("basechazard") /*
*/
TEXT tx_basesv @ _ms _cwd2 ., /*
*/ label("Baseline survival function:") /*
*/
EDIT ed_basesv @ _ss _vnwd ., /*
*/ label("Baseline survival function") /*
*/ max(32) /*
*/ option("basesurv") /*
*/
TEXT tx_effect _ilft _ms _cwd1 ., /*
*/ label("Estimated log-frailties:") /*
*/
EDIT ed_effect @ _ss _vnwd ., /*
*/ label("Estimated log-frailties") /*
*/ max(32) /*
*/ option("effects") /*
*/
TEXT tx_esr _ilft _ms _ibwd ., /*
*/ label("Partial efficient score residuals: (e.g. esr*)") /*
*/
EDIT ed_esr @ _ss @ ., /*
*/ label("Partial efficient score residuals") /*
*/ option("esr") /*
*/
TEXT tx_sch @ _ms @ ., /*
*/ label("Schoenfeld residuals: (e.g. sch*)") /*
*/
EDIT ed_sch @ _ss @ ., /*
*/ label("Schoenfeld residuals") /*
*/ option("schoenfeld") /*
*/
TEXT tx_sca @ _ms @ ., /*
*/ label("Scaled Schoenfeld residuals: (e.g. sca*)") /*
*/
EDIT ed_sca @ _ss @ ., /*
*/ label("Scaled Schoenfeld residuals") /*
*/ option("scaledsch") /*
*/
END
INCLUDE max_internal
PROGRAM command
BEGIN
allowxi
INCLUDE _by_pr
put "stcox "
varlist [main.vl_iv]
INCLUDE _ifin_pr
beginoptions
optionarg main.vn_strata
if tv.ck_tvc {
require tv.vl_tvc
optionarg tv.vl_tvc
optionarg tv.ed_texp
}
put " " /program se_output
optionarg main.vn_shared
/* not doing frailty(gamma) because implied by shared() */
option radio(main rb_breslow rb_efron rb_exactm rb_exactp)
option main.ck_est
optionarg main.vn_offset
optionarg /hidedefault rpt.sp_level
option rpt.ck_nohr
option rpt.ck_noshow
optionarg rpt2.ed_mgale
optionarg rpt2.ed_esr
optionarg rpt2.ed_sch
optionarg rpt2.ed_sca
optionarg rpt2.ed_basehc
optionarg rpt2.ed_basehz
optionarg rpt2.ed_basesv
optionarg rpt2.ed_effect
put " " /program max_output
endoptions
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -