📄 statsby.dlg
字号:
/*
statsby
*! VERSION 2.0.1 01apr2005
*/
VERSION 9.0
INCLUDE _std_large
INCLUDE header
HELP hlp1, view("help statsby")
RESET res1
DIALOG main, tabtitle("Main") ///
label("statsby - Collect statistics for a command across a by list")
BEGIN
DEFINE _y _top
INCLUDE _cmd_exp_list
TEXT tx_byopt _lft _xls _cwd1 ., ///
label("Group variables: (required)")
VARLIST vl_byopt @ _ss _vlwd ., ///
label("Group variables") option(by)
CHECKBOX ck_missing @ _ls _iwd ., ///
label("Include missing values in the group variables") ///
option(NONE)
END
DIALOG opt, tabtitle("Options")
BEGIN
RADIO rb_default _lft _top _iwd _ht8, ///
first label("Replace data if not modified") option(NONE) ///
onclickon(script opt_save_off)
DEFINE holdx @x
RADIO rb_clear @ _ss @ ., ///
option(clear) ///
label("Replace data even if modified") ///
onclickon(script opt_save_off)
RADIO rb_sav @ _ss @ ., ///
last label("Save results to file") ///
onclickon(program opt_save_on)
GROUPBOX gb_save _lft _ms _iwd _ht10, label("Save")
TEXT tx_sav _indent _ss _ibwd ., ///
label("Filename:")
FILE fi_sav @ _ss @ ., ///
label("Browse...") ///
option(saving) ///
filter("Stata Dataset (*.dta)|*.dta|All (*.*)|*.*") ///
defext(dta) ///
save ///
error("Filename to save")
CHECKBOX ck_double @ _ls _cwd2 ., ///
label("Save statistics in double precision") ///
option(double)
CHECKBOX ck_every _ilft _ms _ckwd ., ///
onclickon(script opt_every_on) ///
onclickoff(script opt_every_off)
SPINNER sp_every _cksep @ _spwd ., ///
label("save every #") ///
min(1) ///
max(10000) ///
default(1) ///
option(every)
TEXT tx_every _spsep @ _cksprb ., ///
label("Save results to file every #th replication")
CHECKBOX ck_total _lft +45 _iwd ., ///
label("Include results for the entire dataset") ///
option(total)
CHECKBOX ck_subset @ _ms @ ., ///
label("Include all combinations of subsets of groups") ///
option(subset)
CHECKBOX ck_force @ _ms @ ., ///
label("Do not check for svy commands") ///
option(force)
END
PROGRAM opt_save_on
BEGIN
call opt.gb_save.enable
call opt.fi_sav.enable
call opt.ck_double.enable
call opt.ck_every.enable
call opt.tx_every.enable
call opt.tx_sav.enable
if opt.ck_every {
call opt.sp_every.enable
}
END
SCRIPT opt_save_off
BEGIN
opt.gb_save.disable
opt.fi_sav.disable
opt.ck_double.disable
opt.sp_every.disable
opt.tx_every.disable
opt.ck_every.disable
opt.tx_sav.disable
END
SCRIPT opt_every_on
BEGIN
opt.sp_every.enable
END
SCRIPT opt_every_off
BEGIN
opt.sp_every.disable
END
DIALOG report, tabtitle("Reporting")
BEGIN
DEFINE _x _lft
DEFINE _cx _iwd
DEFINE _y _top
DEFINE _cy _ht8
INCLUDE _output_reps
CHECKBOX ck_nolegend _lft _xls _iwd ., ///
label("Suppress the table legend") ///
onclickon(program check_legend) ///
onclickoff(program check_legend) ///
option(nolegend)
CHECKBOX ck_verbose @ _ms @ ., ///
label("Display the full table legend") option(verbose)
END
PROGRAM check_legend
BEGIN
if report.ck_nolegend {
call gaction report.ck_verbose.disable
}
if !report.ck_nolegend {
call gaction report.ck_verbose.enable
}
END
PROGRAM statsby_by_options
BEGIN
varlist main.vl_byopt
END
PROGRAM statsby_options
BEGIN
put "statsby "
option main.ck_b
option main.ck_se
put " " main.ed_explst
beginoptions
put "by("
put /program statsby_by_options
if main.ck_missing {
put ", missing"
}
put ") "
option opt.rb_clear
if opt.rb_sav {
require opt.fi_sav
repfile opt.fi_sav
put `"saving("'
put opt.fi_sav
put `", "'
optionarg opt.sp_every
option opt.ck_double
put "replace)"
}
if opt.rb_default {
stopbox rusure "This command will replace your data in memory." ///
"Do you wish to continue?"
put " clear"
}
option opt.ck_total
option opt.ck_subset
option opt.ck_force
option radio(report rb_qui rb_dots rb_noi rb_trace)
option report.ck_nolegend
option report.ck_verbose
endoptions
END
PROGRAM command
BEGIN
require main.vl_cmd
put /program statsby_options
put " " " : " /* end of prefix, begin command */
put main.vl_cmd
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -