/* 
  valid.dlg
*/  

VERSION 12.1

POSITION . . 590 280

DIALOG main, label("Validation") tabtitle("General")
BEGIN
  TEXT     tx_var       10    10    250     .,                 ///
           label("Items used for calculating score")
  VARLIST  vl_var       @     +20   280       .,                 /// 
	       label("Variables")
		
  TEXT     tx_n      10    +28    200     .,  				///
           label("Number of items")
		   
  EDIT     ed_n      @  +20  40  ., 						 ///
		   label("number")									///
		   numonly
		
  TEXT     tx_score       110    58    180    .,                 ///
           label("Name of the dimension (optional)")
  EDIT     ed_score       130  +20  100  ., 						///
		   option(scorename)									///
		   
  BUTTON   bt_add 260 75 32 22, ///
		   label("Add") ///
		   onpush(script az) ///
	
  GROUPBOX gb_1 5 120 284 140,
   
  TEXT     tx_v 10 +10 100 .,                 ///
           label("Items used")		   
  VARLIST  ed_v @ +20 250 .,                   ///
		   label("Items used")
  
  TEXT     tx_p @ +20 100 .,                 ///
           label("Partition")                 
		   
  EDIT     ed_p @ +20 150 .,                  ///
		   label("Partition")                 ///
           option(partition) ///
		   tooltip("Defines the number of items in each dimension")
  TEXT     tx_s @ +20 . .,                 ///
           label("Names of the dimensions (optional)")
  EDIT     ed_s @ +20 150 .,                   ///
		   label("Names of the dimensions")    ///
		   option(scorename)
  
   
  GROUPBOX gb_calc      330     13   245  90,               ///
           label("Calculation of scores") 
	 
  RADIO    rb_mean +10  +20 100 ., first  label("Mean") ///
           default(1) 
		   
		   
  RADIO    rb_sum @  +20 100 ., label("Sum") 
          
		  
  RADIO    rb_stand @  +20 140 ., last label("Standardized scores") ///
           tooltip("Set score from 0 to 100")
		   
  GROUPBOX gb_opt      330     120   245   140,               ///
           label("Options")
		   
  CHECKBOX ck_imp      +10   +20   -20     .,                 ///
		   option(imp)                                       ///
		   label("Imputing missing data")					 ///
		   onclickon(main.ck_nor.enable)                  ///
		   onclickoff(main.ck_nor.disable)                ///
		   default(1)
		   
  CHECKBOX ck_nor     +145   @   -20     .,                 ///
           option(noround)                                       ///
           label("Do not round") ///
		   tooltip("Do not round imputed values")

  CHECKBOX ck_desc    340   +28   -20     .,                 ///
		   option(descitems)									///
           label("Description of items")	///
		   default(0)		
	
  CHECKBOX ck_graphs    340   +28   -20   .,                 ///
		   option(graphs)									///
           label("Display graphs")	///
		   default(0) ///
		   tooltip("Display histogram of items, biplot of dimensions and biplot of items")
	
  /*	
  CHECKBOX ck_cfa    340   +28   -20     .,                 ///
		   option(cfa)									///
           label("Confirmatory factor analysis")	///
		   default(1)
		  
  		   
  CHECKBOX ck_conv     @   +28   +10     .,                 ///
		   option(conv_div)									///
           label("Convergent/discriminant validity")	///
		   default(1)
  */		   
  
END


DIALOG cfa, tabtitle("Confirmatory factor analysis")
BEGIN
  
  CHECKBOX	ck_cfa 10 10 200 ., label("Display confirmatory factor analysis") ///
		    option(cfa) ///
			onclickon(script cfa_ck_cfa_on) ///
			onclickoff(script cfa_ck_cfa_off)
			  
  GROUPBOX gb_cfa 10 +30 220 90 , ///
	       label("Estimation method:") 
 
  RADIO    rb_ml +10  +24 110 ., first  label("Maximum likelihood") ///
           default(1) 
	  
  RADIO    rb_mlmv @  +20 200 ., label("Maximum likelihood with missing values") 
           
  RADIO    rb_adf @  +20 140 ., last label("Asymptotic distribution free") 
           
	
  CHECKBOX	ck_stand 14  +34 140 ., label("Standardize coefficients") ///
		    option(cfastand)
  
