📄 svy_tabulate_oneway.dlg
字号:
/*
svy: tabulate oneway
*! VERSION 1.1.3 31mar2005
keyword: eclass
*/
VERSION 9.0
INCLUDE _std_large
INCLUDE _ht320
INCLUDE header
HELP hlp1, view("help svy: tabulate oneway")
RESET res1
DIALOG main, tabtitle("Model") ///
label("svy: tabulate - One-way tables for survey data")
BEGIN
TEXT tx_var _lft _top _cwd3_1 ., ///
label("Categorical variable:")
VARNAME vn_var _lft _ss _vnwd ., ///
label("Categorical variable")
CHECKBOX ck_stdize _lft _xls _iwd _ht4, ///
groupbox ///
clickon(script stdize_on) ///
clickoff(script stdize_off) ///
label("Direct standardization")
TEXT tx_stdize _ilft _ss 150 ., ///
label("Standard strata variable:")
TEXT tx_stdwgt +165 @ @ ., ///
label("Standard weight variable:")
VARNAME vn_stdize _ilft _ss @ ., ///
label("Standard strata variable") ///
option(stdize)
VARNAME vn_stdwgt +165 @ @ ., ///
label("Standard weight variable") ///
option(stdweight)
GROUPBOX gb_opts _lft _xls _iwd _ht7h, ///
label("Options")
TEXT tx_tab _ilft _ss _cwd1 ., ///
label("Use cell totals/proportions of:")
VARNAME vn_tab @ _ss _vnwd ., ///
label("Totals/proportions variable") ///
option(tab)
CHECKBOX ck_miss @ _ls _ibwd ., ///
label("Treat missing values like other values") ///
option(miss)
DEFINE _x _xsetbu
DEFINE _y 290
INCLUDE _bu_svyset
END
SCRIPT stdize_on
BEGIN
main.tx_stdize.enable
main.tx_stdwgt.enable
main.vn_stdize.enable
main.vn_stdwgt.enable
items.ck_deff.disable
items.ck_deft.disable
items.ck_srssub.disable
END
SCRIPT stdize_off
BEGIN
main.tx_stdize.disable
main.tx_stdwgt.disable
main.vn_stdize.disable
main.vn_stdwgt.disable
items.ck_deff.enable
items.ck_deft.enable
items.ck_srssub.enable
END
PROGRAM stdize_output
BEGIN
if main.ck_stdize {
require main.vn_stdize
require main.vn_stdwgt
optionarg main.vn_stdize
optionarg main.vn_stdwgt
}
END
INCLUDE svy_subpop_model
INCLUDE svy_se
DIALOG items, label("") tabtitle("Table items")
BEGIN
CHECKBOX ck_cell _lft _top _iwd ., ///
label("Cell proportions") ///
option(cell)
CHECKBOX ck_count @ _ms @ ., ///
label("Weighted cell counts") ///
option(count)
CHECKBOX ck_se @ _ms @ ., ///
label("Standard errors") ///
option(se)
CHECKBOX ck_ci @ _ms @ ., ///
label("Confidence intervals") ///
option(ci)
CHECKBOX ck_deff @ _ms @ ., ///
label("Display the DEFF design effects") ///
option(deff)
CHECKBOX ck_deft @ _ms @ ., ///
label("Display the DEFT design effects") ///
option(deft)
CHECKBOX ck_srssub @ _ms @ ., ///
label("Report design effects assuming SRS within subpopulation") ///
option(srssubpop)
CHECKBOX ck_obs @ _ms @ ., ///
label("Cell observations") ///
option(obs)
END
DIALOG rpt, label("") tabtitle("Reporting")
BEGIN
DEFINE _x _lft
DEFINE _cx _spr2
DEFINE _y _top
INCLUDE _sp_level
CHECKBOX ck_percent _lft _ls _ibwd ., ///
label("Display percentages instead of proportions") ///
option(percent)
CHECKBOX ck_nomarg _lft _ms @ ., ///
label("Suppress column marginal") ///
option(nomarginal)
CHECKBOX ck_nolab _lft _ms @ ., ///
label("Suppress displaying value labels") ///
option(nolabel)
CHECKBOX ck_format _lft _ms _ckwd ., ///
onclickon(rpt.ed_format.enable) ///
onclickoff(rpt.ed_format.disable)
EDIT ed_format _cksep @ _spwd ., ///
option(format) ///
default("%6.0g") ///
label("Display format")
BUTTON bn_format _spsep @ 100 ., ///
label("Help format...") ///
onpush(view help format##|_new)
CHECKBOX ck_cellw _lft _ms _ckwd ., ///
onclickon(gaction rpt.sp_cellw.enable) ///
onclickoff(gaction rpt.sp_cellw.disable)
SPINNER sp_cellw _cksep @ _spwd ., ///
label("Cell width") ///
min(4) ///
max(20) ///
default(4) ///
option(cellwidth)
TEXT tx_cellw _spsep @ _ckspr2b ., ///
label("Cell width")
CHECKBOX ck_csepw _lft _ms _ckwd ., ///
onclickon(gaction rpt.sp_csepw.enable) ///
onclickoff(gaction rpt.sp_csepw.disable)
SPINNER sp_csepw _cksep @ _spwd ., ///
label("Cell separation width") ///
min(1) ///
max(10) ///
default(1) ///
option(csepwidth)
TEXT tx_csepw _spsep @ _ckspr2b ., ///
label("Cell separation width")
CHECKBOX ck_stubw _lft _ms _ckwd ., ///
onclickon(gaction rpt.sp_stubw.enable) ///
onclickoff(gaction rpt.sp_stubw.disable)
SPINNER sp_stubw _cksep @ _spwd ., ///
label("Stub width") ///
min(4) ///
max(40) ///
default(4) ///
option(stubwidth)
TEXT tx_stubw _spsep @ _ckspr2b ., ///
label("Stub width")
END
PROGRAM items_output
BEGIN
if items.ck_se | items.ck_ci | items.ck_deff ///
| items.ck_deft | items.ck_srssub {
if (items.ck_cell & items.ck_count) {
stopbox stop ///
`"Only one of "Cell proportions" or "Weighted cell counts", may be chosen"' ///
`"with "Standard errors", "Confidence intervals", "DEFF", or "DEFT""'
}
}
option items.ck_cell
option items.ck_count
option items.ck_se
option items.ck_ci
option items.ck_deff
option items.ck_deft
if items.ck_srssub & !(subpop.vn_subpop | subpop.ex_subif) {
stopbox stop ///
`"On the "Table items" tab,"' ///
`""Report design effects assuming SRS within subpopulation""' ///
`"requires that a subpopulation be specified in the "if/in" tab"'
}
option items.ck_srssub
option items.ck_obs
END
PROGRAM rpt_output
BEGIN
optionarg /hidedefault rpt.sp_level
option rpt.ck_percent
option rpt.ck_nomarg
option rpt.ck_nolab
optionarg rpt.ed_format
optionarg rpt.sp_cellw
optionarg rpt.sp_csepw
optionarg rpt.sp_stubw
END
PROGRAM svy_options
BEGIN
beginoptions
put " " /program svy_subpop_output
put " " /program svy_se_output
endoptions
END
PROGRAM command
BEGIN
put "svy"
put /program svy_options
put ": tabulate "
varlist main.vn_var
if subpop.ck_ifin {
put " " /program ifin_output
}
beginoptions
put " " /program stdize_output
optionarg main.vn_tab
option main.ck_miss
put " " /program items_output
put " " /program rpt_output
endoptions
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -