⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sampsi.dlg

📁 是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到
💻 DLG
📖 第 1 页 / 共 2 页
字号:
/*
 	sampsi

*! VERSION 1.0.1  13nov2004

*/

VERSION 8.0

INCLUDE _std_large
INCLUDE _ht310
INCLUDE header

HELP hlp1, view("help sampsi")
RESET res1

DEFINE _lft4_2   180
DEFINE _lft4_3   290
DEFINE _kindent  +65
DEFINE _kindent2 +30

DIALOG main, label("sampsi - Sample size and power determination") 	/*
		*/ tabtitle("Main")
BEGIN
  GROUPBOX gb_input       _lft        _top       _iwd  _ht24h,		/*
		*/ label("Input")
  RADIO    rb_mean2    _indent         _ss      _inwd       .,		/*
		*/ first						/*
		*/ clickon(program mean2_enable)			/*
		*/ label("Two-sample comparison of means:")
  DEFINE   _x @x
  DEFINE   _cx @cx
  TEXT     tx_mean2_1 _kindent         _ss    _cwd4_5       .,		/*
		*/ right						/*
		*/ label("Mean one:")
  DEFINE   _x2 @x
  EDIT     en_mean2_1  _lft4_2           @     _en7wd       .,		/*
		*/ numonly						/*
		*/ label("Mean one")
  TEXT     tx_mean2_2  _lft4_3           @    _cwd4_5       .,		/*
		*/ right						/*
		*/ label("Mean two:")
  EDIT     en_mean2_2  _lft4_4           @     _en7wd       .,		/*
		*/ numonly						/*
		*/ label("Mean two")
  TEXT     tx_goto1         _x           @          0    _ht0,		/*
		*/ label("")
  TEXT     tx_sd1_2  _kindent2         _ms    _cwd3_5       .,		/*
		*/ right 						/*
		*/ label("Std. deviation one:")
  EDIT     en_sd1_2    _lft4_2           @     _en7wd       .,   	/*
		*/ option("sd1")					/*
		*/ numonly default("1") 				/*
		*/ label("Std. deviation one")
  TEXT     tx_sd2          +75           @    _cwd3_5       .,		/*
		*/ right 						/*
		*/ label("Std. deviation two:")
  EDIT     en_sd2      _lft4_4           @     _en7wd       .,   	/*
		*/ option("sd2")					/*
		*/ numonly 						/*
		*/ default("1")						/*
		*/ label("Std. deviation two")
  RADIO    rb_mean1         _x         _ls        _cx       .,		/*
		*/ clickon(program mean1_enable)			/*
		*/ label("One-sample comparison of mean to hypothesized value:")
  TEXT     tx_mean1_1 _kindent         _ss    _cwd4_5       .,		/*
		*/ right						/*
		*/ label("Hypothesized:")
  EDIT     en_mean1_1  _lft4_2           @     _en7wd       .,		/*
		*/ numonly						/*
		*/ label("Hypothesized mean")
  TEXT     tx_mean1_2  _lft4_3           @    _cwd4_5       .,		/*
		*/ right						/*
		*/ label("Postulated:")
  EDIT     en_mean1_2  _lft4_4           @     _en7wd       .,		/*
		*/ numonly						/*
		*/ label("Postulated mean")
  TEXT     tx_goto2         _x           @          0    _ht0,		/*
		*/ label("")
  TEXT     tx_sd1_1  _kindent2         _ms    _cwd3_5       .,		/*
		*/ right 						/*
		*/ label("Std. deviation one:")
  EDIT     en_sd1_1    _lft4_2           @     _en7wd       .,   	/*
		*/ option("sd1")					/*
		*/ numonly default("1") 				/*
		*/ label("Std. deviation one")
  RADIO    rb_prop2         _x         _ls        _cx       .,		/*
		*/ clickon(program prop2_enable)			/*
*/ label("Two-sample comparison of proportions (values in [0,1]):")
  TEXT     tx_prop2_1 _kindent         _ss    _cwd4_5       .,		/*
		*/ right						/*
		*/ label("Proportion one:")
  EDIT     en_prop2_1  _lft4_2           @     _en7wd       .,		/*
		*/ numonly						/*
		*/ label("Proportion one")
  TEXT     tx_prop2_2  _lft4_3           @    _cwd4_5       .,		/*
		*/ right						/*
		*/ label("Proportion two:")
  EDIT     en_prop2_2  _lft4_4           @     _en7wd       .,		/*
		*/ numonly						/*
		*/ label("Proportion two")
  RADIO    rb_prop1         _x         _ls        _cx       .,		/*
		*/ last							/*
		*/ clickon("script prop1_enable")			/*
*/ label("One-sample comparison of proportions to hypothesized values (in [0,1]):")
  TEXT     tx_prop1_1 _kindent         _ss    _cwd4_5       .,		/*
		*/ right						/*
		*/ label("Hypothesized:")
  EDIT     en_prop1_1  _lft4_2           @     _en7wd       .,		/*
		*/ numonly						/*
		*/ label("Hypothesized mean")
  TEXT     tx_prop1_2  _lft4_3           @    _cwd4_5       .,		/*
		*/ right						/*
		*/ label("Postulated:")
  EDIT     en_prop1_2  _lft4_4           @     _en7wd       .,		/*
		*/ numonly						/*
		*/ label("Postulated")