END


DIALOG conv, tabtitle("Convergent/divergent validity")
BEGIN

  CHECKBOX ck_conv_div       10    10    220     .,  				///
		   label("Display convergent/divergent validity") ///
		   option(convdiv) ///
		   onclickon(script conv_ck_conv_on) ///
		   onclickoff(script conv_ck_conv_off)

  TEXT     tx_conv1       10   +26    220     .,  				///
		   label("Correlations between item and its own score") 
  TEXT     tx_conv2       @     +17   @     .,  				///
		   label("below this value will be highlighted")
  EDIT     ed_conv       250    42   35  .,					 ///
		   default(0.4)											///
		   option(tconvdiv)	  				                         ///
		   numonly
		   
  CHECKBOX ck_conv     10   +42   170     .,                 ///
		   option(convdivboxplots)									///
           label("Display boxplots of correlations")	              ///
		   default(1)
	
END


DIALOG rel, tabtitle("Reliability")
BEGIN

  TEXT     tx_rel_a       10    10    350     .,  				///
		   label("Cronbach's alpha below this value will be highlighted")   
  EDIT     ed_rel_a       320   @   35  ., 						 ///
	       default(0.7)												///
		   option(alpha)	  				                         ///
		   numonly
		   
  TEXT     tx_rel_d       10    +30    350     .,  				///
		   label("Ferguson's delta below this value will be highlighted")   
  EDIT     ed_rel_d       320   @   35  ., 						 ///
           default(0.9)												///
		   option(delta)	  				                         ///
		   numonly
		   
  TEXT     tx_rel_H       10    +30    380     .,  				///
		   label("Loevinger's H coefficient below this value will be highlighted")
  EDIT     ed_rel_H       320   @   35  ., 						 ///
           default(0.3)												///
		   option(h)	  				                         ///
		   numonly
		   
  TEXT     tx_rel_h       10    +30    380     .,  				///
		   label("Loevinger's Hj coefficient below this value will be highlighted")    
  EDIT     ed_rel_h       320   @   35  ., 						 ///
		   default(0.3)												///
		   option(hjmin)	 										///
		   numonly
		   
END



DIALOG rep, tabtitle("Reproducibility")
BEGIN

  TEXT     tx_rep       10    10    250     .,                 ///
           label("Items used for calculating scores (time 2)")
  VARLIST  vl_rep       @     +20   @       .,                 ///
		   option(repet)										  ///
           label("Items time 2")
	
  CHECKBOX ck_kappa     @    +35    100     .,                 ///
           label("Kappa statistic")                     ///
		   option(kappa)                                   ///
		   onclickon(script rep_ck_kappa_on)                  ///
		   onclickoff(script rep_ck_kappa_off)
		   
  CHECKBOX ck_ickappa     @    +25   280     .,                 ///
           label("Confidence interval for kappa")        ///
		   onclickon(script rep_ck_ickappa_on)                  ///
		   onclickoff(script rep_ck_ickappa_off)

  TEXT     tx_boot @  +25   220   .,  ///
           label("Number of bootstrap replications to estimate")
            
  TEXT     tx_boot2 @  +15   220   .,  ///
           label("confidence interval (if items are polytomous):") 
		   
  SPINNER  sp_ickappa +220  -7   45   .,  ///
           label("Number of bootstrap replications") min(1) max(1000) ///
           default(20) ///
		   option(ickappa)
		   
 
END


DIALOG kgv, tabtitle("Known-groups validity")
BEGIN
  TEXT     tx_kgv       10    10    250     .,                 ///
           label("Select qualitative variables for known-groups validity")
  VARLIST  vl_kgv       @     +28   250       .,                 ///
		   option(kgv)										  ///
           label("kgv")

  CHECKBOX ck_kgv       @	  +25	 150    .,                     ///
		   label("Display boxplots")                                       ///
		   option(kgvboxplots)                                    ///
		   default(0) ///
		   onclickon(kgv.ck_kgv_group.enable) ///
		   onclickoff(kgv.ck_kgv_group.disable)
		   
   CHECKBOX ck_kgv_group       @	  +25	 190    .,                     ///
		   label("Group boxplots in one graph")                                   ///
		   option(kgvgroupboxplots)                                    ///
		   default(0)
		   
END


