/*
    alpha.dlg

*!  VERSION 1.2.0  07feb2007

*/

VERSION 9.0

INCLUDE _std_large
INCLUDE header
HELP hlp1, view("help alpha")
RESET res1

DIALOG main, label("alpha - Interitem correlations (covariances) and Cronbach's alpha") /*
		*/ tabtitle("Main")
BEGIN
  TEXT     tx_var          _lft      _top      _iwd      .,		/*
		*/label("Variables:")
  VARLIST  vl_var          @         _ss       _iwd      .,             /*
  		*/label("Variables")
END

INCLUDE byifin

DIALOG options, label("") tabtitle("Options")
BEGIN
  CHECKBOX ck_asis         _lft      _top      _iwd      .,		/*
  		*/ label("Take sign of each item as is")		/*
  		*/ option("asis")
  CHECKBOX ck_casew        @         _ms       @         .,		/*
  		*/ label("Delete cases with missing values") 		/*
  		*/ option("casewise")
  CHECKBOX ck_detail       @         _ms       @         .,		/*
		*/ option("detail")					/*
	*/ label("List individual interitem correlations and covariances")
  CHECKBOX ck_gener        @         _ms       _iwd      .,		/*
  		*/ label("Save the generated scale in variable:")	/*
		*/ clickon(gaction options.ed_gener.enable)		/*
		*/ clickoff(gaction options.ed_gener.disable)
  DEFINE _x @x

  EDIT     ed_gener        _indent2  _ss       _vnwd     .,	        /*
  		*/ label("Scale Variable") 				/*
  		*/ option("generate")					/*
		*/ max(32)
  CHECKBOX ck_item         _x        _ls       _iwd      .,		/*
  		*/ option("item")					/*
  		*/ label("Display item-test and item-rest correlations")
  CHECKBOX ck_label        @         _ms       _iwd      .,		/*
  		*/ option("label")					/*
  		*/ label("Include variable labels in output table")
  CHECKBOX ck_min          @         _ms       _ckwd     .,		/*
  		*/ clickon(gaction options.sp_min.enable)		/*
  		*/ clickoff(gaction options.sp_min.disable)		/*
  		*/ label("")
  SPINNER  sp_min          _cksep    @         _spwd     .,		/*
  		*/ label("Must have at least this many observations for inclusion")/*
  		*/ min(1)						/*
		*/ max(10000000)					/*
		*/ default(1)						/*
		*/ option("min")
  TEXT     tx_min          _spsep    @         _ckspr    .,		/*
  		*/ label("Must have at least this many observations for inclusion")
  CHECKBOX ck_reverse      _x        _ms       _iwd      .,		/*
  		*/ label("Reverse signs of these variables:")		/*
  		*/ clickon(gaction options.vl_reverse.enable)		/*
		*/ clickoff(gaction options.vl_reverse.disable)
  VARLIST  vl_reverse	   _indent2  _ss       _inwd     .,             /*
  		*/ label("Reverse signs of these variables")		/*
  		*/ option("reverse")
  CHECKBOX ck_std          _x        _ls       _iwd      .,		/*
  		*/ option("std")					/*
  		*/ label("Standardize items in the scale to mean 0, variance 1")
END


PROGRAM command
BEGIN
	INCLUDE _by_pr
	put "alpha "
	varlist main.vl_var
	INCLUDE _ifin_pr
	beginoptions
		option options.ck_asis
		option options.ck_casew
		option options.ck_detail
		if options.ck_gener {
			require options.ed_gener
			optionarg options.ed_gener
		}
		option options.ck_item
		option options.ck_label
		if options.ck_min {
			optionarg options.sp_min
		}
		if options.ck_reverse {
			require options.vl_reverse
			optionarg options.vl_reverse
		}
		option options.ck_std
	endoptions
END