END


DIALOG opt, tabtitle("Options")
BEGIN
  GROUPBOX gb_output      _lft        _top      _cwd1    _ht4,		/*
		*/ label("Output")
  RADIO    rb_size        _indent      _ss      _inwd       .,		/*
		*/ first						/*
		*/ clickon(program power_off)				/*
		*/ label("Compute sample size")
  DEFINE   _y @y
  RADIO    rb_power       @            _ss          @       .,		/*
		*/ last 						/*
		*/ clickon("program power_on")				/*
		*/ label("Compute power")
  EDIT     en_alpha      _lft2          _y     _en7wd        .,		/*
		*/ option("alpha")					/*
		*/ numonly						/*
		*/  /*  default should be 100 - $S_level */		/*
		*/ label("Alpha")
  TEXT     tx_alpha    _en7sep           @     _en7r2     _ht0,		/*
		*/ label("Alpha (usually 0.05)")
  EDIT     en_power      _lft2         _ms     _en7wd        .,		/*
		*/ option("power")					/*
		*/ numonly						/*
		*/ default(".90") 					/*
		*/ label("Power of the test")
  TEXT     tx_power    _en7sep           @     _en7r2        .,		/*
		*/ label("Power of the test")
  CHECKBOX ck_nocontinuity _lft2       _xls     _cwd1        .,		/*
	  	*/ option(nocontinuity)					/*
		*/ label("Do not use continuity correction")
  GROUPBOX gb_samples     _lft          -5     _cwd1   _ht12h,		/*
		*/ label("Sample-based calculations")
  TEXT     tx_goto     _indent         _ms          0     _ht0,		/*
		*/ label("")
  DEFINE   _x @x
  SPINNER  sp_n1        _cksep           @      _spwd        .,		/*
		*/ option("n1")						/*
		*/ min(1) default(100) max(1000000)			/*
		*/ label("Sample one size")
  TEXT     tx_n1        _spsep           @   _ckspr2b        .,		/*
		*/ label("Sample one size")
  DEFINE   _x2 @x
  CHECKBOX ck_n2            _x         _ms      _ckwd        .,		/*
		*/ clickon(script n2_on)				/*
		*/ clickoff(script n2_off)				/*
		*/ label("")
  SPINNER  sp_n2        _cksep           @      _spwd        .,		/*
		*/ option("n2")						/*
		*/ min(1) default(100) max(1000000)			/*
		*/ label("Sample two size")
  TEXT     tx_n2        _spsep           @   _ckspr2b        .,		/*
		*/ label("Sample two size")

  DEFINE   _y @y
  EDIT     en_ratio         _x         _ms     _en7wd        .,		/*
		*/ option("ratio")					/*
		*/ numonly 						/*
		*/ default("1") 					/*
		*/ label("Ratio of sample sizes")
  TEXT     tx_ratio    _en7sep           @    _en7r2b        .,		/*
		*/ label("Ratio of sample sizes")
  EDIT     en_pre           _x         _ms     _en7wd        .,		/*
		*/ option("pre")					/*
		*/ numonly 						/*
		*/ default("0") 					/*
		*/ label("Baseline measurements")
  TEXT     tx_pre      _en7sep           @    _en7r2b        .,		/*
		*/ label("Baseline measurements")
  EDIT     en_post          _x         _ms     _en7wd        .,		/*
		*/ option("post")					/*
		*/ numonly 						/*
		*/ default("1") 					/*
		*/ label("Follow-up measurements")
  TEXT     tx_post     _en7sep           @    _en7r2b        .,		/*
		*/ label("Follow-up measurements")
  GROUPBOX gb_corrs      _lft2          _y      _cwd1    _ht7h,		/*
		*/ label("Correlations (between -1 and 1)")
  CHECKBOX ck_r0       _indent         _ms      _ckwd        ., 	/*
		*/ clickon("gaction opt.en_r0.enable")			/*
		*/ clickoff("gaction opt.en_r0.disable")		/*
		*/ label("")
  DEFINE   _x @x
  EDIT     en_r0        _cksep           @      _spwd        .,		/*
		*/ numonly						/*
		*/ option("r0")						/*
		*/ default("0") 					/*
		*/ label("Baseline/repeated")
  TEXT     tx_r0        _spsep           @   _ckspr2b        .,		/*
		*/ label("Baseline/repeated")
  CHECKBOX ck_r1            _x         _ms      _ckwd        ., 	/*
		*/ clickon("script r1_enable")				/*
		*/ clickoff("script r1_disable")			/*
		*/ label("")
  EDIT     en_r1        _cksep           @      _spwd        .,		/*
		*/ numonly						/*
		*/ option("r1")						/*
		*/ default("0") 					/*
		*/ label("Follow-up/repeated")
  TEXT     tx_r1        _spsep           @   _ckspr2b        .,		/*
		*/ label("Follow-up/repeated")
  CHECKBOX ck_r01           _x         _ms      _ckwd        ., 	/*
		*/ clickon("script r01_enable")				/*
		*/ clickoff("script r01_disable")			/*
		*/ label("")
  EDIT     en_r01       _cksep           @      _spwd        .,		/*
		*/ numonly						/*
		*/ option("r01")					/*
		*/ default("0")						/*
		*/ label("Baseline/follow-up")
  TEXT     tx_r01       _spsep           @   _ckspr2b        .,		/*
		*/ label("Baseline/follow-up")

  TEXT     tx_side        _lft        _xls      _cwd1        .,		/*
		*/ label("Sides:")
  CHECKBOX ck_method     _lft2           @      _cwd1        .,		/*
		*/ label("Choose method:")				/*
  		*/ clickon(gaction opt.cb_method.enable)		/*
		*/ clickoff(gaction opt.cb_method.disable)
  COMBOBOX cb_side        _lft         _ss      _cwd1        .,         /*
		*/ option(NONE)	 /* handled elsewhere */		/*
  		*/ dropdownlist						/*
		*/ contents("sidecont")  value("sideval")		/*
		*/ label("")
  COMBOBOX cb_method     _lft2           @      _cwd1        .,         /*
		*/ option("method")					/*
  		*/ dropdownlist						/*
		*/ contents("methodcont")  value("methodval")		/*
		*/ label("")
END

LIST sidecont
BEGIN
  Two-sided test
  One-sided test
END

LIST sideval
BEGIN
 ""
 onesided
END

LIST methodcont
BEGIN
  All
  Post
  Change
  ANCOVA
END

LIST methodval
BEGIN
  all
  post
  change
  ancova
END

SCRIPT n2_on
BEGIN
  opt.sp_n2.enable
  opt.en_ratio.disable
  opt.tx_ratio.disable
END

SCRIPT n2_off
BEGIN
  opt.sp_n2.disable
  opt.en_ratio.enable
  opt.tx_ratio.enable
END

PROGRAM ratio_enable
BEGIN
  if !opt.ck_n2 | opt.rb_size {
	if main.rb_mean2 | main.rb_prop2 {
  		call gaction opt.en_ratio.enable
  		call gaction opt.tx_ratio.enable
	}
  }
END

SCRIPT ratio_disable
BEGIN
  opt.en_ratio.disable
  opt.tx_ratio.disable
END

SCRIPT prop1_enable
BEGIN
  opt.ck_n2.disable
  opt.sp_n2.disable

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -