reshape.dlg

来自「是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到」· DLG 代码 · 共 172 行

DLG
172
字号
/*
	reshape

*!  VERSION 1.1.1  31mar2005

*/

VERSION 9.0

INCLUDE _std_medium
INCLUDE _ht280
INCLUDE header

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

DEFINE atwlwd  60


DIALOG main, label("reshape - Convert data between wide and long") /*
		*/ tabtitle("Main")
BEGIN
  RADIO    rb_long            _lft     _top _comb4_1        ., first	/*
		*/ label("Long format from wide")			/*
		*/ clickon("script long_on")				/*
		*/ option(long)
  BUTTON   bu_example      _lft4_4        @  _cwd4_1        .,		/*
		*/ label("Example...")					/*
		*/ push("script example")
  RADIO    rb_wide            _lft      _ss     _iwd        ., 		/*
		*/ label("Wide format from long")			/*
		*/ clickon("script wide_on")				/*
		*/ option(wide)
  RADIO    rb_longagain          @      _ss        @        .,		/*
		*/ label("Back to long format (previously reshaped)")	/*
		*/ clickon("script all_off")				/*
		*/ option(long)
  RADIO    rb_wideagain          @      _ss        @        ., last	/*
		*/ label("Back to wide format (previously reshaped)")	/*
		*/ clickon("script all_off")				/*
		*/ option(wide)

  TEXT     tx_var_i              @      _ls        @        .,		/*
		*/ label("ID variable(s) - the i() option:")
  VARLIST  vl_var_i              @      _ss        @        .,		/*
		*/ label("ID variable(s)")

  TEXT     tx_var_j              @      _ls        @        .,		/*
		*/ label("Subobservation identifier variable - the j() option:")
  VARNAME  vn_var_j              @      _ss    _vnwd        .,		/*
		*/ label("Subobservation identifier variable")

  TEXT     tx_var                @      _ls     _iwd        .,		/*
		*/ label("Base (stub) names of X_ij variables:")
  VARLIST  vl_var                @      _ss        @        .,		/*
		*/ label("Base (stub) names of X_ij variables")

  TEXT     tx_note               @      _ls        @        .,		/*
	*/ label("Note:  All other variables should be constant within ID.")

END


DIALOG adv, tabtitle("Advanced")
BEGIN
  CHECKBOX ck_string          _lft     _top     _iwd        .,		/*
		*/ option(string)					/*
	*/ label("Allow the subobservation identifier to include strings")

  TEXT     tx_jvals              @      _ls        @        .,		/*
	*/ label("Use only these values of the subobservation identifier:")
  TEXT     tx_jvals2             @     _vss        @        .,		/*
		*/ label("(leave blank to use all values)")
  EDIT     ed_jvals              @      _ss        @        .,		/*
		*/ label("Subobservation values")

  TEXT     tx_atwl               @      _ls        @        .,		/*
*/ label("Substitute the following for the @ character (when going to long):")
  EDIT     ed_atwl               @      _ss   atwlwd        .,		/*
		*/ option(atwl)						/*
		*/ label("Substitute for the @ character")
END

SCRIPT example
BEGIN
  view help reshape_example##|_new
END

SCRIPT most_on
BEGIN
  main.tx_var_i.enable
  main.vl_var_i.enable
  main.tx_var_j.enable
  main.vn_var_j.enable
  main.tx_var.enable
  main.vl_var.enable
  main.tx_note.enable
  adv.ck_string.enable
  adv.tx_jvals.enable
  adv.tx_jvals2.enable
  adv.ed_jvals.enable
END

SCRIPT most_off
BEGIN
  main.tx_var_i.disable
  main.vl_var_i.disable
  main.tx_var_j.disable
  main.vn_var_j.disable
  main.tx_var.disable
  main.vl_var.disable
  main.tx_note.disable
  adv.ck_string.disable
  adv.tx_jvals.disable
  adv.tx_jvals2.disable
  adv.ed_jvals.disable
END

SCRIPT longonly_on
BEGIN
  adv.tx_atwl.enable
  adv.ed_atwl.enable
END

SCRIPT longonly_off
BEGIN
  adv.tx_atwl.disable
  adv.ed_atwl.disable
END

SCRIPT all_off
BEGIN
  script most_off
  script longonly_off
END

SCRIPT wide_on
BEGIN
  script most_on
  script longonly_off
END

SCRIPT long_on
BEGIN
  script most_on
  script longonly_on
END


PROGRAM command
BEGIN
	put "reshape "
	option radio (main rb_long rb_wide rb_longagain rb_wideagain)
	if main.rb_long | main.rb_wide {
		varlist main.vl_var
		beginoptions
			put "i("
			varlist main.vl_var_i
			put ") "
			put "j("
			varlist main.vn_var_j
			if adv.ed_jvals {
				put " " adv.ed_jvals
			}
			put ")"
			option adv.ck_string
			optionarg adv.ed_atwl
		endoptions
	}
END

⌨️ 快捷键说明

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