DIALOG conc, tabtitle("Concurrent validity")
BEGIN
  TEXT     tx_conc       10    10    186     .,                 ///
           label("Select scores from other scales")
  VARLIST  vl_conc       @     +28   250       .,                 ///
		   option(conc)										  ///
           label("conc")
	
  TEXT     tx_t_conc       @   +30   350     .,  				///
		   label("Correlations above this value will be highlighted (absolute value)")   
	
  EDIT     ed_t_conc       320   @   30  ., 						 ///
           default(0.4)												///
		   option(tconc)	  				                         ///
		   numonly
		   
END


PROGRAM az
BEGIN
	main.ed_score.withvalue main.ed_s.append "@ "
	main.vl_var.withvalue main.vl_v.append "@ "
	main.ed_n.withvalue main.ed_p.append "@ "

	main.vl_var.setvalue ""
	main.ed_n.setvalue ""
	main.ed_score.setvalue ""
END




SCRIPT rep_ck_kappa_on
BEGIN
   rep.ck_ickappa.enable
END

SCRIPT rep_ck_kappa_off
BEGIN
   rep.ck_ickappa.disable
   rep.sp_ickappa.disable
   rep.ck_ickappa.setoff
END

SCRIPT rep_ck_ickappa_on
BEGIN
   rep.sp_ickappa.enable
   rep.tx_boot.enable
   rep.tx_boot2.enable
END

SCRIPT rep_ck_ickappa_off
BEGIN
   rep.sp_ickappa.disable
   rep.sp_ickappa.setdefault 0
   rep.tx_boot.disable
   rep.tx_boot2.disable
END

SCRIPT cfa_ck_cfa_on
BEGIN
	cfa.gb_cfa.enable
	cfa.rb_ml.enable
	cfa.rb_mlmv.enable
	cfa.rb_adf.enable
	cfa.ck_stand.enable
END

SCRIPT cfa_ck_cfa_off
BEGIN
	cfa.gb_cfa.disable
	cfa.rb_ml.disable
	cfa.rb_mlmv.disable
	cfa.rb_adf.disable
	cfa.ck_stand.disable
END

SCRIPT conv_ck_conv_on
BEGIN
	conv.tx_conv1.enable
	conv.tx_conv2.enable
	conv.ed_conv.enable
	conv.ck_conv.enable
END

SCRIPT conv_ck_conv_off
BEGIN
	conv.tx_conv1.disable
	conv.tx_conv2.disable
	conv.ed_conv.disable
	conv.ck_conv.disable
END

OK ok1,      label("OK")
CANCEL can1, label("Cancel")
SUBMIT sub1, label("Submit")
HELP hlp1,   view("help valid")
RESET res1
COPY copy1

PROGRAM command
BEGIN
	put "valid "
	require main.ed_v
	put main.ed_v
	require main.ed_p
	
	beginoptions
		optionarg main.ed_p
		optionarg main.ed_s
		option main.ck_imp
		option main.ck_nor
		option main.ck_desc
		option main.ck_graphs
		
		if main.rb_mean{
		put " calcmethod("
		put "mean"
		put ")"
		}
		
		if main.rb_sum{
		put " calcmethod("
		put "sum"
		put ")"
		}
		
		if main.rb_stand{
		put " calcmethod("
		put "stand"
		put ")"
		}
		
		option cfa.ck_cfa
		
		if cfa.rb_ml{
		put " cfamethod("
		put "ml"
		put ")"
		}
		
		if cfa.rb_mlmv{
		put " cfamethod("
		put "mlmv"
		put ")"
		}
		
		if cfa.rb_adf{
		put " cfamethod("
		put "adf"
		put ")"
		}
		
		option cfa.ck_stand
		option conv.ck_conv_div
		optionarg conv.ed_conv
		option conv.ck_conv
		optionarg rel.ed_rel_a
		optionarg rel.ed_rel_d
		optionarg rel.ed_rel_H
		optionarg rel.ed_rel_h
		optionarg rep.vl_rep
		option rep.ck_kappa
		optionarg rep.sp_ickappa
	    optionarg kgv.vl_kgv
		option kgv.ck_kgv
		option kgv.ck_kgv_group
		optionarg conc.vl_conc
		optionarg conc.ed_t_conc
		
	endoptions 
		
		
END