From 5f7a2560755a879d81c72a06bd95f150a3956da0 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Mon, 16 Nov 2020 10:37:19 +0000 Subject: [PATCH] LazStats: Add original sources, part 7 git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7878 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../lazstats/source_orig/gradingunit.lrs | 68 + .../lazstats/source_orig/gradingunit.pas | 404 +++++ .../lazstats/source_orig/graphlib.lfm | 56 + .../lazstats/source_orig/graphlib.lrs | 17 + .../lazstats/source_orig/graphlib.pas | 1583 +++++++++++++++++ .../lazstats/source_orig/gridhelpunit.lfm | 62 + .../lazstats/source_orig/gridhelpunit.lrs | 51 + .../lazstats/source_orig/gridhelpunit.pas | 33 + .../lazstats/source_orig/groupfrequnit.lfm | 213 +++ .../lazstats/source_orig/groupfrequnit.lrs | 142 ++ .../lazstats/source_orig/groupfrequnit.pas | 173 ++ .../lazstats/source_orig/guttmanunit.lfm | 178 ++ .../lazstats/source_orig/guttmanunit.lrs | 127 ++ .../lazstats/source_orig/guttmanunit.pas | 598 +++++++ .../lazstats/source_orig/helpunit.lfm | 53 + .../lazstats/source_orig/helpunit.lrs | 19 + .../lazstats/source_orig/helpunit.pas | 56 + .../lazstats/source_orig/hierarchunit.lfm | 242 +++ .../lazstats/source_orig/hierarchunit.lrs | 142 ++ .../lazstats/source_orig/hierarchunit.pas | 485 +++++ .../lazstats/source_orig/hypergeounit.lfm | 182 ++ .../lazstats/source_orig/hypergeounit.lrs | 45 + .../lazstats/source_orig/hypergeounit.pas | 181 ++ .../lazstats/source_orig/interruptedunit.lfm | 291 +++ .../lazstats/source_orig/interruptedunit.lrs | 237 +++ .../lazstats/source_orig/interruptedunit.pas | 909 ++++++++++ .../lazstats/source_orig/inversezunit.lfm | 80 + .../lazstats/source_orig/inversezunit.lrs | 23 + .../lazstats/source_orig/inversezunit.pas | 60 + .../lazstats/source_orig/itembankingunit.lfm | 245 +++ .../lazstats/source_orig/itembankingunit.lrs | 65 + .../lazstats/source_orig/itembankingunit.pas | 752 ++++++++ .../lazstats/source_orig/itemcodesunit.lfm | 134 ++ .../lazstats/source_orig/itemcodesunit.lrs | 41 + .../lazstats/source_orig/itemcodesunit.pas | 152 ++ .../lazstats/source_orig/jpegunit.lfm | 66 + .../lazstats/source_orig/jpegunit.lrs | 20 + .../lazstats/source_orig/jpegunit.pas | 83 + .../lazstats/source_orig/kaplanmeierunit.lfm | 433 +++++ .../lazstats/source_orig/kaplanmeierunit.lrs | 352 ++++ .../lazstats/source_orig/kaplanmeierunit.pas | 1069 +++++++++++ .../lazstats/source_orig/kappaunit.lfm | 484 +++++ .../lazstats/source_orig/kappaunit.lrs | 367 ++++ .../lazstats/source_orig/kappaunit.pas | 670 +++++++ .../lazstats/source_orig/kendalltauunit.lfm | 398 +++++ .../lazstats/source_orig/kendalltauunit.lrs | 341 ++++ .../lazstats/source_orig/kendalltauunit.pas | 554 ++++++ .../lazstats/source_orig/kmeansunit.lfm | 253 +++ .../lazstats/source_orig/kmeansunit.lrs | 144 ++ .../lazstats/source_orig/kmeansunit.pas | 867 +++++++++ .../lazstats/source_orig/kr21unit.lfm | 111 ++ .../lazstats/source_orig/kr21unit.lrs | 29 + .../lazstats/source_orig/kr21unit.pas | 73 + .../lazstats/source_orig/kwanovaunit.lfm | 307 ++++ .../lazstats/source_orig/kwanovaunit.lrs | 239 +++ .../lazstats/source_orig/kwanovaunit.pas | 488 +++++ 56 files changed, 15447 insertions(+) create mode 100644 applications/lazstats/source_orig/gradingunit.lrs create mode 100644 applications/lazstats/source_orig/gradingunit.pas create mode 100644 applications/lazstats/source_orig/graphlib.lfm create mode 100644 applications/lazstats/source_orig/graphlib.lrs create mode 100644 applications/lazstats/source_orig/graphlib.pas create mode 100644 applications/lazstats/source_orig/gridhelpunit.lfm create mode 100644 applications/lazstats/source_orig/gridhelpunit.lrs create mode 100644 applications/lazstats/source_orig/gridhelpunit.pas create mode 100644 applications/lazstats/source_orig/groupfrequnit.lfm create mode 100644 applications/lazstats/source_orig/groupfrequnit.lrs create mode 100644 applications/lazstats/source_orig/groupfrequnit.pas create mode 100644 applications/lazstats/source_orig/guttmanunit.lfm create mode 100644 applications/lazstats/source_orig/guttmanunit.lrs create mode 100644 applications/lazstats/source_orig/guttmanunit.pas create mode 100644 applications/lazstats/source_orig/helpunit.lfm create mode 100644 applications/lazstats/source_orig/helpunit.lrs create mode 100644 applications/lazstats/source_orig/helpunit.pas create mode 100644 applications/lazstats/source_orig/hierarchunit.lfm create mode 100644 applications/lazstats/source_orig/hierarchunit.lrs create mode 100644 applications/lazstats/source_orig/hierarchunit.pas create mode 100644 applications/lazstats/source_orig/hypergeounit.lfm create mode 100644 applications/lazstats/source_orig/hypergeounit.lrs create mode 100644 applications/lazstats/source_orig/hypergeounit.pas create mode 100644 applications/lazstats/source_orig/interruptedunit.lfm create mode 100644 applications/lazstats/source_orig/interruptedunit.lrs create mode 100644 applications/lazstats/source_orig/interruptedunit.pas create mode 100644 applications/lazstats/source_orig/inversezunit.lfm create mode 100644 applications/lazstats/source_orig/inversezunit.lrs create mode 100644 applications/lazstats/source_orig/inversezunit.pas create mode 100644 applications/lazstats/source_orig/itembankingunit.lfm create mode 100644 applications/lazstats/source_orig/itembankingunit.lrs create mode 100644 applications/lazstats/source_orig/itembankingunit.pas create mode 100644 applications/lazstats/source_orig/itemcodesunit.lfm create mode 100644 applications/lazstats/source_orig/itemcodesunit.lrs create mode 100644 applications/lazstats/source_orig/itemcodesunit.pas create mode 100644 applications/lazstats/source_orig/jpegunit.lfm create mode 100644 applications/lazstats/source_orig/jpegunit.lrs create mode 100644 applications/lazstats/source_orig/jpegunit.pas create mode 100644 applications/lazstats/source_orig/kaplanmeierunit.lfm create mode 100644 applications/lazstats/source_orig/kaplanmeierunit.lrs create mode 100644 applications/lazstats/source_orig/kaplanmeierunit.pas create mode 100644 applications/lazstats/source_orig/kappaunit.lfm create mode 100644 applications/lazstats/source_orig/kappaunit.lrs create mode 100644 applications/lazstats/source_orig/kappaunit.pas create mode 100644 applications/lazstats/source_orig/kendalltauunit.lfm create mode 100644 applications/lazstats/source_orig/kendalltauunit.lrs create mode 100644 applications/lazstats/source_orig/kendalltauunit.pas create mode 100644 applications/lazstats/source_orig/kmeansunit.lfm create mode 100644 applications/lazstats/source_orig/kmeansunit.lrs create mode 100644 applications/lazstats/source_orig/kmeansunit.pas create mode 100644 applications/lazstats/source_orig/kr21unit.lfm create mode 100644 applications/lazstats/source_orig/kr21unit.lrs create mode 100644 applications/lazstats/source_orig/kr21unit.pas create mode 100644 applications/lazstats/source_orig/kwanovaunit.lfm create mode 100644 applications/lazstats/source_orig/kwanovaunit.lrs create mode 100644 applications/lazstats/source_orig/kwanovaunit.pas diff --git a/applications/lazstats/source_orig/gradingunit.lrs b/applications/lazstats/source_orig/gradingunit.lrs new file mode 100644 index 000000000..549c2ff22 --- /dev/null +++ b/applications/lazstats/source_orig/gradingunit.lrs @@ -0,0 +1,68 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('Tgradingfrm','FORMDATA',[ + 'TPF0'#11'Tgradingfrm'#10'gradingfrm'#4'Left'#2'f'#6'Height'#3#238#1#3'Top'#2 + +'m'#5'Width'#3#194#2#7'Caption'#6#24'Specification for Grades'#12'ClientHeig' + +'ht'#3#238#1#11'ClientWidth'#3#194#2#6'OnShow'#7#8'FormShow'#10'LCLVersion'#6 + +#8'0.9.28.2'#0#6'TLabel'#6'Label1'#4'Left'#2#16#6'Height'#2#14#3'Top'#2'z'#5 + +'Width'#2#28#7'Caption'#6#5'Score'#11'ParentColor'#8#0#0#6'TLabel'#6'Label2' + +#4'Left'#2'P'#6'Height'#2#14#3'Top'#2'z'#5'Width'#2'4'#7'Caption'#6#9'Freque' + +'ncy'#11'ParentColor'#8#0#0#6'TLabel'#6'Label3'#4'Left'#3#160#0#6'Height'#2 + +#14#3'Top'#2'z'#5'Width'#2'<'#7'Caption'#6#11'Grade Given'#11'ParentColor'#8 + +#0#0#6'TLabel'#13'TopScoreLabel'#4'Left'#3'X'#1#6'Height'#2#14#3'Top'#2'z'#5 + +'Width'#2'1'#7'Caption'#6#9'Top Score'#11'ParentColor'#8#0#0#6'TLabel'#16'Do' + +'wnThroughLabel'#4'Left'#3#176#1#6'Height'#2#14#3'Top'#2'z'#5'Width'#2'G'#7 + +'Caption'#6#12'Down Through'#11'ParentColor'#8#0#0#6'TLabel'#6'Label4'#4'Lef' + +'t'#3#8#2#6'Height'#2#14#3'Top'#2'z'#5'Width'#2'@'#7'Caption'#6#12'No. Assig' + +'ned'#11'ParentColor'#8#0#0#6'TLabel'#6'Label5'#4'Left'#3#0#1#6'Height'#2#14 + +#3'Top'#2'z'#5'Width'#2'#'#7'Caption'#6#6'Grades'#11'ParentColor'#8#0#0#11'T' + +'RadioGroup'#12'DistUseGroup'#4'Left'#2#8#6'Height'#2'o'#3'Top'#2#3#5'Width' + +#3#212#0#8'AutoFill'#9#7'Caption'#6#21'To Assign Grades Use:'#28'ChildSizing' + +'.LeftRightSpacing'#2#6#28'ChildSizing.TopBottomSpacing'#2#6#29'ChildSizing.' + +'EnlargeHorizontal'#7#24'crsHomogenousChildResize'#27'ChildSizing.EnlargeVer' + +'tical'#7#24'crsHomogenousChildResize'#28'ChildSizing.ShrinkHorizontal'#7#14 + +'crsScaleChilds'#26'ChildSizing.ShrinkVertical'#7#14'crsScaleChilds'#18'Chil' + +'dSizing.Layout'#7#29'cclLeftToRightThenTopToBottom'#27'ChildSizing.Controls' + +'PerLine'#2#1#12'ClientHeight'#2']'#11'ClientWidth'#3#208#0#13'Items.Strings' + +#1#6#15'Raw Test Scores'#6#8'z Scores'#6#8'T Scores'#6#22'Percentile Rank Sc' + +'ores'#0#7'OnClick'#7#17'DistUseGroupClick'#8'TabOrder'#2#0#0#0#11'TRadioGro' + +'up'#15'CategoriesGroup'#4'Left'#3#233#0#6'Height'#2'p'#3'Top'#2#2#5'Width'#3 + +#23#1#8'AutoFill'#9#7'Caption'#6'#Use the following Grade Categories:'#28'Ch' + +'ildSizing.LeftRightSpacing'#2#6#28'ChildSizing.TopBottomSpacing'#2#6#29'Chi' + +'ldSizing.EnlargeHorizontal'#7#24'crsHomogenousChildResize'#27'ChildSizing.E' + +'nlargeVertical'#7#24'crsHomogenousChildResize'#28'ChildSizing.ShrinkHorizon' + +'tal'#7#14'crsScaleChilds'#26'ChildSizing.ShrinkVertical'#7#14'crsScaleChild' + +'s'#18'ChildSizing.Layout'#7#29'cclLeftToRightThenTopToBottom'#27'ChildSizin' + +'g.ControlsPerLine'#2#1#12'ClientHeight'#2'^'#11'ClientWidth'#3#19#1#13'Item' + +'s.Strings'#1#6#13'A, B, C, D, F'#6')A, A-, B+, B, B-, C+, C, C-, D+, D, D-,' + +' F'#0#7'OnClick'#7#20'CategoriesGroupClick'#8'TabOrder'#2#1#0#0#11'TStringG' + +'rid'#10'ScoresGrid'#4'Left'#2#8#6'Height'#3'&'#1#3'Top'#3#137#0#5'Width'#3 + +#136#0#8'ColCount'#2#2#9'FixedCols'#2#0#9'FixedRows'#2#0#8'TabOrder'#2#2#0#0 + +#11'TStringGrid'#10'GradesGrid'#4'Left'#3#159#0#6'Height'#3'&'#1#3'Top'#3#137 + +#0#5'Width'#2'J'#8'ColCount'#2#1#9'FixedCols'#2#0#9'FixedRows'#2#0#8'TabOrde' + +'r'#2#3#0#0#11'TStringGrid'#12'TopScoreGrid'#4'Left'#3'X'#1#6'Height'#3'*'#1 + +#3'Top'#3#138#0#5'Width'#2'G'#8'ColCount'#2#1#9'FixedCols'#2#0#9'FixedRows'#2 + +#0#8'TabOrder'#2#4#0#0#11'TStringGrid'#12'LowScoreGrid'#4'Left'#3#176#1#6'He' + +'ight'#3'*'#1#3'Top'#3#138#0#5'Width'#2'C'#8'ColCount'#2#1#9'FixedCols'#2#0#9 + +'FixedRows'#2#0#7'Options'#11#15'goFixedVertLine'#15'goFixedHorzLine'#10'goV' + +'ertLine'#10'goHorzLine'#13'goRangeSelect'#9'goEditing'#14'goSmoothScroll'#0 + +#8'TabOrder'#2#5#9'OnKeyDown'#7#19'LowScoreGridKeyDown'#0#0#7'TButton'#7'Sav' + +'eBtn'#4'Left'#3'`'#2#6'Height'#2' '#3'Top'#2'z'#5'Width'#2'M'#7'Caption'#6 + +#11'Save Specs.'#7'OnClick'#7#12'SaveBtnClick'#8'TabOrder'#2#6#0#0#7'TButton' + +#7'LoadBtn'#4'Left'#3'`'#2#6'Height'#2' '#3'Top'#3#176#0#5'Width'#2'M'#7'Cap' + +'tion'#6#11'Load Specs.'#7'OnClick'#7#12'LoadBtnClick'#8'TabOrder'#2#7#0#0#7 + +'TButton'#8'ResetBtn'#4'Left'#3'`'#2#6'Height'#2' '#3'Top'#3#232#0#5'Width'#2 + +'M'#7'Caption'#6#5'Reset'#7'OnClick'#7#13'ResetBtnClick'#8'TabOrder'#2#8#0#0 + +#7'TButton'#9'Cancelbtn'#4'Left'#3'`'#2#6'Height'#2' '#3'Top'#3' '#1#5'Width' + +#2'M'#7'Caption'#6#6'Cancel'#11'ModalResult'#2#2#8'TabOrder'#2#9#0#0#7'TButt' + +'on'#9'ReturnBtn'#4'Left'#3'`'#2#6'Height'#2' '#3'Top'#3#143#1#5'Width'#2'M' + +#7'Caption'#6#6'Return'#11'ModalResult'#2#1#8'TabOrder'#2#10#0#0#11'TStringG' + +'rid'#12'AssignedGrid'#4'Left'#3#8#2#6'Height'#3'+'#1#3'Top'#3#138#0#5'Width' + +#2'D'#8'ColCount'#2#1#9'FixedCols'#2#0#9'FixedRows'#2#0#8'TabOrder'#2#11#0#0 + +#11'TStringGrid'#6'Grades'#4'Left'#3#0#1#6'Height'#3'('#1#3'Top'#3#138#0#5'W' + +'idth'#2'H'#8'ColCount'#2#1#9'FixedCols'#2#0#9'FixedRows'#2#0#8'TabOrder'#2 + +#12#0#0#7'TButton'#10'ComputeBtn'#4'Left'#3'`'#2#6'Height'#2#29#3'Top'#3'X'#1 + +#5'Width'#2'M'#7'Caption'#6#7'Compute'#7'OnClick'#7#15'ComputeBtnClick'#8'Ta' + +'bOrder'#2#13#0#0#11'TOpenDialog'#11'OpenDialog1'#4'left'#3'('#2#3'top'#3#192 + +#1#0#0#11'TSaveDialog'#11'SaveDialog1'#4'left'#3#128#2#3'top'#3#192#1#0#0#0 +]); diff --git a/applications/lazstats/source_orig/gradingunit.pas b/applications/lazstats/source_orig/gradingunit.pas new file mode 100644 index 000000000..64b40cac7 --- /dev/null +++ b/applications/lazstats/source_orig/gradingunit.pas @@ -0,0 +1,404 @@ +unit gradingunit; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, + ExtCtrls, StdCtrls, Grids, outputunit; + +type + + { Tgradingfrm } + + Tgradingfrm = class(TForm) + ComputeBtn: TButton; + Label4: TLabel; + AssignedGrid: TStringGrid; + Label5: TLabel; + Grades: TStringGrid; + OpenDialog1: TOpenDialog; + SaveBtn: TButton; + LoadBtn: TButton; + ResetBtn: TButton; + Cancelbtn: TButton; + ReturnBtn: TButton; + DistUseGroup: TRadioGroup; + CategoriesGroup: TRadioGroup; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + DownThroughLabel: TLabel; + SaveDialog1: TSaveDialog; + ScoresGrid: TStringGrid; + GradesGrid: TStringGrid; + TopScoreGrid: TStringGrid; + LowScoreGrid: TStringGrid; + TopScoreLabel: TLabel; + procedure CategoriesGroupClick(Sender: TObject); + procedure ComputeBtnClick(Sender: TObject); + procedure DistUseGroupClick(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure LoadBtnClick(Sender: TObject); + procedure LowScoreGridExit(Sender: TObject); + procedure LowScoreGridKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure ResetBtnClick(Sender: TObject); + procedure SaveBtnClick(Sender: TObject); + private + { private declarations } + nints : integer; + ncases : integer; + col : integer; + ncats : integer; + sorted : array[0..50] of double; + public + { public declarations } + end; + +var + gradingfrm: Tgradingfrm; + +implementation +uses gradebookunit; + +{ Tgradingfrm } + +procedure Tgradingfrm.DistUseGroupClick(Sender: TObject); +VAR + i, j, btn, nscores : integer; + RawScores : array[0..50] of double; + RawFreq : array[0..50] of double; + temp, X, Y : double; +begin + if DistUseGroup.ItemIndex < 0 then exit; + col := gradebookfrm.tno + 3; // column of raw scores for test number tno + btn := DistUseGroup.ItemIndex; + nscores := gradebookfrm.nints; + ScoresGrid.RowCount := nscores; + ncases := gradebookfrm.NoStudents; + case btn of + 0 : TopScoreGrid.Cells[0,0] := IntToStr(gradebookfrm.nitems); + 1 : TopScoreGrid.Cells[0,0] := FloatToStr(3.0); + 2 : TopScoreGrid.Cells[0,0] := FloatToStr(90.0); + 3 : TopScoreGrid.Cells[0,0] := FloatToStr(100.0); + end; + + case btn of + 0 : for i := 1 to ncases do RawScores[i-1] := StrToFloat(gradebookfrm.Grid.Cells[col,i]); + 1 : for i := 1 to ncases do RawScores[i-1] := StrToFloat(gradebookfrm.Grid.Cells[col+1,i]); + 2 : for i := 1 to ncases do RawScores[i-1] := StrToFloat(gradebookfrm.Grid.Cells[col+2,i]); + 3 : for i := 1 to ncases do RawScores[i-1] := StrToFloat(gradebookfrm.Grid.Cells[col+3,i]); + end; + + // sort RawScores into ascending order + for i := 1 to ncases - 1 do + begin + for j := i+1 to ncases do + begin + X := RawScores[i-1]; + Y := RawScores[j-1]; + if RawScores[i-1] < RawScores[j-1] then // switch + begin + temp := RawScores[i-1]; + RawScores[i-1] := RawScores[j-1]; + RawScores[j-1] := temp; + end; + end; + end; + + // get frequency of each score + nints := 1; + for i := 1 to ncases do RawFreq[i-1] := 0; + X := RawScores[0]; + Sorted[0] := X; + for i := 1 to ncases do + begin + if (X = RawScores[i-1])then RawFreq[nints-1] := RawFreq[nints-1] + 1 + else // new value + begin + nints := nints + 1; + RawFreq[nints-1] := RawFreq[nints-1] + 1; + X := RawScores[i-1]; + Sorted[nints-1] := X; + end; + end; + + // put data in grid +// AssignedGrid.RowCount := nints + 1; + ScoresGrid.RowCount := nints+1; + GradesGrid.RowCount := nints + 1; + for i := 0 to nints-1 do + begin + ScoresGrid.Cells[0,i] := FloatToStr(Sorted[i]); + ScoresGrid.Cells[1,i] := FloatToStr(RawFreq[i]); + end; +end; + +procedure Tgradingfrm.FormShow(Sender: TObject); +VAR + i, j : integer; +begin + DistUseGroup.ItemIndex := -1; + CategoriesGroup.ItemIndex := -1; + for i := 0 to ScoresGrid.RowCount-1 do + for j := 0 to 1 do ScoresGrid.Cells[j,i] := ''; + ScoresGrid.RowCount := 5; + for i := 0 to Grades.RowCount-1 do Grades.Cells[0,i] := ''; + Grades.RowCount := 5; + for i := 0 to GradesGrid.RowCount-1 do GradesGrid.Cells[0,i] := ''; + GradesGrid.RowCount := 5; + for i := 0 to TopScoreGrid.RowCount-1 do TopScoreGrid.Cells[0,i] := ''; + TopScoreGrid.RowCount := 5; + for i := 0 to LowScoreGrid.RowCount-1 do LowScoreGrid.Cells[0,i] := ''; + LowScoreGrid.RowCount := 5; + for i := 0 to AssignedGrid.RowCount-1 do AssignedGrid.Cells[0,i] := ''; + AssignedGrid.RowCount := 5; +end; + +procedure Tgradingfrm.LoadBtnClick(Sender: TObject); +var + FName : string; + Grading : textfile; + i, j, choice : integer; + cellstring, outline, valstr : string; +begin + OutPutFrm.RichEdit.Clear; + OpenDialog1.DefaultExt := '.GRD'; + OpenDialog1.Filter := 'ALL (*.*)|*.*|Test Grading (*.GRD)|*.GRD'; + OpenDialog1.FilterIndex := 2; + if OpenDialog1.Execute then + begin +// GetNoRecords; + FName := OpenDialog1.FileName; + AssignFile(Grading,FName); + Reset(Grading); + readln(Grading,ncases); + readln(Grading,nints); + readln(Grading,col); + readln(Grading,choice); + cellstring := format('Distribution used index = %2d',[choice]); + OutPutFrm.RichEdit.Lines.Add(cellstring); +// DistUseGroup.ItemIndex := choice; + readln(Grading,choice); + cellstring := format('Category index = %2d',[choice]); + OutPutFrm.RichEdit.Lines.Add(cellstring); +// CategoriesGroup.ItemIndex := choice; + readln(Grading,choice); + OutPutFrm.RichEdit.Lines.Add('Top Score Low Score'); + if choice = 0 then + begin + for i := 0 to 4 do + begin + readln(Grading,cellstring); + outline := format('%10s ',[cellstring]); +// TopScoreGrid.Cells[0,i] := cellstring; + readln(Grading,cellstring); + valstr := format('%10s',[cellstring]); + outline := outline + valstr; +// LowScoreGrid.Cells[0,i] := cellstring; + OutPutFrm.RichEdit.Lines.Add(outline); + end; + end else + begin + for i := 0 to 11 do + begin + readln(Grading,cellstring); + outline := format('%10s',[cellstring]); +// TopScoreGrid.Cells[0,i] := cellstring; + readln(Grading,cellstring); + valstr := format('%10s',[cellstring]); + outline := outline + valstr; +// LowScoreGrid.Cells[0,i] := cellstring; + OutPutFrm.RichEdit.Lines.Add(outline); + end; + end; + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add('Assigned Grid'); + for i := 0 to nints-1 do + begin + readln(Grading,cellstring); + outline := cellstring; + OutPutFrm.RichEdit.Lines.Add(outline); +// AssignedGrid.Cells[0,i] := cellstring; + end; +// readln(Grading,cellstring); + OutPutFrm.RichEdit.Lines.Add('Score Frequency'); + for i := 0 to nints - 1 do + begin + outline := ''; + for j := 0 to 1 do + begin + readln(Grading,cellstring); + valstr := format('%10s ',[cellstring]); + outline := outline + valstr; +// ScoresGrid.Cells[j,i] := cellstring; + end; + OutPutFrm.RichEdit.Lines.Add(outline); + end; + end; + OutPutFrm.ShowModal; + CloseFile(Grading); +end; + +procedure Tgradingfrm.LowScoreGridExit(Sender: TObject); + +begin + +end; + +procedure Tgradingfrm.LowScoreGridKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +VAR + i, row, naffected, freq, intervals, sum : integer; + lowval, hival, score1 : double; + +begin + if Key = 13 then // enter key + begin + intervals := ScoresGrid.RowCount-1; + row := LowScoreGrid.Row; + freq := 0; + lowval := StrToFloat(LowScoreGrid.Cells[0,row]); + hival := StrToFloat(TopScoreGrid.Cells[0,row]); + for i := 0 to intervals-1 do + begin + score1 := StrToFloat(ScoresGrid.Cells[0,i]); + if (score1 >= lowval) and (score1 <= hival) then + freq := freq + StrToInt(ScoresGrid.Cells[1,i]); + end; + AssignedGrid.Cells[0,row] := IntToStr(freq); + if row < ncats-1 then + begin + if DistUseGroup.ItemIndex = 1 then // z score + TopScoreGrid.Cells[0,row+1] := FloatToStr(lowval-0.001); + if DistUseGroup.ItemIndex = 0 then // raw score + TopScoreGrid.Cells[0,row+1] := FloatToStr(lowval-1); + if DistUseGroup.ItemIndex = 2 then // T score + TopScoreGrid.Cells[0,row+1] := FloatToStr(lowval-0.1); + if DistUseGroup.ItemIndex = 3 then // Percentile rank + TopScoreGrid.Cells[0,row+1] := FloatToStr(lowval-0.01); + end; + end; +end; + +procedure Tgradingfrm.ResetBtnClick(Sender: TObject); +begin + FormShow(self); +end; + +procedure Tgradingfrm.SaveBtnClick(Sender: TObject); +var + FName : string; + Grading : textfile; + i, j : integer; +begin + SaveDialog1.DefaultExt := '.GRD'; + SaveDialog1.Filter := 'ALL (*.*)|*.*|Test Grading (*.GRD)|*.GRD'; + SaveDialog1.FilterIndex := 2; + if SaveDialog1.Execute then + begin + FName := SaveDialog1.FileName; + AssignFile(Grading,FName); + Rewrite(Grading); + writeln(Grading,ncases); + writeln(Grading,nints); + writeln(Grading,col); + writeln(Grading,DistUseGroup.ItemIndex); + writeln(Grading,CategoriesGroup.ItemIndex); + if CategoriesGroup.ItemIndex = 0 then + begin + for i := 0 to 4 do + begin + writeln(Grading,TopScoreGrid.Cells[0,i]); + writeln(Grading,LowScoreGrid.Cells[0,i]); + end; + end else + begin + for i := 0 to 11 do + begin + writeln(Grading,TopScoreGrid.Cells[0,i]); + writeln(Grading,LowScoreGrid.Cells[0,i]); + end; + end; + for i := 0 to AssignedGrid.RowCount-1 do + writeln(Grading,AssignedGrid.Cells[0,i]); + for i := 0 to ScoresGrid.RowCount - 1 do + begin + for j := 0 to 1 do writeln(Grading,ScoresGrid.Cells[j,i]); + end; + end; + CloseFile(Grading); +end; + + +procedure Tgradingfrm.CategoriesGroupClick(Sender: TObject); +VAR + btn : integer; +begin + btn := CategoriesGroup.ItemIndex; + if btn = 0 then ncats := 5 else ncats := 12; + if btn = 0 then Grades.RowCount := 5 else Grades.RowCount := 12; + if btn = 0 then TopScoreGrid.RowCount := 5 else TopScoreGrid.RowCount := 12; + if btn = 0 then LowScoreGrid.RowCount := 5 else LowScoreGrid.RowCount := 12; + if btn = 0 then AssignedGrid.RowCount := 5 else AssignedGrid.RowCount := 12; + if btn = 0 then + begin + Grades.Cells[0,0] := 'A'; + Grades.Cells[0,1] := 'B'; + Grades.Cells[0,2] := 'C'; + Grades.Cells[0,3] := 'D'; + Grades.Cells[0,4] := 'F'; + end; + if btn = 1 then + begin + Grades.Cells[0,0] := 'A'; + Grades.Cells[0,1] := 'A-'; + Grades.Cells[0,2] := 'B+'; + Grades.Cells[0,3] := 'B'; + Grades.Cells[0,4] := 'B-'; + Grades.Cells[0,5] := 'C+'; + Grades.Cells[0,6] := 'C'; + Grades.Cells[0,7] := 'C-'; + Grades.Cells[0,8] := 'D+'; + Grades.Cells[0,9] := 'D'; + Grades.Cells[0,10] := 'D-'; + Grades.Cells[0,11] := 'F'; + end; +end; + +procedure Tgradingfrm.ComputeBtnClick(Sender: TObject); +VAR + i, j, rows : integer; + X, Y, low, hi : double; +begin + // build AssignedGrid of grades for each Score in the ScoresGrid + for i := 0 to ncats - 1 do + begin + hi := StrToFloat(TopScoreGrid.Cells[0,i]); + low := StrToFloat(LowScoreGrid.Cells[0,i]); + for j := 0 to nints-1 do + begin + X := StrToFloat(ScoresGrid.Cells[0,j]); + if (X >= low) and (X <= hi) then GradesGrid.cells[0,j] := Grades.cells[0,i]; + end; + end; + + // Now assign grades in the gradebook + for i := 1 to ncases do // gradebook grade cells + begin + Y := StrToFloat(gradebookfrm.grid.Cells[col,i]); + for j := 0 to nints - 1 do // Grade of values in the ScoreGrid + begin + X := StrToFloat(ScoresGrid.Cells[0,j]); + if X = Y then gradebookfrm.Grid.Cells[col+4,i] := gradesGrid.Cells[0,j]; + end; + end; +end; + +initialization + {$I gradingunit.lrs} + +end. + diff --git a/applications/lazstats/source_orig/graphlib.lfm b/applications/lazstats/source_orig/graphlib.lfm new file mode 100644 index 000000000..cddc35355 --- /dev/null +++ b/applications/lazstats/source_orig/graphlib.lfm @@ -0,0 +1,56 @@ +object GraphFrm: TGraphFrm + Left = 76 + Height = 494 + Top = 112 + Width = 721 + Caption = 'Graphic Display' + ClientHeight = 494 + ClientWidth = 721 + OnShow = FormShow + LCLVersion = '0.9.30' + object Image1: TImage + Left = 0 + Height = 454 + Top = 0 + Width = 721 + Align = alClient + end + object Panel1: TPanel + Left = 0 + Height = 40 + Top = 454 + Width = 721 + Align = alBottom + ClientHeight = 40 + ClientWidth = 721 + TabOrder = 0 + object PrintBtn: TButton + Left = 391 + Height = 21 + Top = 9 + Width = 79 + Caption = 'Print' + OnClick = PrintBtnClick + TabOrder = 0 + end + object ReturnBtn: TButton + Left = 497 + Height = 20 + Top = 9 + Width = 75 + Caption = 'Return' + ModalResult = 1 + OnClick = ReturnBtnClick + TabOrder = 1 + end + object SaveBtn: TButton + Left = 288 + Height = 21 + Top = 9 + Width = 75 + Caption = 'Save Image' + OnClick = SaveBtnClick + TabOrder = 2 + end + end +end diff --git a/applications/lazstats/source_orig/graphlib.lrs b/applications/lazstats/source_orig/graphlib.lrs new file mode 100644 index 000000000..6eaf8c813 --- /dev/null +++ b/applications/lazstats/source_orig/graphlib.lrs @@ -0,0 +1,17 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('TGraphFrm','FORMDATA',[ + 'TPF0'#9'TGraphFrm'#8'GraphFrm'#4'Left'#2'L'#6'Height'#3#238#1#3'Top'#2'p'#5 + +'Width'#3#209#2#7'Caption'#6#15'Graphic Display'#12'ClientHeight'#3#238#1#11 + +'ClientWidth'#3#209#2#6'OnShow'#7#8'FormShow'#10'LCLVersion'#6#6'0.9.30'#0#6 + +'TImage'#6'Image1'#4'Left'#2#0#6'Height'#3#198#1#3'Top'#2#0#5'Width'#3#209#2 + +#5'Align'#7#8'alClient'#0#0#6'TPanel'#6'Panel1'#4'Left'#2#0#6'Height'#2'('#3 + +'Top'#3#198#1#5'Width'#3#209#2#5'Align'#7#8'alBottom'#12'ClientHeight'#2'(' + +#11'ClientWidth'#3#209#2#8'TabOrder'#2#0#0#7'TButton'#8'PrintBtn'#4'Left'#3 + +#135#1#6'Height'#2#21#3'Top'#2#9#5'Width'#2'O'#7'Caption'#6#5'Print'#7'OnCli' + +'ck'#7#13'PrintBtnClick'#8'TabOrder'#2#0#0#0#7'TButton'#9'ReturnBtn'#4'Left' + +#3#241#1#6'Height'#2#20#3'Top'#2#9#5'Width'#2'K'#7'Caption'#6#6'Return'#11'M' + +'odalResult'#2#1#7'OnClick'#7#14'ReturnBtnClick'#8'TabOrder'#2#1#0#0#7'TButt' + +'on'#7'SaveBtn'#4'Left'#3' '#1#6'Height'#2#21#3'Top'#2#9#5'Width'#2'K'#7'Cap' + +'tion'#6#10'Save Image'#7'OnClick'#7#12'SaveBtnClick'#8'TabOrder'#2#2#0#0#0#0 +]); diff --git a/applications/lazstats/source_orig/graphlib.pas b/applications/lazstats/source_orig/graphlib.pas new file mode 100644 index 000000000..f6c7db675 --- /dev/null +++ b/applications/lazstats/source_orig/graphlib.pas @@ -0,0 +1,1583 @@ +unit GraphLib; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, + ExtCtrls, StdCtrls, Globals, Printers, Math, OutPutUnit; + + +type + + { TGraphFrm } + + TGraphFrm = class(TForm) + SaveBtn: TButton; + Image1: TImage; + PrintBtn: TButton; + ReturnBtn: TButton; + Panel1: TPanel; + procedure FormShow(Sender: TObject); + procedure PrintBtnClick(Sender: TObject); + procedure ReturnBtnClick(Sender: TObject); + procedure SaveBtnClick(Sender: TObject); + private + { private declarations } + ImageWidth : integer; + ImageHeight : integer; + XOffset : integer; + YOffset : integer; + XAxisLength : integer; + YAxisLength : integer; + DegAngle : real; + RadAngle : real; + TanAngle : real; + BarWidth : integer; + XStart : integer; + XEnd : integer; + YStart : integer; + YEnd : integer; + Gtype : integer; + NoBars : integer; + NSets : integer; + YMax : real; + YMin : real; + XProp : real; + Colors : Array[0..11] of integer; + + procedure Bar2D(Sender: TObject); + procedure Bar3D(Sender: TObject); + procedure Pie2D(Sender: TObject); + procedure Pie3D(Sender: TObject); + procedure Line2D(Sender: TObject); + procedure Line3D(Sender: TObject); + procedure Plot2D(Sender: TObject); + procedure Plot3D(Sender: TObject); + procedure MakeXAxis(Sender: TObject); + procedure MakeYAxis(Sender: TObject); + procedure MakeHXaxis(Sender: TObject); + procedure MakeHYaxis(Sender: TObject); + function DegToRad(Deg : real; Sender: TObject): real; + procedure HBar2D(Sender: TObject); + procedure HBar3D(Sender: TObject); + procedure Walls(Sender: TObject); + procedure pBar2D(Sender: TObject); + procedure pBar3D(Sender: TObject); + procedure pPie2D(Sender: TObject); + procedure pExPie(Sender: TObject); + procedure pLine2D(Sender: TObject); + procedure pLine3D(Sender: TObject); + procedure pPlot2D(Sender: TObject); + procedure pPlot3D(Sender: TObject); + procedure pMakeXAxis(Sender: TObject); + procedure pMakeYaxis(Sender: TObject); + procedure pMakeHXaxis(Sender: TObject); + procedure pMakeHYaxis(Sender: TObject); + procedure pHBar2D(Sender: TObject); + procedure pHBar3D(Sender: TObject); + procedure pWalls(Sender: TObject); + + public + { public declarations } + nosets : integer; //number of data sets to plot + nbars : integer; // maximum number of bars to plot in any set + Heading : String; // Major Heading for graph + XTitle : string; // title for x-axis + YTitle : string; // title for vertical axis + barwideprop : real; // proportional width of bar (0 to 1.0) + GraphType : integer; //1=2dbar,2=3dbar,3=2dpie,4=3dpie,5=2dline,6=3dline + //7=2dpoints,8=3dpoints + Ypoints, Xpoints : DblDyneMat; + SetLabels : array[1..20] of string[21]; // labels for multiple sets + PointLabels : array[1..1000] of string[3]; // individual point labels + PtLabels : boolean; // true to print point labels (for 2D Plot only) + AutoScale : boolean; // if true, program uses computed min and max values + ShowLeftWall : boolean; + ShowRightWall : boolean; + ShowBottomWall : boolean; + ShowBackWall : boolean; + BackColor : integer; + WallColor : integer; + FloorColor : integer; + miny : double; // specified by user if autoscale is false + maxy : double; // specified by user if autoscale is false + + end; + +var + GraphFrm: TGraphFrm; + +implementation + +{ TGraphFrm } + +procedure TGraphFrm.PrintBtnClick(Sender: TObject); +begin + Printer.Orientation := poLandscape; + ImageWidth := Printer.PageWidth - 100; + ImageHeight := Printer.PageHeight - 100; + XOffset := ImageWidth div 10; + YOffset := ImageHeight div 10; + XStart := Xoffset; + XEnd := ImageWidth - XOffset; + XAxisLength := XEnd - XStart; + YStart := ImageHeight - YOffset; + YEnd := YOffset; + YAxisLength := YStart - YEnd; + DegAngle := 45.0; + RadAngle := DegToRad(DegAngle,Self); + TanAngle := Tan(RadAngle); + NoBars := nbars; + NSets := nosets; + XProp := barwideprop; + BarWidth := XAxisLength div NoBars; + // draw border around graph + Printer.BeginDoc; + BackColor := clWhite; + Printer.Canvas.Brush.Color := BackColor; + Printer.Canvas.Rectangle(100,100,ImageWidth,ImageHeight); + Printer.Canvas.TextOut(ImageWidth div 2,YEnd - 100,Heading); + GraphFrm.Caption := Heading; + if (GType < 1) or (GType > 10) then + begin +// Application.MessageBox('No graph type defined.','ERROR!',MB_OK); + Printer.Enddoc; + exit; + end + else case GType of + 1 : pBar2D(self); // two dimension vertical bars + 2 : pBar3D(self); // three dimension vertical bars + 3 : pPie2D(self); // two dimension pie chart + 4 : pExPie(self); // exploded pie chart + 5 : pLine2D(self); // Two dimension lines + 6 : pLine3D(self); // three dimension lines + 7 : pPlot2D(self); // two dimension points + 8 : pPlot3D(self); // three dimension points + 9 : pHBar2D(self); // Two dimension horizontal bars + 10: pHBar3D(self); // Three dimension horizontal bars + end; + Printer.EndDoc; { finish printing } + Printer.Orientation := poPortrait; + +end; + +procedure TGraphFrm.FormShow(Sender: TObject); +var + i, j : integer; + +begin + Gtype := 1; // default type is a 2 dimension bar graph + ImageWidth := Image1.Width; + ImageHeight := Image1.Height; + XOffset := ImageWidth div 10; + YOffset := ImageHeight div 10; + XStart := Xoffset; + XEnd := ImageWidth - XOffset; + XAxisLength := XEnd - XStart; + YStart := ImageHeight - YOffset; + YEnd := YOffset; + YAxisLength := YStart - YEnd; + DegAngle := 45.0; + RadAngle := DegToRad(DegAngle,Self); + TanAngle := Tan(RadAngle); + NoBars := nbars; + NSets := nosets; + XProp := barwideprop; + BarWidth := XAxisLength div NoBars; + GType := GraphType; + Colors[1] := clRed; + Colors[2] := clBlue; + Colors[3] := clGreen; + Colors[4] := clNavy; + Colors[5] := clTeal; + Colors[6] := clAqua; + Colors[7] := clLime; + Colors[8] := clFuchsia; + Colors[9] := clGray; + Colors[10] := clPurple; + Colors[11] := clOlive; + Colors[0] := clMaroon; + // draw border around graph + Image1.Canvas.Brush.Color := BackColor; + Image1.Canvas.Rectangle(0,0,ImageWidth,ImageHeight); + Image1.Canvas.TextOut(ImageWidth div 2,0,Heading); + GraphFrm.Caption := Heading; + if AutoScale = true then + begin + YMin := YPoints[0,0]; + YMax := YMin; + for i := 1 to NSets do + begin + for j := 2 to NoBars do + begin + if YPoints[i-1,j-1] > YMax then YMax := YPoints[i-1,j-1]; + if YPoints[i-1,j-1] < YMin then YMin := YPoints[i-1,j-1]; + end; + end; + end + else + begin + YMin := miny; + YMax := maxy; + end; + if (GType < 1) or (GType > 10) then + begin +// Application.MessageBox('No graph type defined.','ERROR!',MB_OK); + exit; + end + else case GType of + 1 : Bar2D(self); + 2 : Bar3D(self); + 3 : Pie2D(self); + 4 : Pie3D(self); + 5 : Line2D(self); + 6 : Line3D(self); + 7 : Plot2D(self); + 8 : Plot3D(self); + 9 : HBar2D(self); + 10: HBar3D(self); + end; +end; + +procedure TGraphFrm.ReturnBtnClick(Sender: TObject); +begin + GraphFrm.Hide; +end; + +procedure TGraphFrm.SaveBtnClick(Sender: TObject); +VAR + response : string; +begin + response := InputBox('NAME?','Name of bitmap file:','image.bmp'); + Image1.Picture.SaveToFile(response); +end; + +procedure TGraphFrm.Bar2D(Sender: TObject); +var + j : integer; + x1, y1, x2, y2 : integer; + bwidth : integer; + xpos : integer; + yprop : real; + ydist : real; +begin + MakeXAxis(self); + MakeYAxis(self); + { Make bar for each y data point } + for j := 1 to NoBars do + begin + Image1.Canvas.Brush.Color := Colors[j mod 12]; + bwidth := round(XProp * BarWidth); + xpos := XStart + (BarWidth * j) - (BarWidth div 2); + x1 := xpos - (bwidth div 2); + x2 := x1 + bwidth; + y1 := YStart; +// yprop := (YPoints[1]^[j]- YMin) / (YMax - YMin); + yprop := (YPoints[0,j-1] - YMin) / (YMax - YMin); + ydist := yprop * YAxisLength; + y2 := YStart - round(ydist); + Image1.Canvas.Polygon([Point(x1,y1),Point(x2,y1),Point(x2,y2),Point(x1,y2)]); + end; +end; +//--------------------------------------------------------------------- + +procedure TGraphFrm.HBar2D(Sender: TObject); +var + j : integer; + x1, y1, x2, y2 : integer; + bwidth : integer; + ypos : integer; + xdist : real; + yprop : real; +begin + BarWidth := YAxisLength div NoBars; + MakeHXAxis(self); + MakeHYAxis(self); + { Make bar for each y data point } + for j := 1 to NoBars do + begin + Image1.Canvas.Brush.Color := Colors[j mod 12]; + bwidth := round(XProp * BarWidth); + ypos := YStart - (BarWidth * j) + (BarWidth div 2); // bar center + y1 := ypos - (bwidth div 2); + y2 := y1 + bwidth; + x1 := XStart; + yprop := (YPoints[0,j-1] - YMin) / (YMax - YMin); + xdist := yprop * XAxisLength; + x2 := XStart + round(xdist); + Image1.Canvas.Polygon([Point(x1,y1),Point(x2,y1),Point(x2,y2),Point(x1,y2)]); + end; +end; +//---------------------------------------------------------------------- + +procedure TGraphFrm.HBar3D(Sender: TObject); +var + i, j : integer; + x1, x2, x3, x4, y1, y2, y3, y4 : integer; + triheight : integer; + bwidth : integer; + ypos : integer; + xdist : real; + yprop : real; +// yoffset : integer; +// xoffset : integer; + triwidth : integer; + +begin + Walls(self); // create left and bottom wall and axes + BarWidth := YAxisLength div NoBars; + Image1.Canvas.Brush.Color := BackColor; + MakeHXAxis(self); + MakeHYAxis(self); + bwidth := round(XProp * BarWidth); + triwidth := round(bwidth * cos(RadAngle)); + triheight := round(bwidth * sin(RadAngle)); + triheight := triheight div 2; // scale down depth of view + for i := 1 to NSets do + begin + xoffset := triwidth * (i - 1); + yoffset := triheight * (i - 1); + { Make bar for each y data point } + for j := 1 to NoBars do + begin + // do face + Image1.Canvas.Brush.Color := Colors[j mod 12]; + ypos := YStart - (BarWidth * j) + (BarWidth div 2); // bar center + y1 := ypos - (bwidth div 2) - yoffset; + y2 := y1 + bwidth; + x1 := XStart + xoffset; + yprop := (YPoints[0,j-1] - YMin) / (YMax - YMin); + xdist := yprop * XAxisLength; + x2 := XStart + round(xdist) + xoffset; + Image1.Canvas.Polygon([Point(x1,y1),Point(x2,y1),Point(x2,y2),Point(x1,y2)]); + // do side (end of bar ) + x1 := x2; + x2 := x1 + triwidth; + y1 := y2; + y2 := y1 - triheight; + y3 := y2 - bwidth; + y4 := y1 - bwidth; + Image1.Canvas.Polygon([Point(x1,y1),Point(x2,y2),Point(x2,y3),Point(x1,y4)]); + // do top of bar + x3 := XStart + xoffset; + x4 := x3 + triwidth; + Image1.Canvas.Polygon([Point(x3,y4),Point(x1,y4),Point(x2,y3),Point(x4,y3)]); + end; + end; +end; +//---------------------------------------------------------------------- + +procedure TGraphFrm.Bar3D(Sender: TObject); +var + i, j : integer; + x1, x2, x3, x4, y1, y2, y3, y4 : integer; + triheight : integer; + bwidth : integer; + yprop : real; +// yoffset : integer; +// xoffset : integer; + xpos : integer; + ydist : integer; + triwidth : integer; + +begin + Walls(self); // create left and bottom wall and axes + Image1.Canvas.Brush.Color := BackColor; + MakeXAxis(self); + MakeYAxis(self); + bwidth := round(XProp * BarWidth); + triwidth := round(bwidth * cos(RadAngle)); + triheight := round(bwidth * sin(RadAngle)); + triheight := triheight div 2; // scale down depth of view + for i := NSets downto 1 do + begin + xoffset := triwidth * (i - 1); + yoffset := triheight * (i - 1); + for j := 1 to NoBars do + begin + Image1.Canvas.Brush.Color := Colors[j mod 12]; + xpos := XStart + (BarWidth * j) - (BarWidth div 2); + x1 := xpos - (bwidth div 2); + x2 := x1 + bwidth; + y1 := YStart; + yprop := (YPoints[i-1,j-1] - YMin) / (YMax - YMin); + ydist := round(yprop * YAxisLength); + y2 := YStart - round(ydist); + x1 := x1 + xoffset; + x2 := x2 + xoffset; + y1 := y1 - yoffset; + y2 := y2 - yoffset; + // draw face + Image1.Canvas.Polygon([Point(x1,y1),Point(x2,y1),Point(x2,y2),Point(x1,y2)]); + // draw side + x1 := x2; + x2 := x1 + triwidth; + y2 := y1 - triheight; + y3 := y1 - round(ydist); + y4 := y2 - round(ydist); + Image1.Canvas.Polygon([Point(x1,y1),Point(x2,y2),Point(x2,y4),Point(x1,y3)]); + // draw top + x1 := xpos - (bwidth div 2) + xoffset; + x2 := x1 + bwidth; + x3 := x2 + triwidth; + x4 := x1 + triwidth; + y1 := YStart - yoffset - round(ydist); + y2 := y1 - triheight; + Image1.Canvas.Polygon([Point(x1,y1),Point(x2,y1),Point(x3,y2),Point(x4,y2)]); + end; + x1 := XStart + XAxisLength + xoffset; + y1 := YStart - triheight * i; + Image1.Canvas.Brush.Color := clWhite; + Image1.Canvas.TextOut(x1,y1,SetLabels[i]); + end; +end; +//--------------------------------------------------------------------- + +procedure TGraphFrm.Pie2D(Sender: TObject); +var + i : integer; + x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, x6, y6 : integer; + yprop : real; + xcenter, ycenter : double; + Total : double; + radians : double; + radius : integer; + cum : double; + value : string; + +begin + xcenter := ImageWidth div 2; + ycenter := ImageHeight div 2; + + // get the total for obtaining proportions that each y point is of the total + Total := 0.0; + cum := 0.0; + radius := round(ycenter) - YOffset; + x1 := ImageWidth div 2 - Image1.Canvas.TextWidth(XTitle) div 2; + Image1.Canvas.TextOut(x1,YStart + 25,XTitle); + x1 := round(xcenter-radius); // left of rectangle + y1 := round(ycenter-radius); // top of rectangle + x2 := round(xcenter + radius); // right of rectangle + y2 := round(ycenter + radius); // bottom of rectangle + x3 := x2; + y3 := round(ycenter); + for i := 1 to NoBars do Total := Total + YPoints[0,i-1]; + // plot an arc corresponding to each proportion starting at radian 0 + for i := 1 to NoBars do + begin + yprop := YPoints[0,i-1] / Total; + cum := cum + yprop; + radians := cum * 2.0 * Pi; + x4 := round(xcenter + radius * cos(radians)); + y4 := round(ycenter - (radius * sin(radians))); + Image1.Canvas.Brush.Color := Colors[i mod 12]; + if yprop > 0.0 then + begin + Image1.Canvas.Pie(x1,y1,x2,y2,x3,y3,x4,y4); + radians := (cum - (yprop / 2.0)) * 2.0 * Pi; + x5 := round(xcenter + radius * cos(radians)); + y5 := round(ycenter - radius * sin(radians)); + Image1.Canvas.MoveTo(x5,y5); + if x5 >= round(xcenter) then x6 := x5 + 20 + else x6 := x5 - 20; + if y5 >= round(ycenter) then y6 := y5 + 20 + else y6 := y5 - 20; + Image1.Canvas.LineTo(x6,y6); + Image1.Canvas.Brush.Color := BackColor; + value := format('%8.5g',[XPoints[0,i-1]]); + Image1.Canvas.TextOut(x6,y6,value); + if x5 >= round(xcenter) then x6 := x5 - 20 + else x6 := x5 + 20; + if y5 >= round(ycenter) then y6 := y5 - 20 + else y6 := y5 + 20; + value := format('%4.2f',[yprop*100.0]); + value := value + '%'; + Image1.Canvas.TextOut(x6,y6,value); + x3 := x4; + y3 := y4; + end; + end; +end; +//--------------------------------------------------------------------- + +procedure TGraphFrm.Pie3D(Sender: TObject); +var + i : integer; + x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, x6, y6 : integer; + yprop : real; + xcenter, ycenter : double; + Total : double; + radians : double; + midradians : double; + radius : integer; + cum : double; + value : string; + +begin + ycenter := ImageHeight div 2; + // get the total for obtaining proportions that each y point is of the total + Total := 0.0; + cum := 0.0; + radius := round(ycenter) - YOffset; + x1 := ImageWidth div 2 - Image1.Canvas.TextWidth(XTitle) div 2; + Image1.Canvas.TextOut(x1,YStart + 25,XTitle); + for i := 1 to NoBars do Total := Total + YPoints[0,i-1]; + // plot an arc corresponding to each proportion starting at radian 0 + for i := 1 to NoBars do + begin + xcenter := ImageWidth div 2; + ycenter := ImageHeight div 2; + yprop := YPoints[0,i-1] / Total; + cum := cum + yprop; + radians := cum * 2.0 * Pi; + midradians := (cum - (yprop / 2.0)) * 2.0 * Pi; + x5 := round(xcenter + radius * cos(midradians)); + y5 := round(ycenter - radius * sin(midradians)); + // explode pie by shifting slices away from center + if x5 >= round(xcenter) then xcenter := xcenter + 10 + else xcenter := xcenter - 10; + if y5 >= round(ycenter) then ycenter := ycenter + 10 + else ycenter := ycenter - 10; + x1 := round(xcenter-radius); // left of rectangle + y1 := round(ycenter-radius); // top of rectangle + x2 := round(xcenter + radius); // right of rectangle + y2 := round(ycenter + radius); // bottom of rectangle + midradians := (cum - yprop ) * 2.0 * Pi; + x3 := round(xcenter + radius * cos(midradians)); + y3 := round(ycenter - radius * sin(midradians)); + x4 := round(xcenter + radius * cos(radians)); + y4 := round(ycenter - (radius * sin(radians))); + Image1.Canvas.Brush.Color := Colors[i mod 12]; + if yprop > 0.0 then + begin + Image1.Canvas.Pie(x1,y1,x2,y2,x3,y3,x4,y4); + radians := (cum - (yprop / 2.0)) * 2.0 * Pi; + x5 := round(xcenter + radius * cos(radians)); + y5 := round(ycenter - radius * sin(radians)); + Image1.Canvas.MoveTo(x5,y5); + if x5 >= round(xcenter) then x6 := x5 + 20 + else x6 := x5 - 20; + if y5 >= round(ycenter) then y6 := y5 + 20 + else y6 := y5 - 20; + Image1.Canvas.LineTo(x6,y6); + Image1.Canvas.Brush.Color := BackColor; + value := format('%8.5g',[XPoints[0,i-1]]); + Image1.Canvas.TextOut(x6,y6,value); + if x5 >= round(xcenter) then x6 := x5 - 20 + else x6 := x5 + 20; + if y5 >= round(ycenter) then y6 := y5 - 20 + else y6 := y5 + 20; + value := format('%4.2f',[yprop*100.0]); + value := value + '%'; + Image1.Canvas.TextOut(x6,y6,value); + end; + end; +end; +//--------------------------------------------------------------------- + +procedure TGraphFrm.Line2D(Sender: TObject); +{ This procedure draws lines for 1 or more sets (on top of each other if + multiple sets) } +var + i, j : integer; + x1, y1, x2, y2 : integer; + xpos : integer; + yprop : real; + ydist : real; +begin + MakeXAxis(self); + MakeYAxis(self); + { Make lines for each set of y data point } + For i := NSets downto 1 do + begin + Image1.Canvas.Pen.Color := Colors[i mod 12]; + x1 := XStart + BarWidth div 2; + x2 := x1; + yprop := (YPoints[i-1,0] - YMin) / (YMax - YMin); + ydist := yprop * YAxisLength; + y1 := YStart - round(ydist); + y2 := y1; + Image1.Canvas.MoveTo(x1,y1); + for j := 2 to NoBars do + begin + xpos := XStart + (BarWidth * j) - (BarWidth div 2); + x2 := xpos; + yprop := (YPoints[i-1,j-1] - YMin) / (Ymax - YMin); + ydist := yprop * YAxisLength; + y2 := YStart - round(ydist); + Image1.Canvas.LineTo(x2,y2); + end; + Image1.Canvas.Pen.Color := clBlack; + x1 := x2; + y1 := y2; + Image1.Canvas.Brush.Color := clWhite; + Image1.Canvas.TextOut(x1,y1,SetLabels[i]); + end; + Image1.Canvas.Pen.Color := clBlack; +end; +//--------------------------------------------------------------------- + +procedure TGraphFrm.Line3D(Sender: TObject); +{ This procedure draws lines for multiple sets but staggers each set back and + to the right } +var + i, j : integer; + x1, x2, x3, x4, y1, y2, y3, y4 : integer; + triheight : integer; + bwidth : integer; + yprop : double; + points : array[0..4] of TPoint; + xpos : integer; + ydist : integer; + triwidth : integer; +begin + + Walls(self); // create left and bottom wall and axes + Image1.Canvas.Brush.Color := BackColor; + MakeXAxis(self); + MakeYAxis(self); + bwidth := BarWidth; + triwidth := round(bwidth * cos(RadAngle)); + triheight := round(bwidth * sin(RadAngle)); + triheight := triheight div 2; // scale down depth of view + for i := NSets downto 1 do + begin + xoffset := triwidth * (i - 1); + yoffset := triheight * (i - 1); + Image1.Canvas.Brush.Color := Colors[i mod 12]; + for j := 1 to NoBars-1 do + begin + xpos := XStart + (BarWidth * j) - (BarWidth div 2); + x1 := xpos - (bwidth div 2) + xoffset; + x2 := x1 + bwidth; + x3 := x2 + triwidth; + x4 := x1 + triwidth; + yprop := (YPoints[i-1,j-1] - YMin) / (YMax - YMin); + ydist := round(yprop * YAxisLength); + y1 := YStart - yoffset - round(ydist); + y2 := y1 - triheight; + yprop := (YPoints[i-1,j] - YMin) / (YMax - YMin); + ydist := round(yprop * YAxisLength); + y3 := ystart - yoffset - round(ydist); + y4 := y3 - triheight; + points[0] := Point(x1,y1); + points[1] := Point(x2,y2); + points[2] := Point(x3,y4); + points[3] := Point(x4,y3); + Image1.Canvas.Polygon(points,4); + end; + x1 := XStart + XAxisLength + xoffset; + y1 := YStart - triheight * i; + Image1.Canvas.Brush.Color := clWhite; + Image1.Canvas.TextOut(x1,y1,SetLabels[i]); + end; +end; +//--------------------------------------------------------------------- + +procedure TGraphFrm.Plot2D(Sender: TObject); +var + i, j : integer; + x1, y1 : integer; + triheight : integer; + bwidth : integer; + yprop : real; +// yoffset : integer; +// xoffset : integer; + xpos : integer; + ydist : integer; + triwidth : integer; +begin + Walls(self); // create left and bottom wall and axes + Image1.Canvas.Brush.Color := BackColor; + MakeXAxis(self); + MakeYAxis(self); + bwidth := round(XProp * BarWidth); + triwidth := round(bwidth * cos(RadAngle)); + triheight := round(bwidth * sin(RadAngle)); + triheight := triheight div 2; // scale down depth of view + { Make points for each set of y data point } + for i := NSets downto 1 do + begin + Image1.Canvas.Brush.Color := Colors[i mod 12]; + xoffset := triwidth * (i - 1); + yoffset := triheight * (i - 1); + for j := 1 to NoBars do + begin + xpos := XStart + (BarWidth * j) - (BarWidth div 2); + x1 := xpos; + yprop := (YPoints[i-1,j-1] - YMin) / (YMax - YMin); + ydist := round(yprop * YAxisLength); + y1 := YStart - round(ydist); + x1 := x1 + xoffset; + y1 := y1 - yoffset; + if PtLabels then + begin + Image1.Canvas.Brush.Color := BackColor; + Image1.Canvas.TextOut(x1,y1,PointLabels[j]); + end + else + Image1.Canvas.Ellipse(x1-5,y1-5,x1+5,y1+5); + end; + Image1.Canvas.Pen.Color := clBlack; + x1 := XStart + XAxisLength + xoffset; + y1 := YStart - triheight * i; + Image1.Canvas.Brush.Color := clWhite; + Image1.Canvas.TextOut(x1,y1,SetLabels[i]); + end; +end; +//--------------------------------------------------------------------- + +procedure TGraphFrm.Plot3D(Sender: TObject); +var + i, j : integer; + x1, y1 : integer; + yprop : real; + triheight : integer; + bwidth : integer; +// yoffset : integer; +// xoffset : integer; + xpos : integer; + ydist : integer; + triwidth : integer; +begin + Walls(self); // create left and bottom wall and axes + Image1.Canvas.Brush.Color := BackColor; + MakeXAxis(self); + MakeYAxis(self); + bwidth := round(XProp * BarWidth); + triwidth := round(bwidth * cos(RadAngle)); + triheight := round(bwidth * sin(RadAngle)); + triheight := triheight div 2; // scale down depth of view + { Make points for each set of y data point } + for i := NSets downto 1 do + begin + Image1.Canvas.Brush.Color := Colors[i mod 12]; + xoffset := triwidth * (i - 1); + yoffset := triheight * (i - 1); + for j := 1 to NoBars do + begin + xpos := XStart + (BarWidth * j) - (BarWidth div 2); + x1 := xpos; + yprop := (YPoints[i-1,j-1] - YMin) / (YMax - YMin); + ydist := round(yprop * YAxisLength); + y1 := YStart - round(ydist); + x1 := x1 + xoffset; + y1 := y1 - yoffset; + // change next to a ball by drawing multiple Ellipses around + // vertical axis ? + Image1.Canvas.Ellipse(x1-5,y1-5,x1+5,y1+5); + Image1.Canvas.Ellipse(x1-4,y1-5,x1+4,y1+5); + Image1.Canvas.Ellipse(x1-3,y1-5,x1+3,y1+5); + Image1.Canvas.Ellipse(x1-2,y1-5,x1+2,y1+5); + end; + Image1.Canvas.Pen.Color := clBlack; + x1 := XStart + XAxisLength + xoffset; + y1 := YStart - triheight * i; + Image1.Canvas.Brush.Color := clWhite; + Image1.Canvas.TextOut(x1,y1,SetLabels[i]); + end; +end; +//--------------------------------------------------------------------- + +procedure TGraphFrm.MakeXAxis(Sender: TObject); +var + i, valstart, valend, oldend : integer; + xpos : integer; + value : string; +begin + Image1.Canvas.MoveTo(XStart,YStart); + Image1.Canvas.LineTo(XEnd,YStart); + oldend := 0; + for i := 1 to NoBars do + begin + xpos := XStart + (BarWidth * i) - (BarWidth div 2); + Image1.Canvas.MoveTo(xpos,YStart); + Image1.Canvas.LineTo(xpos,YStart + 5); + value := format('%6.5g',[XPoints[0,i-1]]); + valstart := xpos - Image1.Canvas.TextWidth(value) div 2; + valend := valstart + Image1.Canvas.TextWidth(value); + if valstart > oldend then + begin + Image1.Canvas.TextOut(valstart,YStart+10,value); + oldend := valend; + end; + end; + xpos := ImageWidth div 2 - Image1.Canvas.TextWidth(XTitle) div 2; + Image1.Canvas.TextOut(xpos,YStart + 25,XTitle); +end; +//--------------------------------------------------------------------- + +procedure TGraphFrm.MakeYAxis(Sender: TObject); +var + ypos : integer; + i : integer; + incr : real; + value : real; + valstring : string; + +begin + Image1.Canvas.MoveTo(XStart,YStart); + Image1.Canvas.LineTo(XStart,YEnd); + incr := (YMax - YMin) / 20.0; + for i := 1 to 21 do + begin + value := YMin + (incr * (i-1)); + ypos := YStart - ((i-1) * YAxisLength div 20); + Image1.Canvas.MoveTo(XStart,ypos); + Image1.Canvas.LineTo(XStart-10,ypos); + valstring := format('%8.2f',[value]); + Image1.Canvas.TextOut(5, ypos,valstring); + end; + ypos := YEnd - 10 - Canvas.TextHeight(YTitle); + Image1.Canvas.TextOut(0,ypos,YTitle); +end; +//--------------------------------------------------------------------- + +procedure TGraphFrm.MakeHXaxis(Sender: TObject); +var + xpos : integer; + i : integer; + incr : real; + value : real; + valstring : string; + +begin + Image1.Canvas.MoveTo(XStart,YStart); + Image1.Canvas.LineTo(XEnd,YStart); + incr := (YMax - YMin) / 20.0; + for i := 1 to 21 do + begin + value := YMin + (incr * (i-1)); + xpos := XStart + ((i-1) * XAxisLength div 20); + Image1.Canvas.MoveTo(xpos,YStart); + Image1.Canvas.LineTo(xpos,YStart + 5); + valstring := format('%6.2f',[value]); + Image1.Canvas.TextOut(xpos - Image1.Canvas.TextWidth(valstring) div 2, + YStart + 10,FloatToStr(value)); + end; + xpos := XAxisLength div 2 - Image1.Canvas.TextWidth(YTitle) div 2; + Image1.Canvas.TextOut(xpos,YStart + 20,YTitle); +end; +//--------------------------------------------------------------------- + +procedure TGraphFrm.MakeHYaxis(Sender: TObject); +var + i : integer; + ypos : integer; + value : string; +begin + Image1.Canvas.MoveTo(XStart,YStart); + Image1.Canvas.LineTo(XStart,YEnd); + for i := 1 to NoBars do + begin + ypos := YStart - (BarWidth * i) + (BarWidth div 2); + Image1.Canvas.MoveTo(XStart,ypos); + Image1.Canvas.LineTo(XStart - 10,ypos); + value := format('%6.5g',[XPoints[0,i-1]]); + Image1.Canvas.TextOut(XStart-10-Image1.Canvas.TextWidth(value), + ypos,value); + end; + ypos := YEnd; + Image1.Canvas.TextOut(0,ypos,XTitle); +end; +//--------------------------------------------------------------------- + +function TGraphFrm.DegToRad(Deg : real; Sender : TObject): real; +begin + Result := Deg * Pi / 180.0; +end; +//--------------------------------------------------------------------- + +procedure TGraphFrm.Walls(Sender: TObject); +var + deep : integer; + triheight : integer; + x1, x2,x3, x4, y1, y2, y3, y4 : integer; // polygon vertices + bwide : integer; +// xoffset : integer; + +begin + bwide := round(BarWidth * XProp); + xoffset := round(bwide * cos(RadAngle)); + XAxisLength := XAxisLength - (NSets * xoffset); // new length of X Axis + XEnd := XStart + XAxisLength; + BarWidth := XAxisLength div NoBars; //Adjusted bar width + bwide := round(BarWidth * XProp); + xoffset := round(bwide * cos(RadAngle)); + deep := xoffset * NSets; + triheight := round(bwide * sin(RadAngle) * NSets); // total height of additional y needed + triheight := triheight div 2; // scale down depth of view + YAxisLength := YAxisLength - triheight; + YEnd := YStart - YAxisLength; + // do left wall + x1 := XStart; + x2 := x1 + deep; + y1 := YStart; + y2 := YStart - triheight; + y3 := YStart - YAxisLength - triheight; + y4 := YEnd; + Image1.Canvas.Brush.Color := WallColor; + Image1.Canvas.Polygon([Point(x1,y1),Point(x2,y2),Point(x2,y3),Point(x1,y4)]); + // do floor + x1 := XStart; + x2 := XStart + deep; + x3 := XEnd; + x4 := XEnd + deep; + y1 := YStart; + y2 := YStart - triheight; + Image1.Canvas.Brush.Color := FloorColor; + Image1.Canvas.Polygon([Point(x1,y1),Point(x3,y1),Point(x4,y2),Point(x2,y2)]); +end; +//----------------------------------------------------------------------- +procedure TGraphFrm.pHBar2D(Sender: TObject); +var + j : integer; + x1, y1, x2, y2 : integer; + bwidth : integer; + ypos : integer; + xdist : real; + yprop : real; +begin + BarWidth := YAxisLength div NoBars; + pMakeHXAxis(self); + pMakeHYAxis(self); + { Make bar for each y data point } + for j := 1 to NoBars do + begin + Printer.Canvas.Brush.Color := Colors[j mod 12]; + bwidth := round(XProp * BarWidth); + ypos := YStart - (BarWidth * j) + (BarWidth div 2); // bar center + y1 := ypos - (bwidth div 2); + y2 := y1 + bwidth; + x1 := XStart; + yprop := (YPoints[0,j-1] - YMin) / (YMax - YMin); + xdist := yprop * XAxisLength; + x2 := XStart + round(xdist); + Printer.Canvas.Polygon([Point(x1,y1),Point(x2,y1),Point(x2,y2),Point(x1,y2)]); + end; +end; +//----------------------------------------------------------------------- + +procedure TGraphFrm.pHBar3D(Sender: TObject); +var + i, j : integer; + x1, x2, x3, x4, y1, y2, y3, y4 : integer; + triheight : integer; + bwidth : integer; + ypos : integer; + xdist : real; + yprop : real; +// yoffset : integer; +// xoffset : integer; + triwidth : integer; + +begin + pWalls(self); // create left and bottom wall and axes + BarWidth := YAxisLength div NoBars; + Printer.Canvas.Brush.Color := BackColor; + pMakeHXAxis(self); + pMakeHYAxis(self); + bwidth := round(XProp * BarWidth); + triwidth := round(bwidth * cos(RadAngle)); + triheight := round(bwidth * sin(RadAngle)); + triheight := triheight div 2; // scale down depth of view + for i := 1 to NSets do + begin + xoffset := triwidth * (i - 1); + yoffset := triheight * (i - 1); + { Make bar for each y data point } + for j := 1 to NoBars do + begin + // do face + Printer.Canvas.Brush.Color := Colors[j mod 12]; + ypos := YStart - (BarWidth * j) + (BarWidth div 2); // bar center + y1 := ypos - (bwidth div 2) - yoffset; + y2 := y1 + bwidth; + x1 := XStart + xoffset; + yprop := (YPoints[0,j-1] - YMin) / (YMax - YMin); + xdist := yprop * XAxisLength; + x2 := XStart + round(xdist) + xoffset; + Printer.Canvas.Polygon([Point(x1,y1),Point(x2,y1),Point(x2,y2),Point(x1,y2)]); + // do side (end of bar ) + x1 := x2; + x2 := x1 + triwidth; + y1 := y2; + y2 := y1 - triheight; + y3 := y2 - bwidth; + y4 := y1 - bwidth; + Printer.Canvas.Polygon([Point(x1,y1),Point(x2,y2),Point(x2,y3),Point(x1,y4)]); + // do top of bar + x3 := XStart + xoffset; + x4 := x3 + triwidth; + Printer.Canvas.Polygon([Point(x3,y4),Point(x1,y4),Point(x2,y3),Point(x4,y3)]); + end; + end; +end; +//----------------------------------------------------------------------- +procedure TGraphFrm.pWalls(Sender: TObject); +var + deep : integer; + triheight : integer; + x1, x2,x3, x4, y1, y2, y3, y4 : integer; // polygon vertices + bwide : integer; +// xoffset : integer; + +begin + bwide := round(BarWidth * XProp); + xoffset := round(bwide * cos(RadAngle)); + XAxisLength := XAxisLength - (NSets * xoffset); // new length of X Axis + XEnd := XStart + XAxisLength; + BarWidth := XAxisLength div NoBars; //Adjusted bar width + bwide := round(BarWidth * XProp); + xoffset := round(bwide * cos(RadAngle)); + deep := xoffset * NSets; + triheight := round(bwide * sin(RadAngle) * NSets); // total height of additional y needed + triheight := triheight div 2; // scale down depth of view + YAxisLength := YAxisLength - triheight; + YEnd := YStart - YAxisLength; + // do left wall + x1 := XStart; + x2 := x1 + deep; + y1 := YStart; + y2 := YStart - triheight; + y3 := YStart - YAxisLength - triheight; + y4 := YEnd; + Printer.Canvas.Brush.Color := WallColor; + Printer.Canvas.Polygon([Point(x1,y1),Point(x2,y2),Point(x2,y3),Point(x1,y4)]); + // do floor + x1 := XStart; + x2 := XStart + deep; + x3 := XEnd; + x4 := XEnd + deep; + y1 := YStart; + y2 := YStart - triheight; + Printer.Canvas.Brush.Color := FloorColor; + Printer.Canvas.Polygon([Point(x1,y1),Point(x3,y1),Point(x4,y2),Point(x2,y2)]); +end; +//----------------------------------------------------------------------- +procedure TGraphFrm.pBar2D(Sender: TObject); +var + j : integer; + x1, y1, x2, y2 : integer; + bwidth : integer; + xpos : integer; + yprop : real; + ydist : real; +begin + pMakeXAxis(self); + pMakeYAxis(self); + { Make bar for each y data point } + for j := 1 to NoBars do + begin + Printer.Canvas.Brush.Color := Colors[j mod 12]; + bwidth := round(XProp * BarWidth); + xpos := XStart + (BarWidth * j) - (BarWidth div 2); + x1 := xpos - (bwidth div 2); + x2 := x1 + bwidth; + y1 := YStart; + yprop := (YPoints[0,j-1] - YMin) / (YMax - YMin); + ydist := yprop * YAxisLength; + y2 := YStart - round(ydist); + Printer.Canvas.Polygon([Point(x1,y1),Point(x2,y1),Point(x2,y2),Point(x1,y2)]); + end; +end; +//----------------------------------------------------------------------- +procedure TGraphFrm.pBar3D(Sender: TObject); +var + i, j : integer; + x1, x2, x3, x4, y1, y2, y3, y4 : integer; + triheight : integer; + bwidth : integer; + yprop : real; +// yoffset : integer; +// xoffset : integer; + xpos : integer; + ydist : integer; + triwidth : integer; + +begin + pWalls(self); // create left and bottom wall and axes + Printer.Canvas.Brush.Color := BackColor; + pMakeXAxis(self); + pMakeYAxis(self); + bwidth := round(XProp * BarWidth); + triwidth := round(bwidth * cos(RadAngle)); + triheight := round(bwidth * sin(RadAngle)); + triheight := triheight div 2; // scale down depth of view + for i := NSets downto 1 do + begin + xoffset := triwidth * (i - 1); + yoffset := triheight * (i - 1); + for j := 1 to NoBars do + begin + Printer.Canvas.Brush.Color := Colors[j mod 12]; + xpos := XStart + (BarWidth * j) - (BarWidth div 2); + x1 := xpos - (bwidth div 2); + x2 := x1 + bwidth; + y1 := YStart; + yprop := (YPoints[i-1,j-1] - YMin) / (YMax - YMin); + ydist := round(yprop * YAxisLength); + y2 := YStart - round(ydist); + x1 := x1 + xoffset; + x2 := x2 + xoffset; + y1 := y1 - yoffset; + y2 := y2 - yoffset; + // draw face + Printer.Canvas.Polygon([Point(x1,y1),Point(x2,y1),Point(x2,y2),Point(x1,y2)]); + // draw side + x1 := x2; + x2 := x1 + triwidth; + y2 := y1 - triheight; + y3 := y1 - round(ydist); + y4 := y2 - round(ydist); + Printer.Canvas.Polygon([Point(x1,y1),Point(x2,y2),Point(x2,y4),Point(x1,y3)]); + // draw top + x1 := xpos - (bwidth div 2) + xoffset; + x2 := x1 + bwidth; + x3 := x2 + triwidth; + x4 := x1 + triwidth; + y1 := YStart - yoffset - round(ydist); + y2 := y1 - triheight; + Printer.Canvas.Polygon([Point(x1,y1),Point(x2,y1),Point(x3,y2),Point(x4,y2)]); + end; + x1 := XStart + XAxisLength + xoffset; + y1 := YStart - triheight * i; + Printer.Canvas.Brush.Color := clWhite; + Printer.Canvas.TextOut(x1,y1,SetLabels[i]); + end; +end; +//----------------------------------------------------------------------- +procedure TGraphFrm.pPie2D(Sender: TObject); +var + i : integer; + x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, x6, y6 : integer; + yprop : real; + xcenter, ycenter : double; + Total : double; + radians : double; + radius : integer; + cum : double; + value : string; + +begin + xcenter := ImageWidth div 2; + ycenter := ImageHeight div 2; + + // get the total for obtaining proportions that each y point is of the total + Total := 0.0; + cum := 0.0; + radius := round(ycenter) - YOffset; + x1 := ImageWidth div 2 - Printer.Canvas.TextWidth(XTitle) div 2; + Printer.Canvas.TextOut(x1,YStart + 25,XTitle); + x1 := round(xcenter-radius); // left of rectangle + y1 := round(ycenter-radius); // top of rectangle + x2 := round(xcenter + radius); // right of rectangle + y2 := round(ycenter + radius); // bottom of rectangle + x3 := x2; + y3 := round(ycenter); + for i := 1 to NoBars do Total := Total + YPoints[0,i-1]; + // plot an arc corresponding to each proportion starting at radian 0 + for i := 1 to NoBars do + begin + yprop := YPoints[0,i-1] / Total; + cum := cum + yprop; + radians := cum * 2.0 * Pi; + x4 := round(xcenter + radius * cos(radians)); + y4 := round(ycenter - (radius * sin(radians))); + Printer.Canvas.Brush.Color := Colors[i mod 12]; + if yprop > 0.0 then + begin + Printer.Canvas.Pie(x1,y1,x2,y2,x3,y3,x4,y4); + radians := (cum - (yprop / 2.0)) * 2.0 * Pi; + x5 := round(xcenter + radius * cos(radians)); + y5 := round(ycenter - radius * sin(radians)); + Printer.Canvas.MoveTo(x5,y5); + if x5 >= round(xcenter) then x6 := x5 + 50 + else x6 := x5 - 50; + if y5 >= round(ycenter) then y6 := y5 + 50 + else y6 := y5 - 50; + Printer.Canvas.LineTo(x6,y6); + Printer.Canvas.Brush.Color := BackColor; + value := format('%8.5g',[XPoints[0,i-1]]); + Printer.Canvas.TextOut(x6,y6,value); + if x5 >= round(xcenter) then x6 := x5 - 50 + else x6 := x5 + 50; + if y5 >= round(ycenter) then y6 := y5 - 50 + else y6 := y5 + 50; + value := format('%4.2f',[yprop*100.0]); + value := value + '%'; + Printer.Canvas.TextOut(x6,y6,value); + x3 := x4; + y3 := y4; + end; + end; +end; +//----------------------------------------------------------------------- +procedure TGraphFrm.pExPie(Sender: TObject); +var + i : integer; + x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, x6, y6 : integer; + yprop : real; + xcenter, ycenter : double; + Total : double; + radians : double; + midradians : double; + radius : integer; + cum : double; + value : string; + +begin + ycenter := ImageHeight div 2; + // get the total for obtaining proportions that each y point is of the total + Total := 0.0; + cum := 0.0; + radius := round(ycenter) - YOffset; + x1 := ImageWidth div 2 - Printer.Canvas.TextWidth(XTitle) div 2; + Printer.Canvas.TextOut(x1,YStart + 25,XTitle); + for i := 1 to NoBars do Total := Total + YPoints[0,i-1]; + // plot an arc corresponding to each proportion starting at radian 0 + for i := 1 to NoBars do + begin + xcenter := ImageWidth div 2; + ycenter := ImageHeight div 2; + yprop := YPoints[0,i-1] / Total; + cum := cum + yprop; + radians := cum * 2.0 * Pi; + midradians := (cum - (yprop / 2.0)) * 2.0 * Pi; + x5 := round(xcenter + radius * cos(midradians)); + y5 := round(ycenter - radius * sin(midradians)); + // explode pie by shifting slices away from center + if x5 >= round(xcenter) then xcenter := xcenter + 10 + else xcenter := xcenter - 10; + if y5 >= round(ycenter) then ycenter := ycenter + 10 + else ycenter := ycenter - 10; + x1 := round(xcenter-radius); // left of rectangle + y1 := round(ycenter-radius); // top of rectangle + x2 := round(xcenter + radius); // right of rectangle + y2 := round(ycenter + radius); // bottom of rectangle + midradians := (cum - yprop ) * 2.0 * Pi; + x3 := round(xcenter + radius * cos(midradians)); + y3 := round(ycenter - radius * sin(midradians)); + x4 := round(xcenter + radius * cos(radians)); + y4 := round(ycenter - (radius * sin(radians))); + Printer.Canvas.Brush.Color := Colors[i mod 12]; + if yprop > 0.0 then + begin + Printer.Canvas.Pie(x1,y1,x2,y2,x3,y3,x4,y4); + radians := (cum - (yprop / 2.0)) * 2.0 * Pi; + x5 := round(xcenter + radius * cos(radians)); + y5 := round(ycenter - radius * sin(radians)); + Printer.Canvas.MoveTo(x5,y5); + if x5 >= round(xcenter) then x6 := x5 + 50 + else x6 := x5 - 50; + if y5 >= round(ycenter) then y6 := y5 + 50 + else y6 := y5 - 50; + Printer.Canvas.LineTo(x6,y6); + Printer.Canvas.Brush.Color := BackColor; + value := format('%8.5g',[XPoints[0,i-1]]); + Printer.Canvas.TextOut(x6,y6,value); + if x5 >= round(xcenter) then x6 := x5 - 50 + else x6 := x5 + 50; + if y5 >= round(ycenter) then y6 := y5 - 50 + else y6 := y5 + 50; + value := format('%4.2f',[yprop*100.0]); + value := value + '%'; + Printer.Canvas.TextOut(x6,y6,value); + end; + end; +end; +//----------------------------------------------------------------------- +procedure TGraphFrm.pLine2D(Sender: TObject); +var + i, j : integer; + x1, y1, x2, y2 : integer; + xpos : integer; + yprop : real; + ydist : real; +begin + pMakeXAxis(self); + pMakeYAxis(self); + { Make lines for each set of y data point } + For i := 1 to NSets do + begin + Printer.Canvas.Brush.Color := Colors[i mod 12]; + x1 := XStart + BarWidth div 2; + yprop := (YPoints[i-1,0] - YMin) / (YMax - YMin); + ydist := yprop * YAxisLength; + y1 := YStart - round(ydist); + Printer.Canvas.MoveTo(x1,y1); + for j := 2 to NoBars do + begin + xpos := XStart + (BarWidth * j) - (BarWidth div 2); + x2 := xpos; + yprop := (YPoints[i-1,j-1] - YMin) / (YMax - YMin); + ydist := yprop * YAxisLength; + y2 := YStart - round(ydist); + Printer.Canvas.LineTo(x2,y2); + end; + end; +end; +//----------------------------------------------------------------------- +procedure TGraphFrm.pLine3D(Sender: TObject); +var + i, j : integer; + x1, x2, y1, y2 : integer; + triheight : integer; + bwidth : integer; + yprop : real; +// yoffset : integer; +// xoffset : integer; + xpos : integer; + ydist : integer; + triwidth : integer; + +begin + pWalls(self); // create left and bottom wall and axes + Printer.Canvas.Brush.Color := BackColor; + pMakeXAxis(self); + pMakeYAxis(self); + XProp := 1.0; + bwidth := round(XProp * BarWidth); + triwidth := round(bwidth * cos(RadAngle)); + triheight := round(bwidth * sin(RadAngle)); + triheight := triheight div 2; // scale down depth of view + for i := NSets downto 1 do + begin + xoffset := triwidth * (i - 1); + yoffset := triheight * (i - 1); + for j := 1 to NoBars do + begin + //Image1.Canvas.Brush.Color := Colors[j mod 12]; + Printer.Canvas.Pen.Color := Colors[i mod 12]; + xpos := XStart + (BarWidth * j) - (BarWidth div 2); + x1 := xpos - (bwidth div 2); + x2 := x1 + bwidth; + y1 := YStart; + yprop := (YPoints[i-1,j-1] - YMin) / (YMax - YMin); + ydist := round(yprop * YAxisLength); + y2 := YStart - round(ydist); + x1 := x1 + xoffset; + x2 := x2 + xoffset; + y1 := y1 - yoffset; + y2 := y2 - yoffset; + Printer.Canvas.MoveTo(x1,y1); + Printer.Canvas.LineTo(x2,y2); + end; + Printer.Canvas.Pen.Color := clBlack; + x1 := XStart + XAxisLength + xoffset; + y1 := YStart - triheight * i; + Printer.Canvas.Brush.Color := clWhite; + Printer.Canvas.TextOut(x1,y1,SetLabels[i]); + end; +end; +//----------------------------------------------------------------------- +procedure TGraphFrm.pPlot2D(Sender: TObject); +var + i, j : integer; + x1, y1 : integer; + triheight : integer; + bwidth : integer; + yprop : real; +// yoffset : integer; +// xoffset : integer; + xpos : integer; + ydist : integer; + triwidth : integer; +begin + pWalls(self); // create left and bottom wall and axes + Printer.Canvas.Brush.Color := BackColor; + pMakeXAxis(self); + pMakeYAxis(self); + bwidth := round(XProp * BarWidth); + triwidth := round(bwidth * cos(RadAngle)); + triheight := round(bwidth * sin(RadAngle)); + triheight := triheight div 2; // scale down depth of view + { Make points for each set of y data point } + for i := NSets downto 1 do + begin + Printer.Canvas.Brush.Color := Colors[i mod 12]; + xoffset := triwidth * (i - 1); + yoffset := triheight * (i - 1); + for j := 1 to NoBars do + begin + xpos := XStart + (BarWidth * j) - (BarWidth div 2); + x1 := xpos; + yprop := (YPoints[i-1,j-1] - YMin) / (YMax - YMin); + ydist := round(yprop * YAxisLength); + y1 := YStart - round(ydist); + x1 := x1 + xoffset; + y1 := y1 - yoffset; + if PtLabels then + begin + Printer.Canvas.Brush.Color := BackColor; + Printer.Canvas.TextOut(x1,y1,PointLabels[j]); + end + else + Printer.Canvas.Ellipse(x1-5,y1-5,x1+5,y1+5); + end; + Printer.Canvas.Pen.Color := clBlack; + x1 := XStart + XAxisLength + xoffset; + y1 := YStart - triheight * i; + Printer.Canvas.Brush.Color := clWhite; + Printer.Canvas.TextOut(x1,y1,SetLabels[i]); + end; +end; +//----------------------------------------------------------------------- +procedure TGraphFrm.pPlot3D(Sender: TObject); +var + i, j : integer; + x1, y1 : integer; + yprop : real; + triheight : integer; + bwidth : integer; +// yoffset : integer; +// xoffset : integer; + xpos : integer; + ydist : integer; + triwidth : integer; +begin + pWalls(self); // create left and bottom wall and axes + Printer.Canvas.Brush.Color := BackColor; + pMakeXAxis(self); + pMakeYAxis(self); + bwidth := round(XProp * BarWidth); + triwidth := round(bwidth * cos(RadAngle)); + triheight := round(bwidth * sin(RadAngle)); + triheight := triheight div 2; // scale down depth of view + { Make points for each set of y data point } + for i := NSets downto 1 do + begin + Printer.Canvas.Brush.Color := Colors[i mod 12]; + xoffset := triwidth * (i - 1); + yoffset := triheight * (i - 1); + for j := 1 to NoBars do + begin + xpos := XStart + (BarWidth * j) - (BarWidth div 2); + x1 := xpos; + yprop := (YPoints[i-1,j-1] - YMin) / (YMax - YMin); + ydist := round(yprop * YAxisLength); + y1 := YStart - round(ydist); + x1 := x1 + xoffset; + y1 := y1 - yoffset; + // change next to a ball by drawing multiple Ellipses around + // vertical axis ? + Printer.Canvas.Ellipse(x1-5,y1-5,x1+5,y1+5); + Printer.Canvas.Ellipse(x1-4,y1-5,x1+4,y1+5); + Printer.Canvas.Ellipse(x1-3,y1-5,x1+3,y1+5); + Printer.Canvas.Ellipse(x1-2,y1-5,x1+2,y1+5); + end; + Printer.Canvas.Pen.Color := clBlack; + x1 := XStart + XAxisLength + xoffset; + y1 := YStart - triheight * i; + Printer.Canvas.Brush.Color := clWhite; + Printer.Canvas.TextOut(x1,y1,SetLabels[i]); + end; +end; +//----------------------------------------------------------------------- +procedure TGraphFrm.pMakeXAxis(Sender: TObject); +var + i, valstart, valend, oldend : integer; + xpos : integer; + value : string; +begin + Printer.Canvas.MoveTo(XStart,YStart); + Printer.Canvas.LineTo(XEnd,YStart); + oldend := 0; + for i := 1 to NoBars do + begin + xpos := XStart + (BarWidth * i) - (BarWidth div 2); + Printer.Canvas.MoveTo(xpos,YStart); + Printer.Canvas.LineTo(xpos,YStart + 5); + value := format('%6.5g',[XPoints[0,i-1]]); + valstart := xpos - Printer.Canvas.TextWidth(value) div 2; + valend := valstart + Printer.Canvas.TextWidth(value); + if valstart > oldend then + begin + Printer.Canvas.TextOut(valstart,YStart + 10,value); + oldend := valend; + end; + end; + xpos := ImageWidth div 2 - Printer.Canvas.TextWidth(XTitle) div 2; + Printer.Canvas.TextOut(xpos,YStart + 100,XTitle); +end; +//----------------------------------------------------------------------- +procedure TGraphFrm.pMakeYaxis(Sender: TObject); +var + ypos : integer; + i : integer; + incr : real; + value : real; + valstring : string; + +begin + Printer.Canvas.MoveTo(XStart,YStart); + Printer.Canvas.LineTo(XStart,YEnd); + incr := (YMax - YMin) / 20.0; + for i := 1 to 21 do + begin + value := YMin + (incr * (i-1)); + ypos := YStart - ((i-1) * YAxisLength div 20); + Printer.Canvas.MoveTo(XStart,ypos); + Printer.Canvas.LineTo(XStart-10,ypos); + valstring := format('%10.2f',[value]); + Printer.Canvas.TextOut(XStart - 10 - Printer.Canvas.TextWidth(valstring),ypos,valstring); + end; + ypos := YEnd - 10 - Printer.Canvas.TextHeight(YTitle); + Printer.Canvas.TextOut(100,ypos,YTitle); +end; +//----------------------------------------------------------------------- +procedure TGraphFrm.pMakeHXaxis(Sender: TObject); +var + xpos : integer; + i : integer; + incr : real; + value : real; + valstring : string; + +begin + Printer.Canvas.MoveTo(XStart,YStart); + Printer.Canvas.LineTo(XEnd,YStart); + incr := (YMax - YMin) / 20.0; + for i := 1 to 21 do + begin + value := YMin + (incr * (i-1)); + xpos := XStart + ((i-1) * XAxisLength div 20); + Printer.Canvas.MoveTo(xpos,YStart); + Printer.Canvas.LineTo(xpos,YStart + 5); + valstring := format('%8.2f',[value]); + Printer.Canvas.TextOut(xpos - Printer.Canvas.TextWidth(valstring) div 2, + YStart + 10,FloatToStr(value)); + end; + xpos := XAxisLength div 2 - Printer.Canvas.TextWidth(YTitle) div 2; + Printer.Canvas.TextOut(xpos,YStart + 100,YTitle); +end; +//----------------------------------------------------------------------- +procedure TGraphFrm.pMakeHYaxis(Sender: TObject); +var + i : integer; + ypos : integer; + value : string; +begin + Printer.Canvas.MoveTo(XStart,YStart); + Printer.Canvas.LineTo(XStart,YEnd); + for i := 1 to NoBars do + begin + ypos := YStart - (BarWidth * i) + (BarWidth div 2); + Printer.Canvas.MoveTo(XStart,ypos); + Printer.Canvas.LineTo(XStart - 10,ypos); + value := format('%6.5g',[XPoints[0,i-1]]); + Printer.Canvas.TextOut(XStart-10-Printer.Canvas.TextWidth(value), + ypos,value); + end; + ypos := YEnd; + Printer.Canvas.TextOut(100,ypos,XTitle); +end; +//----------------------------------------------------------------------- + +initialization + {$I graphlib.lrs} + +end. + diff --git a/applications/lazstats/source_orig/gridhelpunit.lfm b/applications/lazstats/source_orig/gridhelpunit.lfm new file mode 100644 index 000000000..63849d7f4 --- /dev/null +++ b/applications/lazstats/source_orig/gridhelpunit.lfm @@ -0,0 +1,62 @@ +object GridHelpFrm: TGridHelpFrm + Left = 131 + Height = 461 + Top = 101 + Width = 583 + Caption = 'Using the Grid and Files' + ClientHeight = 461 + ClientWidth = 583 + LCLVersion = '0.9.28.2' + object Memo1: TMemo + Left = 9 + Height = 398 + Top = 9 + Width = 559 + Lines.Strings = ( + 'When you start LazStats you will see the grid with one empty cell. The column represents a variable and' + 'the row represents a "case", observation or subject of your study. Before you enter a value in that first' + 'cell, you should click on the Variables menu and select the Define Variables option. You will see a form' + 'that lets you specify a name or label for the variable as well as a longer title for the variable. In addition,' + 'you specify the type of variable (integer, floating point, character string), a missing value, and how you' + 'want the values entered to be displayed in the cell (justification.) Default values are provided but you' + 'can change these by clicking on a specification and entering your own. There are also "drop-down" boxes' + 'that let you select the type or justification for those specifications. It is a good idea to define all of your' + 'variables before you begin entering data. You can add additional variables in the Definition form by simply' + 'pressing the down arrow key on your key board and then change any default values to appropriate ones' + 'for your data.' + '' + 'Once you have specified the variables for the data grid and returned to the grid, you can then enter data ' + 'for those variables you have defined. When you press the down arrow key on your keyboard, a new row' + 'will automatically appear to enter the next case. BE CAREFUL! It is easy to accidentally add new (blank)' + 'lines that should not be a part of your data file. Use the Edit menu and select the Delete Row for any row' + 'accidentally added to the grid.' + '' + 'Avoid leaving any cell blank. It is recommended that you use a value such as 99999 as a missing value ' + 'until you have the correct value for that case and variable. Generally, it is NOT a good idea to have any' + 'missing data since not all procedures will work with missing data.' + '' + 'Once you have entered data (or need to take a break from data entry) it is time to save the grid data' + 'into a disk file. It is recommended that you save your data as a .LAZ file (the top option under the FILE' + 'menu.) This saves not only your data but also all of your variable definitions! You can, of course, also' + 'export your data to a .TAB or other file format commonly utilized by other programs. These other formats ' + 'do NOT save the definitions of the variables!' + '' + 'Once you have entered data in a grid you will discover it is easy to "navigate" around the grid. Use the' + '"home" key, "end" key, "page up" and "page down" keys as needed. The "TAB" key will move you from' + 'cell to cell in a case. You will also find procedures under the Variables menu and the Edit menu that lets' + 'you recode values in the grid, insert, copy and delete rows or columns, transform values in the grid, etc.' + 'Experiment! Try different options. There''s not much you can do to harm your computer with this program.' + ) + ScrollBars = ssAutoVertical + TabOrder = 0 + end + object ReturnBtn: TButton + Left = 488 + Height = 28 + Top = 424 + Width = 78 + Caption = 'Return' + ModalResult = 1 + TabOrder = 1 + end +end diff --git a/applications/lazstats/source_orig/gridhelpunit.lrs b/applications/lazstats/source_orig/gridhelpunit.lrs new file mode 100644 index 000000000..e437b16bb --- /dev/null +++ b/applications/lazstats/source_orig/gridhelpunit.lrs @@ -0,0 +1,51 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('TGridHelpFrm','FORMDATA',[ + 'TPF0'#12'TGridHelpFrm'#11'GridHelpFrm'#4'Left'#3#131#0#6'Height'#3#205#1#3'T' + +'op'#2'e'#5'Width'#3'G'#2#7'Caption'#6#24'Using the Grid and Files'#12'Clien' + +'tHeight'#3#205#1#11'ClientWidth'#3'G'#2#10'LCLVersion'#6#8'0.9.28.2'#0#5'TM' + +'emo'#5'Memo1'#4'Left'#2#9#6'Height'#3#142#1#3'Top'#2#9#5'Width'#3'/'#2#13'L' + +'ines.Strings'#1#6'hWhen you start LazStats you will see the grid with one e' + +'mpty cell. The column represents a variable and'#6'jthe row represents a "' + +'case", observation or subject of your study. Before you enter a value in t' + +'hat first'#6'icell, you should click on the Variables menu and select the D' + +'efine Variables option. You will see a form'#6'pthat lets you specify a na' + +'me or label for the variable as well as a longer title for the variable. I' + +'n addition,'#6'jyou specify the type of variable (integer, floating point, ' + +'character string), a missing value, and how you'#6'iwant the values entered' + +' to be displayed in the cell (justification.) Default values are provided ' + +'but you'#6'hcan change these by clicking on a specification and entering yo' + +'ur own. There are also "drop-down" boxes'#6'pthat let you select the type ' + +'or justification for those specifications. It is a good idea to define all' + +' of your'#6'lvariables before you begin entering data. You can add additio' + +'nal variables in the Definition form by simply'#6'dpressing the down arrow ' + +'key on your key board and then change any default values to appropriate one' + +'s'#6#14'for your data.'#6#0#6'jOnce you have specified the variables for th' + +'e data grid and returned to the grid, you can then enter data '#6'dfor thos' + +'e variables you have defined. When you press the down arrow key on your ke' + +'yboard, a new row'#6'jwill automatically appear to enter the next case. BE' + +' CAREFUL! It is easy to accidentally add new (blank)'#6'klines that should' + +' not be a part of your data file. Use the Edit menu and select the Delete ' + +'Row for any row'#6#31'accidentally added to the grid.'#6#0#6'gAvoid leaving' + +' any cell blank. It is recommended that you use a value such as 99999 as a' + +' missing value '#6'juntil you have the correct value for that case and vari' + +'able. Generally, it is NOT a good idea to have any'#6'Bmissing data since ' + +'not all procedures will work with missing data.'#6#0#6'eOnce you have enter' + +'ed data (or need to take a break from data entry) it is time to save the gr' + +'id data'#6'jinto a disk file. It is recommended that you save your data as' + +' a .LAZ file (the top option under the FILE'#6'jmenu.) This saves not only' + +' your data but also all of your variable definitions! You can, of course, ' + +'also'#6'jexport your data to a .TAB or other file format commonly utilized ' + +'by other programs. These other formats '#6'-do NOT save the definitions of' + +' the variables!'#6#0#6'iOnce you have entered data in a grid you will disco' + +'ver it is easy to "navigate" around the grid. Use the'#6'b"home" key, "end' + +'" key, "page up" and "page down" keys as needed. The "TAB" key will move y' + +'ou from'#6'kcell to cell in a case. You will also find procedures under th' + +'e Variables menu and the Edit menu that lets'#6'jyou recode values in the g' + +'rid, insert, copy and delete rows or columns, transform values in the grid,' + +' etc.'#6'iExperiment! Try different options. There''s not much you can do' + +' to harm your computer with this program.'#0#10'ScrollBars'#7#14'ssAutoVert' + +'ical'#8'TabOrder'#2#0#0#0#7'TButton'#9'ReturnBtn'#4'Left'#3#232#1#6'Height' + +#2#28#3'Top'#3#168#1#5'Width'#2'N'#7'Caption'#6#6'Return'#11'ModalResult'#2#1 + +#8'TabOrder'#2#1#0#0#0 +]); diff --git a/applications/lazstats/source_orig/gridhelpunit.pas b/applications/lazstats/source_orig/gridhelpunit.pas new file mode 100644 index 000000000..24b93868f --- /dev/null +++ b/applications/lazstats/source_orig/gridhelpunit.pas @@ -0,0 +1,33 @@ +unit GridHelpUnit; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, + StdCtrls; + +type + + { TGridHelpFrm } + + TGridHelpFrm = class(TForm) + ReturnBtn: TButton; + Memo1: TMemo; + private + { private declarations } + public + { public declarations } + end; + +var + GridHelpFrm: TGridHelpFrm; + +implementation + +initialization + {$I gridhelpunit.lrs} + +end. + diff --git a/applications/lazstats/source_orig/groupfrequnit.lfm b/applications/lazstats/source_orig/groupfrequnit.lfm new file mode 100644 index 000000000..228097f81 --- /dev/null +++ b/applications/lazstats/source_orig/groupfrequnit.lfm @@ -0,0 +1,213 @@ +object GroupFreqForm: TGroupFreqForm + Left = 259 + Height = 412 + Top = 137 + Width = 461 + Caption = 'Group Frequency Analysis' + ClientHeight = 412 + ClientWidth = 461 + OnShow = ResetBtnClick + LCLVersion = '0.9.30' + object Label1: TLabel + Left = 16 + Height = 16 + Top = 8 + Width = 102 + Caption = 'Available Variables:' + ParentColor = False + end + object Label2: TLabel + Left = 256 + Height = 16 + Top = 208 + Width = 79 + Caption = 'Group Variable' + ParentColor = False + end + object VarList: TListBox + Left = 16 + Height = 256 + Top = 24 + Width = 181 + ItemHeight = 0 + MultiSelect = True + TabOrder = 0 + end + object GrpInBtn: TBitBtn + Left = 211 + Height = 26 + Top = 200 + Width = 30 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00216324B81D5E2006FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF002A702F38256929F7216324D9FFFFFF00FFFFFF00FFFFFF00FFFFFF0061BE + 6DFF5DB868FF58B162FF53A95CFF4DA156FF47994FFF419149FF3B8842FF3580 + 3BFF3F8845FF59A15EFF448B49FF216324CFFFFFFF00FFFFFF00FFFFFF0065C3 + 71FFA0D7A9FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF458C4AFF216324C4FFFFFF00FFFFFF0068C7 + 74FFA5DAAEFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF4A9150FF256929C9FFFFFF00FFFFFF0068C7 + 74FF68C774FF65C371FF61BE6DFF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF5AA362FF559D5CFF2F7835D1FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00419149F73B8842DBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0047994FBB41914906FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + NumGlyphs = 0 + OnClick = GrpInBtnClick + TabOrder = 1 + end + object GrpOutBtn: TBitBtn + Left = 211 + Height = 26 + Top = 232 + Width = 30 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF004DA1560647994FB8FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0053A95CD94DA156F747994F38FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF005DB868CF71BE7BFF7AC183FF5BAA64FF47994FFF419149FF3B8842FF3580 + 3BFF2F7835FF2A702FFF256929FF216324FF1D5E20FFFFFFFF00FFFFFF0065C3 + 71C47BC886FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF72BD78FF216324FFFFFFFF00FFFFFF0068C7 + 74C97FCC8AFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF78C07EFF256929FFFFFFFF00FFFFFF00FFFF + FF0068C774D180CD8BFF7CC987FF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF3B8842FF35803BFF2F7835FF2A702FFFFFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C774DB65C371F7FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C7740668C774BBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + NumGlyphs = 0 + OnClick = GrpOutBtnClick + TabOrder = 2 + end + object GrpVarEdit: TEdit + Left = 255 + Height = 23 + Top = 224 + Width = 139 + TabOrder = 3 + Text = 'GrpVarEdit' + end + object ResetBtn: TButton + Left = 16 + Height = 27 + Top = 312 + Width = 89 + Caption = 'Reset' + OnClick = ResetBtnClick + TabOrder = 4 + end + object CancelBtn: TButton + Left = 16 + Height = 27 + Top = 360 + Width = 89 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 5 + end + object ComputeBtn: TButton + Left = 112 + Height = 27 + Top = 312 + Width = 89 + Caption = 'Compute' + OnClick = ComputeBtnClick + TabOrder = 6 + end + object ReturnBtn: TButton + Left = 112 + Height = 27 + Top = 360 + Width = 89 + Caption = 'Return' + ModalResult = 1 + TabOrder = 7 + end + object OptionsBox: TRadioGroup + Left = 208 + Height = 131 + Top = 256 + Width = 229 + AutoFill = True + Caption = 'Plot Choices:' + ChildSizing.LeftRightSpacing = 6 + ChildSizing.TopBottomSpacing = 6 + ChildSizing.EnlargeHorizontal = crsHomogenousChildResize + ChildSizing.EnlargeVertical = crsHomogenousChildResize + ChildSizing.ShrinkHorizontal = crsScaleChilds + ChildSizing.ShrinkVertical = crsScaleChilds + ChildSizing.Layout = cclLeftToRightThenTopToBottom + ChildSizing.ControlsPerLine = 1 + ClientHeight = 113 + ClientWidth = 225 + Items.Strings = ( + 'Plot means using 2D Horizontal Bars' + 'Plot means using 3D Horizontal Bars' + 'Plot means using 2D Vertical Bars' + 'Plot means using 3D Vertical Bars' + ) + TabOrder = 8 + end + object Memo1: TMemo + Left = 211 + Height = 130 + Top = 24 + Width = 230 + Lines.Strings = ( + 'This procedure plots the frequency of' + 'cases in each of the groups in a group' + 'variable. The group variable should' + 'be defined as an integer variable.' + '' + 'Select the variable and type of plot' + 'and click the Compute button for' + 'the results.' + ) + TabOrder = 9 + end +end diff --git a/applications/lazstats/source_orig/groupfrequnit.lrs b/applications/lazstats/source_orig/groupfrequnit.lrs new file mode 100644 index 000000000..3363f95eb --- /dev/null +++ b/applications/lazstats/source_orig/groupfrequnit.lrs @@ -0,0 +1,142 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('TGroupFreqForm','FORMDATA',[ + 'TPF0'#14'TGroupFreqForm'#13'GroupFreqForm'#4'Left'#3#3#1#6'Height'#3#156#1#3 + +'Top'#3#137#0#5'Width'#3#205#1#7'Caption'#6#24'Group Frequency Analysis'#12 + +'ClientHeight'#3#156#1#11'ClientWidth'#3#205#1#6'OnShow'#7#13'ResetBtnClick' + +#10'LCLVersion'#6#6'0.9.30'#0#6'TLabel'#6'Label1'#4'Left'#2#16#6'Height'#2#16 + +#3'Top'#2#8#5'Width'#2'f'#7'Caption'#6#20'Available Variables:'#11'ParentCol' + +'or'#8#0#0#6'TLabel'#6'Label2'#4'Left'#3#0#1#6'Height'#2#16#3'Top'#3#208#0#5 + +'Width'#2'O'#7'Caption'#6#14'Group Variable'#11'ParentColor'#8#0#0#8'TListBo' + +'x'#7'VarList'#4'Left'#2#16#6'Height'#3#0#1#3'Top'#2#24#5'Width'#3#181#0#10 + +'ItemHeight'#2#0#11'MultiSelect'#9#8'TabOrder'#2#0#0#0#7'TBitBtn'#8'GrpInBtn' + +#4'Left'#3#211#0#6'Height'#2#26#3'Top'#3#200#0#5'Width'#2#30#10'Glyph.Data' + +#10':'#4#0#0'6'#4#0#0'BM6'#4#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#16#0#0#0#16#0#0#0 + +#1#0' '#0#0#0#0#0#0#4#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'!c$'#184#29'^' + +' '#6#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0'*p/8%i)'#247'!c$'#217#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0'a'#190'm'#255']'#184'h'#255'X'#177 + +'b'#255'S'#169'\'#255'M'#161'V'#255'G'#153'O'#255'A'#145'I'#255';'#136'B'#255 + +'5'#128';'#255'?'#136'E'#255'Y'#161'^'#255'D'#139'I'#255'!c$'#207#255#255#255 + +#0#255#255#255#0#255#255#255#0'e'#195'q'#255#160#215#169#255#156#213#165#255 + +#152#211#161#255#148#208#157#255#144#206#152#255#139#203#147#255#135#201#142 + +#255#130#198#137#255'~'#195#132#255'z'#193#128#255'v'#190'|'#255'E'#140'J' + +#255'!c$'#196#255#255#255#0#255#255#255#0'h'#199't'#255#165#218#174#255#162 + +#216#171#255#158#214#167#255#154#212#163#255#150#210#159#255#147#207#154#255 + +#142#204#149#255#137#202#144#255#133#199#139#255#129#197#135#255'}'#194#130 + +#255'J'#145'P'#255'%i)'#201#255#255#255#0#255#255#255#0'h'#199't'#255'h'#199 + +'t'#255'e'#195'q'#255'a'#190'm'#255']'#184'h'#255'X'#177'b'#255'S'#169'\'#255 + +'M'#161'V'#255'G'#153'O'#255'A'#145'I'#255'Z'#163'b'#255'U'#157'\'#255'/x5' + +#209#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0'A'#145'I'#247';'#136'B'#219#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0'G'#153'O'#187'A'#145'I'#6#255#255#255 + +#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#9'NumGlyphs'#2#0#7'OnClick'#7#13'GrpInBtnClick' + +#8'TabOrder'#2#1#0#0#7'TBitBtn'#9'GrpOutBtn'#4'Left'#3#211#0#6'Height'#2#26#3 + +'Top'#3#232#0#5'Width'#2#30#10'Glyph.Data'#10':'#4#0#0'6'#4#0#0'BM6'#4#0#0#0 + +#0#0#0'6'#0#0#0'('#0#0#0#16#0#0#0#16#0#0#0#1#0' '#0#0#0#0#0#0#4#0#0'd'#0#0#0 + +'d'#0#0#0#0#0#0#0#0#0#0#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + ,#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'M'#161'V' + +#6'G'#153'O'#184#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'S'#169'\'#217 + +'M'#161'V'#247'G'#153'O8'#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0']'#184'h'#207'q'#190'{'#255'z'#193 + +#131#255'['#170'd'#255'G'#153'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';' + +#255'/x5'#255'*p/'#255'%i)'#255'!c$'#255#29'^ '#255#255#255#255#0#255#255#255 + +#0'e'#195'q'#196'{'#200#134#255#156#213#165#255#152#211#161#255#148#208#157 + +#255#144#206#152#255#139#203#147#255#135#201#142#255#130#198#137#255'~'#195 + +#132#255'z'#193#128#255'v'#190'|'#255'r'#189'x'#255'!c$'#255#255#255#255#0 + +#255#255#255#0'h'#199't'#201#127#204#138#255#162#216#171#255#158#214#167#255 + +#154#212#163#255#150#210#159#255#147#207#154#255#142#204#149#255#137#202#144 + +#255#133#199#139#255#129#197#135#255'}'#194#130#255'x'#192'~'#255'%i)'#255 + +#255#255#255#0#255#255#255#0#255#255#255#0'h'#199't'#209#128#205#139#255'|' + +#201#135#255']'#184'h'#255'X'#177'b'#255'S'#169'\'#255'M'#161'V'#255'G'#153 + +'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';'#255'/x5'#255'*p/'#255#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0'h'#199't'#219'e'#195'q'#247 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0'h'#199't'#6'h'#199't'#187 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#9'NumGlyphs'#2#0#7'OnClick'#7#14'GrpOutBtnClick'#8'TabOrder'#2#2#0#0#5 + +'TEdit'#10'GrpVarEdit'#4'Left'#3#255#0#6'Height'#2#23#3'Top'#3#224#0#5'Width' + +#3#139#0#8'TabOrder'#2#3#4'Text'#6#10'GrpVarEdit'#0#0#7'TButton'#8'ResetBtn' + +#4'Left'#2#16#6'Height'#2#27#3'Top'#3'8'#1#5'Width'#2'Y'#7'Caption'#6#5'Rese' + +'t'#7'OnClick'#7#13'ResetBtnClick'#8'TabOrder'#2#4#0#0#7'TButton'#9'CancelBt' + +'n'#4'Left'#2#16#6'Height'#2#27#3'Top'#3'h'#1#5'Width'#2'Y'#6'Cancel'#9#7'Ca' + +'ption'#6#6'Cancel'#11'ModalResult'#2#2#8'TabOrder'#2#5#0#0#7'TButton'#10'Co' + +'mputeBtn'#4'Left'#2'p'#6'Height'#2#27#3'Top'#3'8'#1#5'Width'#2'Y'#7'Caption' + +#6#7'Compute'#7'OnClick'#7#15'ComputeBtnClick'#8'TabOrder'#2#6#0#0#7'TButton' + +#9'ReturnBtn'#4'Left'#2'p'#6'Height'#2#27#3'Top'#3'h'#1#5'Width'#2'Y'#7'Capt' + +'ion'#6#6'Return'#11'ModalResult'#2#1#8'TabOrder'#2#7#0#0#11'TRadioGroup'#10 + +'OptionsBox'#4'Left'#3#208#0#6'Height'#3#131#0#3'Top'#3#0#1#5'Width'#3#229#0 + +#8'AutoFill'#9#7'Caption'#6#13'Plot Choices:'#28'ChildSizing.LeftRightSpacin' + +'g'#2#6#28'ChildSizing.TopBottomSpacing'#2#6#29'ChildSizing.EnlargeHorizonta' + +'l'#7#24'crsHomogenousChildResize'#27'ChildSizing.EnlargeVertical'#7#24'crsH' + +'omogenousChildResize'#28'ChildSizing.ShrinkHorizontal'#7#14'crsScaleChilds' + +#26'ChildSizing.ShrinkVertical'#7#14'crsScaleChilds'#18'ChildSizing.Layout'#7 + ,#29'cclLeftToRightThenTopToBottom'#27'ChildSizing.ControlsPerLine'#2#1#12'Cl' + +'ientHeight'#2'q'#11'ClientWidth'#3#225#0#13'Items.Strings'#1#6'#Plot means ' + +'using 2D Horizontal Bars'#6'#Plot means using 3D Horizontal Bars'#6'!Plot m' + +'eans using 2D Vertical Bars'#6'!Plot means using 3D Vertical Bars'#0#8'TabO' + +'rder'#2#8#0#0#5'TMemo'#5'Memo1'#4'Left'#3#211#0#6'Height'#3#130#0#3'Top'#2 + +#24#5'Width'#3#230#0#13'Lines.Strings'#1#6'%This procedure plots the frequen' + +'cy of'#6'&cases in each of the groups in a group'#6'$variable. The group v' + +'ariable should'#6'"be defined as an integer variable.'#6#0#6'$Select the va' + +'riable and type of plot'#6' and click the Compute button for'#6#12'the resu' + +'lts.'#0#8'TabOrder'#2#9#0#0#0 +]); diff --git a/applications/lazstats/source_orig/groupfrequnit.pas b/applications/lazstats/source_orig/groupfrequnit.pas new file mode 100644 index 000000000..40f1f84a1 --- /dev/null +++ b/applications/lazstats/source_orig/groupfrequnit.pas @@ -0,0 +1,173 @@ +unit GroupFreqUnit; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, + StdCtrls, Buttons, ExtCtrls, MainUnit, OutPutUnit, FunctionsLib, GraphLib, + Globals, DataProcs; + +type + + { TGroupFreqForm } + + TGroupFreqForm = class(TForm) + GrpInBtn: TBitBtn; + GrpOutBtn: TBitBtn; + CancelBtn: TButton; + ComputeBtn: TButton; + GrpVarEdit: TEdit; + Label1: TLabel; + Label2: TLabel; + Memo1: TMemo; + OptionsBox: TRadioGroup; + ResetBtn: TButton; + ReturnBtn: TButton; + VarList: TListBox; + procedure ComputeBtnClick(Sender: TObject); + procedure GrpInBtnClick(Sender: TObject); + procedure GrpOutBtnClick(Sender: TObject); + procedure ResetBtnClick(Sender: TObject); + private + { private declarations } + public + { public declarations } + end; + +var + GroupFreqForm: TGroupFreqForm; + +implementation + +{ TGroupFreqForm } + +procedure TGroupFreqForm.ResetBtnClick(Sender: TObject); +VAR i : integer; +begin + VarList.Clear; + for i := 1 to NoVariables do + VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]); + GrpVarEdit.Text := ''; + GrpInBtn.Visible := true; + GrpOutBtn.Visible := false; +end; + +procedure TGroupFreqForm.GrpInBtnClick(Sender: TObject); +VAR index : integer; +begin + index := VarList.ItemIndex; + if index < 0 then exit; + GrpVarEdit.Text := VarList.Items.Strings[index]; + VarList.Items.Delete(index); + GrpInBtn.Visible := false; + GrpOutBtn.Visible := true; +end; + +procedure TGroupFreqForm.ComputeBtnClick(Sender: TObject); +VAR + nogroups, mingrp, maxgrp, grpcol, tempcol, value, minfreq, maxfreq : integer; + labelstr : string; + results, prompt : boolean; + result, intvalue, i, j : integer; + dblvalue : double; + strvalue : string; + freq : IntDyneVec; + plottype : integer; +begin + // get the variable to analyze + + grpcol := 0; + for i := 1 to NoVariables do + begin + strvalue := Trim(OS3MainFrm.DataGrid.Cells[i,0]); + if GrpVarEdit.Text = strvalue then grpcol := i; + end; + labelstr := GrpVarEdit.Text; + mingrp := 1000; + maxgrp := -1000; + for i := 1 to NoCases do + begin + if not ValidValue(i,grpcol) then continue; + value := round(StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[grpcol,i]))); + if value < mingrp then mingrp := value; + if value > maxgrp then maxgrp := value; + end; + nogroups := maxgrp - mingrp + 1; + if nogroups < 2 then + begin + ShowMessage('One or fewer groups found. Returning.'); + exit; + end; + // setup frequency array and count cases in each group + SetLength(freq,NoGroups+1); + for i := 0 to NoGroups do freq[i] := 0; + for i := 1 to NoCases do + begin + if not ValidValue(i,grpcol) then continue; + value := round(StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[grpcol,i]))); + value := value - mingrp; + freq[value] := freq[value] + 1; + end; + // get min and max frequencies and check for existence of a range + minfreq := 10000; + maxfreq := -10000; + for i := 0 to NoGroups-1 do + begin + if freq[i] < minfreq then minfreq := freq[i]; + if freq[i] > maxfreq then maxfreq := freq[i]; + end; + if minfreq = maxfreq then + begin + ShowMessage('All groups have equal frequencies. Cannot plot.'); + freq := nil; + exit; + end; + plottype := OptionsBox.ItemIndex + 1; + if plottype = 3 then plottype := 1 + else if plottype = 4 then plottype := 2 + else if plottype = 1 then plottype := 9 + else if plottype = 2 then plottype := 10; + + // plot the frequencies + SetLength(GraphFrm.Xpoints,1,nogroups+1); + SetLength(GraphFrm.Ypoints,1,nogroups+1); + GraphFrm.nosets := 1; + GraphFrm.nbars := nogroups; + GraphFrm.Heading := 'Frequency Distribution'; + GraphFrm.XTitle := 'Values of ' + labelstr; + GraphFrm.YTitle := 'Frequency'; + GraphFrm.barwideprop := 0.5; + GraphFrm.AutoScale := false; + GraphFrm.miny := 0.0; + GraphFrm.maxy := maxfreq; + GraphFrm.GraphType := plottype; + GraphFrm.BackColor := clYellow; + GraphFrm.WallColor := clBlack; + GraphFrm.FloorColor := clLtGray; + GraphFrm.ShowBackWall := true; + for i := 0 to nogroups do + begin + GraphFrm.Ypoints[0,i] := freq[i]; + GraphFrm.Xpoints[0,i] := mingrp + i; + end; + GraphFrm.ShowModal; + GraphFrm.Xpoints := nil; + GraphFrm.Ypoints := nil; +end; + +procedure TGroupFreqForm.GrpOutBtnClick(Sender: TObject); +begin + if GrpVarEdit.Text = '' then exit; + VarList.Items.Add(GrpVarEdit.Text); + GrpVarEdit.Text := ''; + GrpInBtn.Visible := true; + GrpOutBtn.Visible := false; +end; + +initialization + {$I groupfrequnit.lrs} + +end. + diff --git a/applications/lazstats/source_orig/guttmanunit.lfm b/applications/lazstats/source_orig/guttmanunit.lfm new file mode 100644 index 000000000..1b8cfe452 --- /dev/null +++ b/applications/lazstats/source_orig/guttmanunit.lfm @@ -0,0 +1,178 @@ +object GuttmanFrm: TGuttmanFrm + Left = 155 + Height = 332 + Top = 113 + Width = 400 + Caption = 'Guttman Sclaogram Analysis' + ClientHeight = 332 + ClientWidth = 400 + OnShow = FormShow + LCLVersion = '0.9.26.2' + object Label1: TLabel + Left = 10 + Height = 14 + Top = 8 + Width = 90 + Caption = 'Variables Available' + ParentColor = False + end + object Label2: TLabel + Left = 208 + Height = 14 + Top = 11 + Width = 72 + Caption = 'Selected Items' + ParentColor = False + end + object VarList: TListBox + Left = 9 + Height = 250 + Top = 24 + Width = 153 + MultiSelect = True + TabOrder = 0 + end + object InBtn: TBitBtn + Left = 169 + Height = 27 + Top = 25 + Width = 30 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00216324B81D5E2006FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF002A702F38256929F7216324D9FFFFFF00FFFFFF00FFFFFF00FFFFFF0061BE + 6DFF5DB868FF58B162FF53A95CFF4DA156FF47994FFF419149FF3B8842FF3580 + 3BFF3F8845FF59A15EFF448B49FF216324CFFFFFFF00FFFFFF00FFFFFF0065C3 + 71FFA0D7A9FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF458C4AFF216324C4FFFFFF00FFFFFF0068C7 + 74FFA5DAAEFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF4A9150FF256929C9FFFFFF00FFFFFF0068C7 + 74FF68C774FF65C371FF61BE6DFF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF5AA362FF559D5CFF2F7835D1FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00419149F73B8842DBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0047994FBB41914906FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + NumGlyphs = 0 + OnClick = InBtnClick + TabOrder = 1 + end + object OutBtn: TBitBtn + Left = 169 + Height = 27 + Top = 56 + Width = 30 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF004DA1560647994FB8FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0053A95CD94DA156F747994F38FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF005DB868CF71BE7BFF7AC183FF5BAA64FF47994FFF419149FF3B8842FF3580 + 3BFF2F7835FF2A702FFF256929FF216324FF1D5E20FFFFFFFF00FFFFFF0065C3 + 71C47BC886FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF72BD78FF216324FFFFFFFF00FFFFFF0068C7 + 74C97FCC8AFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF78C07EFF256929FFFFFFFF00FFFFFF00FFFF + FF0068C774D180CD8BFF7CC987FF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF3B8842FF35803BFF2F7835FF2A702FFFFFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C774DB65C371F7FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C7740668C774BBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + NumGlyphs = 0 + OnClick = OutBtnClick + TabOrder = 2 + end + object AllBtn: TBitBtn + Left = 169 + Height = 27 + Top = 104 + Width = 30 + Caption = 'ALL' + NumGlyphs = 0 + OnClick = AllBtnClick + TabOrder = 3 + end + object ItemList: TListBox + Left = 206 + Height = 246 + Top = 30 + Width = 156 + TabOrder = 4 + end + object ResetBtn: TButton + Left = 8 + Height = 28 + Top = 289 + Width = 62 + Caption = 'Reset' + OnClick = ResetBtnClick + TabOrder = 5 + end + object CancelBtn: TButton + Left = 100 + Height = 28 + Top = 289 + Width = 62 + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 6 + end + object ComputeBtn: TButton + Left = 208 + Height = 28 + Top = 289 + Width = 62 + Caption = 'Compute' + OnClick = ComputeBtnClick + TabOrder = 7 + end + object ReturnBtn: TButton + Left = 300 + Height = 28 + Top = 288 + Width = 62 + Caption = 'Return' + ModalResult = 1 + TabOrder = 8 + end +end diff --git a/applications/lazstats/source_orig/guttmanunit.lrs b/applications/lazstats/source_orig/guttmanunit.lrs new file mode 100644 index 000000000..44d65e644 --- /dev/null +++ b/applications/lazstats/source_orig/guttmanunit.lrs @@ -0,0 +1,127 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('TGuttmanFrm','FORMDATA',[ + 'TPF0'#11'TGuttmanFrm'#10'GuttmanFrm'#4'Left'#3#155#0#6'Height'#3'L'#1#3'Top' + +#2'q'#5'Width'#3#144#1#7'Caption'#6#26'Guttman Sclaogram Analysis'#12'Client' + +'Height'#3'L'#1#11'ClientWidth'#3#144#1#6'OnShow'#7#8'FormShow'#10'LCLVersio' + +'n'#6#8'0.9.26.2'#0#6'TLabel'#6'Label1'#4'Left'#2#10#6'Height'#2#14#3'Top'#2 + +#8#5'Width'#2'Z'#7'Caption'#6#19'Variables Available'#11'ParentColor'#8#0#0#6 + +'TLabel'#6'Label2'#4'Left'#3#208#0#6'Height'#2#14#3'Top'#2#11#5'Width'#2'H'#7 + +'Caption'#6#14'Selected Items'#11'ParentColor'#8#0#0#8'TListBox'#7'VarList'#4 + +'Left'#2#9#6'Height'#3#250#0#3'Top'#2#24#5'Width'#3#153#0#11'MultiSelect'#9#8 + +'TabOrder'#2#0#0#0#7'TBitBtn'#5'InBtn'#4'Left'#3#169#0#6'Height'#2#27#3'Top' + +#2#25#5'Width'#2#30#10'Glyph.Data'#10':'#4#0#0'6'#4#0#0'BM6'#4#0#0#0#0#0#0'6' + +#0#0#0'('#0#0#0#16#0#0#0#16#0#0#0#1#0' '#0#0#0#0#0#0#4#0#0'd'#0#0#0'd'#0#0#0 + +#0#0#0#0#0#0#0#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0'!c$'#184#29'^ '#6#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'*p/8%' + +'i)'#247'!c$'#217#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'a' + +#190'm'#255']'#184'h'#255'X'#177'b'#255'S'#169'\'#255'M'#161'V'#255'G'#153'O' + +#255'A'#145'I'#255';'#136'B'#255'5'#128';'#255'?'#136'E'#255'Y'#161'^'#255'D' + +#139'I'#255'!c$'#207#255#255#255#0#255#255#255#0#255#255#255#0'e'#195'q'#255 + +#160#215#169#255#156#213#165#255#152#211#161#255#148#208#157#255#144#206#152 + +#255#139#203#147#255#135#201#142#255#130#198#137#255'~'#195#132#255'z'#193 + +#128#255'v'#190'|'#255'E'#140'J'#255'!c$'#196#255#255#255#0#255#255#255#0'h' + +#199't'#255#165#218#174#255#162#216#171#255#158#214#167#255#154#212#163#255 + +#150#210#159#255#147#207#154#255#142#204#149#255#137#202#144#255#133#199#139 + +#255#129#197#135#255'}'#194#130#255'J'#145'P'#255'%i)'#201#255#255#255#0#255 + +#255#255#0'h'#199't'#255'h'#199't'#255'e'#195'q'#255'a'#190'm'#255']'#184'h' + +#255'X'#177'b'#255'S'#169'\'#255'M'#161'V'#255'G'#153'O'#255'A'#145'I'#255'Z' + +#163'b'#255'U'#157'\'#255'/x5'#209#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'A'#145'I' + +#247';'#136'B'#219#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'G'#153'O' + +#187'A'#145'I'#6#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#9'NumGlyphs'#2#0#7 + +'OnClick'#7#10'InBtnClick'#8'TabOrder'#2#1#0#0#7'TBitBtn'#6'OutBtn'#4'Left'#3 + +#169#0#6'Height'#2#27#3'Top'#2'8'#5'Width'#2#30#10'Glyph.Data'#10':'#4#0#0'6' + +#4#0#0'BM6'#4#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#16#0#0#0#16#0#0#0#1#0' '#0#0#0#0 + +#0#0#4#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + ,#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0'M'#161'V'#6'G'#153'O'#184#255#255#255#0#255#255#255#0#255#255#255 + +#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0'S'#169'\'#217'M'#161'V'#247'G'#153'O8'#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0']'#184'h'#207 + +'q'#190'{'#255'z'#193#131#255'['#170'd'#255'G'#153'O'#255'A'#145'I'#255';' + +#136'B'#255'5'#128';'#255'/x5'#255'*p/'#255'%i)'#255'!c$'#255#29'^ '#255#255 + +#255#255#0#255#255#255#0'e'#195'q'#196'{'#200#134#255#156#213#165#255#152#211 + +#161#255#148#208#157#255#144#206#152#255#139#203#147#255#135#201#142#255#130 + +#198#137#255'~'#195#132#255'z'#193#128#255'v'#190'|'#255'r'#189'x'#255'!c$' + +#255#255#255#255#0#255#255#255#0'h'#199't'#201''#204#138#255#162#216#171#255 + +#158#214#167#255#154#212#163#255#150#210#159#255#147#207#154#255#142#204#149 + +#255#137#202#144#255#133#199#139#255#129#197#135#255'}'#194#130#255'x'#192'~' + +#255'%i)'#255#255#255#255#0#255#255#255#0#255#255#255#0'h'#199't'#209#128#205 + +#139#255'|'#201#135#255']'#184'h'#255'X'#177'b'#255'S'#169'\'#255'M'#161'V' + +#255'G'#153'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';'#255'/x5'#255'*p/' + +#255#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'h'#199't'#219'e' + +#195'q'#247#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'h'#199't'#6'h'#199 + +'t'#187#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#9'NumGlyphs'#2#0#7'OnClick'#7#11'OutBtnClick'#8'TabOrder'#2#2#0#0 + +#7'TBitBtn'#6'AllBtn'#4'Left'#3#169#0#6'Height'#2#27#3'Top'#2'h'#5'Width'#2 + +#30#7'Caption'#6#3'ALL'#9'NumGlyphs'#2#0#7'OnClick'#7#11'AllBtnClick'#8'TabO' + +'rder'#2#3#0#0#8'TListBox'#8'ItemList'#4'Left'#3#206#0#6'Height'#3#246#0#3'T' + +'op'#2#30#5'Width'#3#156#0#8'TabOrder'#2#4#0#0#7'TButton'#8'ResetBtn'#4'Left' + +#2#8#6'Height'#2#28#3'Top'#3'!'#1#5'Width'#2'>'#7'Caption'#6#5'Reset'#7'OnCl' + +'ick'#7#13'ResetBtnClick'#8'TabOrder'#2#5#0#0#7'TButton'#9'CancelBtn'#4'Left' + +#2'd'#6'Height'#2#28#3'Top'#3'!'#1#5'Width'#2'>'#7'Caption'#6#6'Cancel'#11'M' + +'odalResult'#2#2#8'TabOrder'#2#6#0#0#7'TButton'#10'ComputeBtn'#4'Left'#3#208 + +#0#6'Height'#2#28#3'Top'#3'!'#1#5'Width'#2'>'#7'Caption'#6#7'Compute'#7'OnCl' + +'ick'#7#15'ComputeBtnClick'#8'TabOrder'#2#7#0#0#7'TButton'#9'ReturnBtn'#4'Le' + +'ft'#3','#1#6'Height'#2#28#3'Top'#3' '#1#5'Width'#2'>'#7'Caption'#6#6'Return' + +#11'ModalResult'#2#1#8'TabOrder'#2#8#0#0#0 +]); diff --git a/applications/lazstats/source_orig/guttmanunit.pas b/applications/lazstats/source_orig/guttmanunit.pas new file mode 100644 index 000000000..03a21912d --- /dev/null +++ b/applications/lazstats/source_orig/guttmanunit.pas @@ -0,0 +1,598 @@ +unit GuttmanUnit; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, + StdCtrls, Buttons, MainUnit, OutPutUnit, FunctionsLib, Globals, + DataProcs, Math; + +type + + { TGuttmanFrm } + + TGuttmanFrm = class(TForm) + InBtn: TBitBtn; + OutBtn: TBitBtn; + AllBtn: TBitBtn; + ResetBtn: TButton; + CancelBtn: TButton; + ComputeBtn: TButton; + ReturnBtn: TButton; + Label1: TLabel; + Label2: TLabel; + ItemList: TListBox; + VarList: TListBox; + procedure AllBtnClick(Sender: TObject); + procedure ComputeBtnClick(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure InBtnClick(Sender: TObject); + procedure OutBtnClick(Sender: TObject); + procedure ResetBtnClick(Sender: TObject); + private + { private declarations } + public + { public declarations } + end; + +var + GuttmanFrm: TGuttmanFrm; + +implementation + +{ TGuttmanFrm } + +procedure TGuttmanFrm.ResetBtnClick(Sender: TObject); +VAR i : integer; +begin + VarList.Clear; + ItemList.Clear; + OutBtn.Visible := false; + InBtn.Visible := true; + for i := 1 to NoVariables do + VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]); +end; + +procedure TGuttmanFrm.FormShow(Sender: TObject); +begin + ResetBtnClick(self); +end; + +procedure TGuttmanFrm.AllBtnClick(Sender: TObject); +VAR count, i : integer; +begin + count := VarList.Items.Count; + for i := 1 to count do + ItemList.Items.Add(VarList.Items.Strings[i-1]); + VarList.Clear; + InBtn.Visible := false; + OutBtn.Visible := true; +end; + +procedure TGuttmanFrm.ComputeBtnClick(Sender: TObject); +var + i, j, k, col, X, e0, e1, e2, e3, first, last, errors : integer; + totalerrors, rowno : integer; + FreqMat0 : IntDyneMat; // Pointer to array of 0 responses for each item by score group + FreqMat1 : IntDyneMat; // Pointer to array of 1 responses for each item by score group + RowTots : IntDyneVec; // Pointer to vector of total score frequencies for items + ColTots : IntDyneMat; // Pointer to array of 0 and 1 column totals + ColProps : DblDyneVec; // Pointer to array of proportions correct in columns + ColNoSelected : IntDyneVec; // Pointer to vector of item Grid columns + CaseVector : IntDyneVec; // Pointer to vector of subject's item responses + TotalScore : integer; // Total score of a subject + temp : integer; // temporary variable used in sorting + CutScore : IntDyneVec; // Optimal cut scores for each item + ErrorMat : IntDyneMat; // matrix of errors above and below cut scores + sequence : IntDyneVec; // original and sorted sequence no. of items + CaseNo : IntDyneVec; // ID number for each case + ModalArray : IntDyneMat; // Array of modal item responses + NoSelected : integer; + VarLabels : StrDyneVec; // variable labels + outline, astring : string; + done : boolean; + CoefRepro : double; + Min_Coeff : double; +begin + // allocate heap space for arrays + SetLength(ColNoSelected,NoVariables); + SetLength(FreqMat0,NoCases,NoVariables); + SetLength(FreqMat1,NoCases,NoVariables); + SetLength(RowTots,NoCases); + SetLength(ColTots,NoVariables,2); + SetLength(ColProps,NoVariables); + SetLength(CaseVector,NoCases); + SetLength(CutScore,NoCases); + SetLength(ErrorMat,NoVariables,2); + SetLength(sequence,NoVariables); + SetLength(CaseNo,NoCases); + SetLength(ModalArray,NoVariables+1,NoVariables+1); + SetLength(VarLabels,NoVariables); + + // get variables used for the analysis + NoSelected := ItemList.Items.Count; + for i := 1 to NoVariables do + begin + for j := 1 to NoSelected do + begin + if OS3MainFrm.DataGrid.Cells[i,0] = ItemList.Items.Strings[j-1] then + begin + ColNoSelected[j-1] := i; + VarLabels[j-1] := OS3MainFrm.DataGrid.Cells[i,0]; + end; + end; + end; + OutPutFrm.RichEdit.Clear; + + // Initialize sequence + for i := 1 to NoSelected do sequence[i-1] := i; + + // Initialize arrays + for i := 0 to NoSelected-1 do + begin + ColTots[i,0] := 0; + ColTots[i,1] := 0; + ColProps[i] := 0.0; + ErrorMat[i,0] := 0; + ErrorMat[i,1] := 0; + end; + for i := 0 to NoCases-1 do + begin + RowTots[i] := 0; + CutScore[i] := 0; + CaseNo[i] := i+1; + for j := 0 to NoSelected-1 do + begin + FreqMat0[i,j] := 0; + FreqMat1[i,j] := 0; + end; + end; + if (NoCases > NoSelected) then + begin + for i := 1 to NoCases do CaseVector[i-1] := 0; + end + else begin + for i := 1 to NoSelected do CaseVector[i-1] := 0; + end; + + // Get data into the frequency matrices of 0 and 1 responses + for i := 1 to NoCases do + begin + if (not GoodRecord(i,NoSelected,ColNoSelected)) then continue; + TotalScore := 0; + for j := 1 to NoSelected do + begin + col := ColNoSelected[j-1]; + X := round(StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[col,i]))); + CaseVector[j-1] := X; + TotalScore := TotalScore + X; + end; + for j := 1 to NoSelected do + begin + if (CaseVector[j-1] = 0) then FreqMat0[i-1,j-1] := 1 + else FreqMat1[i-1,j-1] := 1; + end; + end; + + // Get Row Totals for each score group (rows of FreqMat1) + for i := 1 to NoCases do + begin + if (not GoodRecord(i,NoSelected,ColNoSelected)) then continue; + for j := 1 to NoSelected do + begin + RowTots[i-1] := RowTots[i-1] + FreqMat1[i-1,j-1]; + end; + end; + + // Get Column Totals for item scores of 1 and 0 + for i := 1 to NoSelected do //columns + begin + for j := 1 to NoCases do // rows + begin + if (not GoodRecord(j,NoSelected,ColNoSelected)) then continue; + ColTots[i-1,0] := ColTots[i-1,0] + FreqMat0[j-1,i-1]; + ColTots[i-1,1] := ColTots[i-1,1] + FreqMat1[j-1,i-1]; + end; + end; + + //Sort frequency matrices into descending order + for i := 1 to NoCases - 1 do + begin + if (not GoodRecord(i,NoSelected,ColNoSelected)) then continue; + for j := i + 1 to NoCases do + begin + if (not GoodRecord(j,NoSelected,ColNoSelected)) then continue; + if (RowTots[i-1] < RowTots[j-1]) then //swap + begin + for k := 1 to NoSelected do + begin // carry all columns in the swap + temp := FreqMat0[i-1,k-1]; + FreqMat0[i-1,k-1] := FreqMat0[j-1,k-1]; + FreqMat0[j-1,k-1] := temp; + temp := FreqMat1[i-1,k-1]; + FreqMat1[i-1,k-1] := FreqMat1[j-1,k-1]; + FreqMat1[j-1,k-1] := temp; + end; + // Also swap row totals + temp := RowTots[i-1]; + RowTots[i-1] := RowTots[j-1]; + RowTots[j-1] := temp; + // And case number + temp := CaseNo[i-1]; + CaseNo[i-1] := CaseNo[j-1]; + CaseNo[j-1] := temp; + end; // end if + end; // Next j + end; // next i + + // Now sort the columns into ascending order of number right + for i := 1 to NoSelected - 1 do + begin + for j := i + 1 to NoSelected do + begin + if (ColTots[i-1,1] > ColTots[j-1,1]) then //swap + begin + for k := 1 to NoCases do + begin + if (not GoodRecord(k,NoSelected,ColNoSelected)) then continue; + temp := FreqMat0[k-1,i-1]; + FreqMat0[k-1,i-1] := FreqMat0[k-1,j-1]; + FreqMat0[k-1,j-1] := temp; + temp := FreqMat1[k-1,i-1]; + FreqMat1[k-1,i-1] := FreqMat1[k-1,j-1]; + FreqMat1[k-1,j-1] := temp; + end; // next k + // swap column totals also + temp := ColTots[i-1,0]; + ColTots[i-1,0] := ColTots[j-1,0]; + ColTots[j-1,0] := temp; + temp := ColTots[i-1,1]; + ColTots[i-1,1] := ColTots[j-1,1]; + ColTots[j-1,1] := temp; + // swap label pointers + temp := sequence[i-1]; + sequence[i-1] := sequence[j-1]; + sequence[j-1] := temp; + end; // end if + end; // next j + end; // next i + + //For each item (column), find the optimal cutting value + for i := 1 to NoSelected do + begin + CutScore[i-1] := 0; + for j := 1 to NoCases do // j is the trial cut point + begin + if (not GoodRecord(j,NoSelected,ColNoSelected)) then continue; + e0 := 0; + e1 := 0; + //Get errors prior to the cut point + for k := 1 to j do + begin + if (not GoodRecord(k,NoSelected,ColNoSelected)) then continue; + if (FreqMat0[k-1,i-1] = 1) then e0 := e0 + 1; + end; + //Get errors following the cut point + for k := j + 1 to NoCases do + begin + if (not GoodRecord(k,NoSelected,ColNoSelected)) then continue; + if (FreqMat1[k-1,i-1] = 1) then e1 := e1 + 1; + end; + //Save errors for each cut + CaseVector[j-1] := e0 + e1; + end; // next j + // Save minimum cut score index + e2 := 32000; + e3 := 0; + for j := 1 to NoCases do + begin + if (not GoodRecord(j,NoSelected,ColNoSelected)) then continue; + if (CaseVector[j-1] < e2) then + begin + e2 := CaseVector[j-1]; + e3 := j; + end; + end; + CutScore[i-1] := e3; //Position of optimal cut for item i + end; + + // Get error counts; + for i := 1 to NoSelected do + begin + for j := 1 to CutScore[i-1] do + begin + if (not GoodRecord(j,NoSelected,ColNoSelected)) then continue; + if ((FreqMat0[j-1,i-1] > 0) or (FreqMat1[j-1,i-1] > 0)) then + ErrorMat[i-1,0] := ErrorMat[i-1,0] + FreqMat0[j-1,i-1]; + end; + for j := CutScore[i-1] + 1 to NoCases do + begin + if (not GoodRecord(j,NoSelected,ColNoSelected)) then continue; + if ((FreqMat0[j-1,i-1] > 0) or (FreqMat1[j-1,i-1] > 0)) then + ErrorMat[i-1,1] := ErrorMat[i-1,1] + FreqMat1[j-1,i-1]; + end; + end; + + // Print results + OutPutFrm.RichEdit.Lines.Add(' GUTTMAN SCALOGRAM ANALYSIS'); + OutPutFrm.RichEdit.Lines.Add(' Cornell Method'); + OutPutFrm.RichEdit.Lines.Add(''); + outline := format('No. of Cases := %3d. No. of items := %3d',[NoCases,NoSelected]); + OutPutFrm.RichEdit.Lines.Add(outline); + OutPutFrm.RichEdit.Lines.Add('RESPONSE MATRIX'); + first := 1; + last := first + 5; // column (item) index + if (last > NoSelected) then last := NoSelected; + done := false; + + while (not done) do //loop through all of the score groups + begin + OutPutFrm.RichEdit.Lines.Add('Subject Row Item Number'); + outline := 'Label Sum'; + for i := first to last do + begin + astring := format('%10s',[VarLabels[sequence[i-1]-1]]); + outline := outline + astring; + end; + OutPutFrm.RichEdit.Lines.Add(outline); + outline := ' '; + for i := first to last do + begin + astring := ' 0 1 '; + outline := outline + astring; + end; + OutPutFrm.RichEdit.Lines.Add(outline); + OutPutFrm.RichEdit.Lines.Add(''); + for i := 1 to NoCases do // rows + begin + if (not GoodRecord(i,NoSelected,ColNoSelected)) then continue; + outline := format(' %3d %3d ',[CaseNo[i-1],RowTots[i-1]]); + for j := first to last do + begin + astring := format(' %3d %3d ',[FreqMat0[i-1,j-1],FreqMat1[i-1,j-1]]); + outline := outline + astring; + end; + OutPutFrm.RichEdit.Lines.Add(outline); + outline := ' '; + // check for optimal cut point for this score + for j := first to last do + begin + if (CutScore[j-1] = i) then + begin + astring := ' -cut- '; + outline := outline + astring; + end + else begin + astring := ' '; + outline := outline + astring; + end; + end; + OutPutFrm.RichEdit.Lines.Add(outline); + outline := ''; + end; // Next row (score group) + OutPutFrm.RichEdit.Lines.Add(''); + outline := 'TOTALS '; + for j := first to last do + begin + astring := format(' %3d %3d ',[ColTots[j-1,0],ColTots[j-1,1]]); + outline := outline + astring; + end; + OutPutFrm.RichEdit.Lines.Add(outline); + outline := 'ERRORS '; + for j := first to last do + begin + astring := format(' %3d %3d ',[ErrorMat[j-1,0],ErrorMat[j-1,1]]); + outline := outline + astring; + end; + OutPutFrm.RichEdit.Lines.Add(outline); + if (last < NoSelected) then + begin + first := last + 1; + last := first + 5; // column (item) index + if (last > NoSelected) then last := NoSelected; + end + else done := true; + OutPutFrm.RichEdit.Lines.Add(''); + end; + + OutPutFrm.RichEdit.Lines.Add(''); + CoefRepro := 0.0; + for j := 1 to NoSelected do + CoefRepro := CoefRepro + ErrorMat[j-1,0] + ErrorMat[j-1,1]; + CoefRepro := 1.0 - (CoefRepro / (NoCases * NoSelected)); + outline := format('Coefficient of Reproducibility := %6.3f',[CoefRepro]); + OutPutFrm.RichEdit.Lines.Add(outline); + OutPutFrm.ShowModal; + OutPutFrm.RichEdit.Clear; + + //-----------------------------GOODENOUGH---------------------------------- + // Complete Goodenough method and print results + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add(' GUTTMAN SCALOGRAM ANALYSIS'); + OutPutFrm.RichEdit.Lines.Add(' Goodenough Modification Using Modal Responses'); + totalerrors := 0; + Min_Coeff := 0.0; + for i := 1 to NoSelected + 1 do + for j := 1 to NoSelected do ModalArray[i-1,j-1] := 0; + for i := 1 to NoSelected do // column + begin + ColProps[i-1] := ColTots[i-1,1] / NoCases; + ErrorMat[i-1,0] := 0; + ErrorMat[i-1,1] := 0; + end; + // Get the cut scores for each score row based on rounded proportions + for i := 1 to NoSelected do + begin + CutScore[i-1] := Trunc(ColProps[i-1] * (NoSelected+1)); + end; + // Build modal response array for the total scores by items + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add(' MODAL ITEM RESPONSES'); + OutPutFrm.RichEdit.Lines.Add('TOTAL ITEMS'); + outline := ' '; + for i := 1 to NoSelected do + begin + astring := format('%10s',[VarLabels[sequence[i-1]-1]]); + outline := outline + astring; + end; + OutPutFrm.RichEdit.Lines.Add(outline); + for i := 0 to NoSelected do + begin + for j := 1 to NoSelected do + begin + if (CutScore[j-1] > i) then ModalArray[i,j-1] := 1 + else ModalArray[i,j-1] := 0; + end; + astring := format(' %3d ',[NoSelected - i]); + outline := astring; + for j := 1 to NoSelected do + begin + astring := format(' %3d ',[ModalArray[i,j-1]]); + outline := outline + astring; + end; + OutPutFrm.RichEdit.Lines.Add(outline); + end; + + OutPutFrm.RichEdit.Lines.Add(''); + outline := format('No. of Cases := %3d. No. of items := %3d',[NoCases,NoSelected]); + OutPutFrm.RichEdit.Lines.Add(outline); + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add('RESPONSE MATRIX'); + first := 1; + last := first + 5; // column (item) index + if (last > NoSelected) then last := NoSelected; + done := false; + + while (not done) do //loop through all of the score groups + begin + OutPutFrm.RichEdit.Lines.Add('Subject Row Error Item Number'); + outline := 'Label Sum Count'; + for i := first to last do + begin + astring := format('%10s',[VarLabels[sequence[i-1]-1]]); + outline := outline + astring; + end; + OutPutFrm.RichEdit.Lines.Add(outline); + outline := ' '; + for i := first to last do + begin + astring := ' 0 1 '; + outline := outline + astring; + end; + OutPutFrm.RichEdit.Lines.Add(outline); + OutPutFrm.RichEdit.Lines.Add(''); + for i := 1 to NoCases do // rows + begin + if (not GoodRecord(i,NoSelected,ColNoSelected)) then continue; + errors := 0; + for j := first to last do + begin + rowno := NoSelected - RowTots[i-1] + 1; + if (FreqMat1[i-1,j-1] <> ModalArray[rowno-1,j-1]) then errors := errors + 1; + end; + + outline := format(' %3d %3d %3d ',[CaseNo[i-1],RowTots[i-1],errors]); + for j := first to last do + begin + astring := format(' %3d %3d ',[FreqMat0[i-1,j-1],FreqMat1[i-1,j-1]]); + outline := outline + astring; + end; + OutPutFrm.RichEdit.Lines.Add(outline); + totalerrors := totalerrors + errors; + end; // Next row (score group) + OutPutFrm.RichEdit.Lines.Add(''); + + outline :='TOTALS '; + for j := first to last do + begin + astring := format(' %3d %3d ',[ColTots[j-1,0],ColTots[j-1,1]]); + outline := outline + astring; + end; + OutPutFrm.RichEdit.Lines.Add(outline); + + outline := 'PROPORTIONS '; + for j := first to last do + begin + astring := format('%4.2f %4.2f ',[(1.0-ColProps[j-1]),ColProps[j-1]]); + outline := outline + astring; + end; + OutPutFrm.RichEdit.Lines.Add(outline); + + if (last < NoSelected) then + begin + first := last + 1; + last := first + 5; // column (item) index + if (last > NoSelected) then last := NoSelected; + end + else done := true; + OutPutFrm.RichEdit.Lines.Add(''); + end; + OutPutFrm.RichEdit.Lines.Add(''); + CoefRepro := 1.0 - (totalerrors / (NoCases * NoSelected)); + outline := format('Coefficient of Reproducibility := %6.3f',[CoefRepro]); + OutPutFrm.RichEdit.Lines.Add(outline); + for j := 1 to NoSelected do + begin + if (ColProps[j-1] > (1.0 - ColProps[j-1])) then Min_Coeff := Min_Coeff + ColProps[j-1] + else Min_Coeff := Min_Coeff + (1.0 - ColProps[j-1]); + end; + Min_Coeff := Min_coeff / NoSelected; + outline := format('Minimal Marginal Reproducibility := %6.3f',[Min_Coeff]); + OutPutFrm.RichEdit.Lines.Add(outline); + OutPutFrm.ShowModal; + + // Clean up the heap + VarLabels := nil; + ModalArray := nil; + CaseNo := nil; + sequence := nil; + ErrorMat := nil; + CutScore := nil; + CaseVector := nil; + ColProps := nil; + ColTots := nil; + RowTots := nil; + FreqMat1 := nil; + FreqMat0 := nil; + ColNoSelected := nil; +end; + +procedure TGuttmanFrm.InBtnClick(Sender: TObject); +VAR i, index : integer; +begin + index := VarList.Items.Count; + i := 0; + while i < index do + begin + if (VarList.Selected[i]) then + begin + ItemList.Items.Add(VarList.Items.Strings[i]); + VarList.Items.Delete(i); + index := index - 1; + i := 0; + end + else i := i + 1; + end; + OutBtn.Visible := true; +end; + +procedure TGuttmanFrm.OutBtnClick(Sender: TObject); +VAR index : integer; +begin + index := ItemList.ItemIndex; + if index < 0 then + begin + OutBtn.Visible := false; + exit; + end; + VarList.Items.Add(ItemList.Items.Strings[index]); + ItemList.Items.Delete(index); +end; + +initialization + {$I guttmanunit.lrs} + +end. + diff --git a/applications/lazstats/source_orig/helpunit.lfm b/applications/lazstats/source_orig/helpunit.lfm new file mode 100644 index 000000000..d0f03470c --- /dev/null +++ b/applications/lazstats/source_orig/helpunit.lfm @@ -0,0 +1,53 @@ +object HelpFrm: THelpFrm + Left = 239 + Height = 117 + Top = 107 + Width = 303 + Caption = 'HTML Help Viewer' + ClientHeight = 117 + ClientWidth = 303 + OnCreate = FormCreate + OnShow = FormShow + LCLVersion = '0.9.28.2' + object Label1: TLabel + Left = 9 + Height = 14 + Top = 8 + Width = 235 + Caption = 'PRESS THE Button for the TABLE OF CONTENTS!' + ParentColor = False + end + object HelpBtn: TButton + Left = 8 + Height = 28 + Top = 32 + Width = 154 + HelpType = htKeyword + HelpKeyword = 'HTML/LAZTOC.html' + Caption = 'Table of Contents' + OnClick = HelpBtnClick + TabOrder = 0 + end + object ReturnBtn: TButton + Left = 200 + Height = 27 + Top = 32 + Width = 85 + Caption = 'Return' + ModalResult = 1 + TabOrder = 1 + end + object HTMLHelpDatabase1: THTMLHelpDatabase + BaseURL = 'file://html/' + AutoRegister = True + KeywordPrefix = 'HTML/' + left = 16 + top = 72 + end + object HTMLBrowserHelpViewer1: THTMLBrowserHelpViewer + BrowserParams = '%s' + AutoRegister = True + left = 144 + top = 72 + end +end diff --git a/applications/lazstats/source_orig/helpunit.lrs b/applications/lazstats/source_orig/helpunit.lrs new file mode 100644 index 000000000..4e8d669d4 --- /dev/null +++ b/applications/lazstats/source_orig/helpunit.lrs @@ -0,0 +1,19 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('THelpFrm','FORMDATA',[ + 'TPF0'#8'THelpFrm'#7'HelpFrm'#4'Left'#3#239#0#6'Height'#2'u'#3'Top'#2'k'#5'Wi' + +'dth'#3'/'#1#7'Caption'#6#16'HTML Help Viewer'#12'ClientHeight'#2'u'#11'Clie' + +'ntWidth'#3'/'#1#8'OnCreate'#7#10'FormCreate'#6'OnShow'#7#8'FormShow'#10'LCL' + +'Version'#6#8'0.9.28.2'#0#6'TLabel'#6'Label1'#4'Left'#2#9#6'Height'#2#14#3'T' + +'op'#2#8#5'Width'#3#235#0#7'Caption'#6'+PRESS THE Button for the TABLE OF CO' + +'NTENTS!'#11'ParentColor'#8#0#0#7'TButton'#7'HelpBtn'#4'Left'#2#8#6'Height'#2 + +#28#3'Top'#2' '#5'Width'#3#154#0#8'HelpType'#7#9'htKeyword'#11'HelpKeyword'#6 + +#16'HTML/LAZTOC.html'#7'Caption'#6#17'Table of Contents'#7'OnClick'#7#12'Hel' + +'pBtnClick'#8'TabOrder'#2#0#0#0#7'TButton'#9'ReturnBtn'#4'Left'#3#200#0#6'He' + +'ight'#2#27#3'Top'#2' '#5'Width'#2'U'#7'Caption'#6#6'Return'#11'ModalResult' + +#2#1#8'TabOrder'#2#1#0#0#17'THTMLHelpDatabase'#17'HTMLHelpDatabase1'#7'BaseU' + +'RL'#6#12'file://html/'#12'AutoRegister'#9#13'KeywordPrefix'#6#5'HTML/'#4'le' + +'ft'#2#16#3'top'#2'H'#0#0#22'THTMLBrowserHelpViewer'#22'HTMLBrowserHelpViewe' + +'r1'#13'BrowserParams'#6#2'%s'#12'AutoRegister'#9#4'left'#3#144#0#3'top'#2'H' + +#0#0#0 +]); diff --git a/applications/lazstats/source_orig/helpunit.pas b/applications/lazstats/source_orig/helpunit.pas new file mode 100644 index 000000000..64485bafd --- /dev/null +++ b/applications/lazstats/source_orig/helpunit.pas @@ -0,0 +1,56 @@ +unit HelpUnit; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, + StdCtrls, LazHelpHTML, HelpIntfs; + +type + + { THelpFrm } + + THelpFrm = class(TForm) + ReturnBtn: TButton; + HelpBtn: TButton; + HTMLBrowserHelpViewer1: THTMLBrowserHelpViewer; + HTMLHelpDatabase1: THTMLHelpDatabase; + Label1: TLabel; + procedure FormCreate(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure HelpBtnClick(Sender: TObject); + private + { private declarations } + public + { public declarations } + end; + +var + HelpFrm: THelpFrm; + +implementation + +{ THelpFrm } + +procedure THelpFrm.FormShow(Sender: TObject); +begin +// HelpBtnClick(self); +end; + +procedure THelpFrm.FormCreate(Sender: TObject); +begin + HTMLHelpDatabase1.BaseURL := 'file://html'; +end; + +procedure THelpFrm.HelpBtnClick(Sender: TObject); +begin + ShowHelpOrErrorForKeyword('','HTML/LAZTOC.html'); +end; + +initialization + {$I helpunit.lrs} + +end. + diff --git a/applications/lazstats/source_orig/hierarchunit.lfm b/applications/lazstats/source_orig/hierarchunit.lfm new file mode 100644 index 000000000..701b5ee26 --- /dev/null +++ b/applications/lazstats/source_orig/hierarchunit.lfm @@ -0,0 +1,242 @@ +object HierarchFrm: THierarchFrm + Left = 172 + Height = 340 + Top = 97 + Width = 464 + Caption = 'Hierarchical Cluster Analysis' + ClientHeight = 340 + ClientWidth = 464 + OnShow = FormShow + LCLVersion = '0.9.26.2' + object Label1: TLabel + Left = 6 + Height = 14 + Top = 6 + Width = 90 + Caption = 'Available Variables' + ParentColor = False + end + object Label2: TLabel + Left = 211 + Height = 14 + Top = 7 + Width = 90 + Caption = 'Predictor Variables' + ParentColor = False + end + object VarList: TListBox + Left = 5 + Height = 306 + Top = 22 + Width = 154 + MultiSelect = True + TabOrder = 0 + end + object PredIn: TBitBtn + Left = 168 + Height = 32 + Top = 25 + Width = 32 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00216324B81D5E2006FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF002A702F38256929F7216324D9FFFFFF00FFFFFF00FFFFFF00FFFFFF0061BE + 6DFF5DB868FF58B162FF53A95CFF4DA156FF47994FFF419149FF3B8842FF3580 + 3BFF3F8845FF59A15EFF448B49FF216324CFFFFFFF00FFFFFF00FFFFFF0065C3 + 71FFA0D7A9FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF458C4AFF216324C4FFFFFF00FFFFFF0068C7 + 74FFA5DAAEFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF4A9150FF256929C9FFFFFF00FFFFFF0068C7 + 74FF68C774FF65C371FF61BE6DFF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF5AA362FF559D5CFF2F7835D1FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00419149F73B8842DBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0047994FBB41914906FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + NumGlyphs = 0 + OnClick = PredInClick + TabOrder = 1 + end + object PredOut: TBitBtn + Left = 168 + Height = 32 + Top = 64 + Width = 32 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF004DA1560647994FB8FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0053A95CD94DA156F747994F38FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF005DB868CF71BE7BFF7AC183FF5BAA64FF47994FFF419149FF3B8842FF3580 + 3BFF2F7835FF2A702FFF256929FF216324FF1D5E20FFFFFFFF00FFFFFF0065C3 + 71C47BC886FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF72BD78FF216324FFFFFFFF00FFFFFF0068C7 + 74C97FCC8AFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF78C07EFF256929FFFFFFFF00FFFFFF00FFFF + FF0068C774D180CD8BFF7CC987FF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF3B8842FF35803BFF2F7835FF2A702FFFFFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C774DB65C371F7FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C7740668C774BBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + NumGlyphs = 0 + OnClick = PredOutClick + TabOrder = 2 + end + object PredList: TListBox + Left = 208 + Height = 121 + Top = 24 + Width = 160 + TabOrder = 3 + end + object GroupBox1: TGroupBox + Left = 166 + Height = 176 + Top = 153 + Width = 205 + Caption = 'Options' + ClientHeight = 158 + ClientWidth = 201 + TabOrder = 4 + object STDChk: TCheckBox + Left = 8 + Height = 17 + Top = 4 + Width = 122 + Caption = 'Standardize Variables' + TabOrder = 0 + end + object ReplaceChk: TCheckBox + Left = 44 + Height = 17 + Top = 23 + Width = 117 + Caption = 'Replace Grid Values' + TabOrder = 1 + end + object StatsChk: TCheckBox + Left = 8 + Height = 17 + Top = 44 + Width = 118 + Caption = 'Descriptive Statistics' + TabOrder = 2 + end + object PlotChk: TCheckBox + Left = 8 + Height = 17 + Top = 67 + Width = 139 + Caption = 'No. Groups vs Errors Plot' + TabOrder = 3 + end + object MaxGrpsChk: TCheckBox + Left = 8 + Height = 17 + Top = 91 + Width = 124 + Caption = 'Maximum No. Groups:' + TabOrder = 4 + end + object MembersChk: TCheckBox + Left = 7 + Height = 17 + Top = 116 + Width = 133 + Caption = 'Print Group Membership' + TabOrder = 5 + end + object VarChk: TCheckBox + Left = 8 + Height = 17 + Top = 139 + Width = 150 + Caption = 'Cluster Variables, not cases' + TabOrder = 6 + end + object MaxGrps: TEdit + Left = 143 + Height = 20 + Top = 86 + Width = 37 + TabOrder = 7 + Text = 'MaxGrps' + end + end + object ResetBtn: TButton + Left = 384 + Height = 31 + Top = 25 + Width = 72 + Caption = 'Reset' + OnClick = ResetBtnClick + TabOrder = 5 + end + object CancelBtn: TButton + Left = 384 + Height = 31 + Top = 80 + Width = 72 + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 6 + end + object ComputeBtn: TButton + Left = 384 + Height = 31 + Top = 136 + Width = 72 + Caption = 'Compute' + OnClick = ComputeBtnClick + TabOrder = 7 + end + object ReturnBtn: TButton + Left = 384 + Height = 31 + Top = 192 + Width = 72 + Caption = 'Return' + ModalResult = 1 + TabOrder = 8 + end +end diff --git a/applications/lazstats/source_orig/hierarchunit.lrs b/applications/lazstats/source_orig/hierarchunit.lrs new file mode 100644 index 000000000..81a7c0a2e --- /dev/null +++ b/applications/lazstats/source_orig/hierarchunit.lrs @@ -0,0 +1,142 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('THierarchFrm','FORMDATA',[ + 'TPF0'#12'THierarchFrm'#11'HierarchFrm'#4'Left'#3#172#0#6'Height'#3'T'#1#3'To' + +'p'#2'a'#5'Width'#3#208#1#7'Caption'#6#29'Hierarchical Cluster Analysis'#12 + +'ClientHeight'#3'T'#1#11'ClientWidth'#3#208#1#6'OnShow'#7#8'FormShow'#10'LCL' + +'Version'#6#8'0.9.26.2'#0#6'TLabel'#6'Label1'#4'Left'#2#6#6'Height'#2#14#3'T' + +'op'#2#6#5'Width'#2'Z'#7'Caption'#6#19'Available Variables'#11'ParentColor'#8 + +#0#0#6'TLabel'#6'Label2'#4'Left'#3#211#0#6'Height'#2#14#3'Top'#2#7#5'Width'#2 + +'Z'#7'Caption'#6#19'Predictor Variables'#11'ParentColor'#8#0#0#8'TListBox'#7 + +'VarList'#4'Left'#2#5#6'Height'#3'2'#1#3'Top'#2#22#5'Width'#3#154#0#11'Multi' + +'Select'#9#8'TabOrder'#2#0#0#0#7'TBitBtn'#6'PredIn'#4'Left'#3#168#0#6'Height' + +#2' '#3'Top'#2#25#5'Width'#2' '#10'Glyph.Data'#10':'#4#0#0'6'#4#0#0'BM6'#4#0 + +#0#0#0#0#0'6'#0#0#0'('#0#0#0#16#0#0#0#16#0#0#0#1#0' '#0#0#0#0#0#0#4#0#0'd'#0 + +#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0'!c$'#184#29'^ '#6#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0'*p/8%i)'#247'!c$'#217#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0'a'#190'm'#255']'#184'h'#255'X'#177'b'#255'S'#169'\'#255'M'#161 + +'V'#255'G'#153'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';'#255'?'#136'E'#255 + +'Y'#161'^'#255'D'#139'I'#255'!c$'#207#255#255#255#0#255#255#255#0#255#255#255 + +#0'e'#195'q'#255#160#215#169#255#156#213#165#255#152#211#161#255#148#208#157 + +#255#144#206#152#255#139#203#147#255#135#201#142#255#130#198#137#255'~'#195 + +#132#255'z'#193#128#255'v'#190'|'#255'E'#140'J'#255'!c$'#196#255#255#255#0 + +#255#255#255#0'h'#199't'#255#165#218#174#255#162#216#171#255#158#214#167#255 + +#154#212#163#255#150#210#159#255#147#207#154#255#142#204#149#255#137#202#144 + +#255#133#199#139#255#129#197#135#255'}'#194#130#255'J'#145'P'#255'%i)'#201 + +#255#255#255#0#255#255#255#0'h'#199't'#255'h'#199't'#255'e'#195'q'#255'a'#190 + +'m'#255']'#184'h'#255'X'#177'b'#255'S'#169'\'#255'M'#161'V'#255'G'#153'O'#255 + +'A'#145'I'#255'Z'#163'b'#255'U'#157'\'#255'/x5'#209#255#255#255#0#255#255#255 + +#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0'A'#145'I'#247';'#136'B'#219#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0'G'#153'O'#187'A'#145'I'#6#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#9'NumGlyphs'#2#0#7'OnClick'#7#11'PredInClick'#8'TabOrder'#2#1#0#0#7'TBitBtn' + +#7'PredOut'#4'Left'#3#168#0#6'Height'#2' '#3'Top'#2'@'#5'Width'#2' '#10'Glyp' + +'h.Data'#10':'#4#0#0'6'#4#0#0'BM6'#4#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#16#0#0#0 + +#16#0#0#0#1#0' '#0#0#0#0#0#0#4#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + ,#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0'M'#161'V'#6'G'#153'O'#184#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0'S'#169'\'#217'M'#161'V'#247'G'#153'O8'#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0']'#184'h'#207'q'#190'{'#255'z'#193#131#255'['#170'd'#255'G' + +#153'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';'#255'/x5'#255'*p/'#255'%i)' + +#255'!c$'#255#29'^ '#255#255#255#255#0#255#255#255#0'e'#195'q'#196'{'#200#134 + +#255#156#213#165#255#152#211#161#255#148#208#157#255#144#206#152#255#139#203 + +#147#255#135#201#142#255#130#198#137#255'~'#195#132#255'z'#193#128#255'v'#190 + +'|'#255'r'#189'x'#255'!c$'#255#255#255#255#0#255#255#255#0'h'#199't'#201'' + +#204#138#255#162#216#171#255#158#214#167#255#154#212#163#255#150#210#159#255 + +#147#207#154#255#142#204#149#255#137#202#144#255#133#199#139#255#129#197#135 + +#255'}'#194#130#255'x'#192'~'#255'%i)'#255#255#255#255#0#255#255#255#0#255 + +#255#255#0'h'#199't'#209#128#205#139#255'|'#201#135#255']'#184'h'#255'X'#177 + +'b'#255'S'#169'\'#255'M'#161'V'#255'G'#153'O'#255'A'#145'I'#255';'#136'B'#255 + +'5'#128';'#255'/x5'#255'*p/'#255#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0'h'#199't'#219'e'#195'q'#247#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0'h'#199't'#6'h'#199't'#187#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#9'NumGlyphs'#2#0#7'OnClick'#7#12 + +'PredOutClick'#8'TabOrder'#2#2#0#0#8'TListBox'#8'PredList'#4'Left'#3#208#0#6 + +'Height'#2'y'#3'Top'#2#24#5'Width'#3#160#0#8'TabOrder'#2#3#0#0#9'TGroupBox'#9 + +'GroupBox1'#4'Left'#3#166#0#6'Height'#3#176#0#3'Top'#3#153#0#5'Width'#3#205#0 + +#7'Caption'#6#7'Options'#12'ClientHeight'#3#158#0#11'ClientWidth'#3#201#0#8 + +'TabOrder'#2#4#0#9'TCheckBox'#6'STDChk'#4'Left'#2#8#6'Height'#2#17#3'Top'#2#4 + +#5'Width'#2'z'#7'Caption'#6#21'Standardize Variables'#8'TabOrder'#2#0#0#0#9 + +'TCheckBox'#10'ReplaceChk'#4'Left'#2','#6'Height'#2#17#3'Top'#2#23#5'Width'#2 + +'u'#7'Caption'#6#19'Replace Grid Values'#8'TabOrder'#2#1#0#0#9'TCheckBox'#8 + +'StatsChk'#4'Left'#2#8#6'Height'#2#17#3'Top'#2','#5'Width'#2'v'#7'Caption'#6 + +#22'Descriptive Statistics'#8'TabOrder'#2#2#0#0#9'TCheckBox'#7'PlotChk'#4'Le' + +'ft'#2#8#6'Height'#2#17#3'Top'#2'C'#5'Width'#3#139#0#7'Caption'#6#25'No. Gro' + +'ups vs Errors Plot'#8'TabOrder'#2#3#0#0#9'TCheckBox'#10'MaxGrpsChk'#4'Left' + +#2#8#6'Height'#2#17#3'Top'#2'['#5'Width'#2'|'#7'Caption'#6#19'Maximum No. Gr' + +'oups:'#8'TabOrder'#2#4#0#0#9'TCheckBox'#10'MembersChk'#4'Left'#2#7#6'Height' + +#2#17#3'Top'#2't'#5'Width'#3#133#0#7'Caption'#6#22'Print Group Membership'#8 + +'TabOrder'#2#5#0#0#9'TCheckBox'#6'VarChk'#4'Left'#2#8#6'Height'#2#17#3'Top'#3 + +#139#0#5'Width'#3#150#0#7'Caption'#6#28'Cluster Variables, not cases'#8'TabO' + ,'rder'#2#6#0#0#5'TEdit'#7'MaxGrps'#4'Left'#3#143#0#6'Height'#2#20#3'Top'#2'V' + +#5'Width'#2'%'#8'TabOrder'#2#7#4'Text'#6#7'MaxGrps'#0#0#0#7'TButton'#8'Reset' + +'Btn'#4'Left'#3#128#1#6'Height'#2#31#3'Top'#2#25#5'Width'#2'H'#7'Caption'#6#5 + +'Reset'#7'OnClick'#7#13'ResetBtnClick'#8'TabOrder'#2#5#0#0#7'TButton'#9'Canc' + +'elBtn'#4'Left'#3#128#1#6'Height'#2#31#3'Top'#2'P'#5'Width'#2'H'#7'Caption'#6 + +#6'Cancel'#11'ModalResult'#2#2#8'TabOrder'#2#6#0#0#7'TButton'#10'ComputeBtn' + +#4'Left'#3#128#1#6'Height'#2#31#3'Top'#3#136#0#5'Width'#2'H'#7'Caption'#6#7 + +'Compute'#7'OnClick'#7#15'ComputeBtnClick'#8'TabOrder'#2#7#0#0#7'TButton'#9 + +'ReturnBtn'#4'Left'#3#128#1#6'Height'#2#31#3'Top'#3#192#0#5'Width'#2'H'#7'Ca' + +'ption'#6#6'Return'#11'ModalResult'#2#1#8'TabOrder'#2#8#0#0#0 +]); diff --git a/applications/lazstats/source_orig/hierarchunit.pas b/applications/lazstats/source_orig/hierarchunit.pas new file mode 100644 index 000000000..f2469b40b --- /dev/null +++ b/applications/lazstats/source_orig/hierarchunit.pas @@ -0,0 +1,485 @@ +unit HierarchUnit; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, + StdCtrls, Buttons, MainUnit, OutPutUnit, FunctionsLib, GraphLib, + Globals, MatrixLib, DataProcs, Math; + +type + + { THierarchFrm } + + THierarchFrm = class(TForm) + ResetBtn: TButton; + CancelBtn: TButton; + ComputeBtn: TButton; + ReturnBtn: TButton; + MaxGrps: TEdit; + STDChk: TCheckBox; + ReplaceChk: TCheckBox; + StatsChk: TCheckBox; + PlotChk: TCheckBox; + MaxGrpsChk: TCheckBox; + MembersChk: TCheckBox; + VarChk: TCheckBox; + GroupBox1: TGroupBox; + PredIn: TBitBtn; + PredOut: TBitBtn; + Label1: TLabel; + Label2: TLabel; + PredList: TListBox; + VarList: TListBox; + procedure ComputeBtnClick(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure PredInClick(Sender: TObject); + procedure PredOutClick(Sender: TObject); + procedure ResetBtnClick(Sender: TObject); + private + { private declarations } + public + { public declarations } + end; + +var + HierarchFrm: THierarchFrm; + +implementation + +{ THierarchFrm } + +procedure THierarchFrm.ResetBtnClick(Sender: TObject); +VAR i : integer; +begin + VarList.Clear; + PredList.Clear; + PredOut.Visible := false; + PredIn.Visible := true; + StdChk.Checked := false; + ReplaceChk.Checked := false; + StatsChk.Checked := false; + PlotChk.Checked := false; + MaxGrpsChk.Checked := false; + VarChk.Checked := false; + MaxGrps.Text := ''; + for i := 1 to NoVariables do + VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]); +end; + +procedure THierarchFrm.FormShow(Sender: TObject); +begin + ResetBtnClick(self); +end; + +procedure THierarchFrm.ComputeBtnClick(Sender: TObject); +label next1; +var + varlabels, rowlabels : StrDyneVec; + outline, cellstring : string; + i, j, k, k1, k3, L, w3, n3, n4, n5, M, col, count: integer; + GrpCnt, Nrows, Ncols, NoSelected, linecount : integer; + w2, k4, k5, L1 : IntDyneVec; + ColSelected : IntDyneVec; + X, Y, d1, x1, MaxError : double; + W, XAxis, YAxis, means, variances, stddevs : DblDyneVec; + Distance : DblDyneMat; +begin + MaxError := 0.0; + GrpCnt := 0; + NoSelected := PredList.Items.Count; + if VarChk.Checked = false then + begin + SetLength(w2,NoCases); + SetLength(k4,NoCases); + SetLength(k5,NoCases); + SetLength(L1,NoCases); + SetLength(W,NoSelected); + SetLength(XAxis,NoCases); + SetLength(YAxis,NoCases); + SetLength(means,NoSelected); + SetLength(variances,NoSelected); + SetLength(stddevs,NoSelected); + SetLength(Distance,NoCases,NoCases); + SetLength(varlabels,NoSelected); + SetLength(rowlabels,NoCases); + SetLength(ColSelected,NoSelected); + Ncols := NoSelected; + Nrows := NoCases; + for i := 0 to Ncols - 1 do + begin + cellstring := PredList.Items.Strings[i]; + for j := 1 to NoVariables do + begin + if (cellstring = OS3MainFrm.DataGrid.Cells[j,0]) then + begin + varlabels[i] := cellstring; + ColSelected[i] := j; + end; + end; + end; + for i := 0 to NoCases-1 do rowlabels[i] := IntToStr(i); + end + else begin + SetLength(w2,NoSelected); + SetLength(k4,NoSelected); + SetLength(k5,NoSelected); + SetLength(L1,NoSelected); + SetLength(W,NoCases); + SetLength(XAxis,NoSelected); + SetLength(YAxis,NoSelected); + SetLength(means,NoCases); + SetLength(variances,NoCases); + SetLength(stddevs,NoCases); + SetLength(Distance,NoSelected,NoCases); + SetLength(varlabels,NoCases); + SetLength(rowlabels,NoSelected); + SetLength(ColSelected,NoSelected); + Ncols := NoCases; + Nrows := NoSelected; + //Get labels of selected variables + for i := 0 to Nrows - 1 do + begin + cellstring := PredList.Items.Strings[i]; + for j := 1 to NoVariables do + begin + if (cellstring = OS3MainFrm.DataGrid.Cells[j,0]) then + begin + ColSelected[i] := j; + rowlabels[i] := cellstring; + end; + end; + end; + for i := 0 to NoCases-1 do varlabels[i] := IntToStr(i); + end; + if MembersChk.Checked then k3 := 1 else k3 := 0; + + for j := 0 to Ncols-1 do + begin + means[j] := 0.0; + variances[j] := 0.0; + stddevs[j] := 0.0; + end; + + if VarChk.Checked = false then + begin + // Get labels of rows +// for i := 1 to Nrows do rowlabels[i-1] := MainFrm.Grid.Cells[0,i]; + + // Get data into the distance matrix + count := 0; + for i := 1 to Nrows do + begin + if (not GoodRecord(i,NoSelected,ColSelected)) then continue; + count := count + 1; + for j := 1 to Ncols do + begin + col := ColSelected[j-1]; + X := StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[col,i])); + means[j-1] := means[j-1] + X; + variances[j-1] := variances[j-1] + (X * X); + Distance[i-1,j-1] := X; + end; + end; + end + else begin // cluster variables + // Get labels of columns +// for i := 1 to Nrows do rowlabels[i-1] := MainFrm.Grid.Cells[i,0]; + + // Get data into the distance matrix + count := 0; + for i := 1 to Nrows do // actually grid column in this case + begin +// if (not GoodRecord(i,NoSelected,ColSelected)) then continue; + count := count + 1; + for j := 1 to Ncols do // actually grid rows in this case + begin +// if (not GoodRecord(j,NoSelected,ColSelected)) then continue; + col := ColSelected[i-1]; + X := StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[col,j])); + means[j-1] := means[j-1] + X; + variances[j-1] := variances[j-1] + (X * X); + Distance[i-1,j-1] := X; + end; + end; + end; + + // Calculate means and standard deviations of variables + for j := 0 to Ncols-1 do + begin + variances[j] := variances[j] - (means[j] * means[j] / count); + variances[j] := variances[j] / (count - 1); + stddevs[j] := sqrt(variances[j]); + means[j] := means[j] / count; + end; + + // Ready the output form + OutPutFrm.RichEdit.Clear; + OutPutFrm.RichEdit.Lines.Add('Hierarchical Cluster Analysis'); + OutPutFrm.RichEdit.Lines.Add(''); + outline := format('Number of objects to cluster := %d on %d variables.', + [Nrows, Ncols]); + OutPutFrm.RichEdit.Lines.Add(outline); + linecount := 3; + if (StatsChk.Checked) then + begin + DynVectorPrint(means,Ncols,'Variable Means',varlabels,count); + DynVectorPrint(variances,Ncols,'Variable Variances',varlabels,count); + DynVectorPrint(stddevs,Ncols,'Variable Standard Deviations',varlabels,count); + OutPutFrm.ShowModal; + OutPutFrm.RichEdit.Clear; + linecount := 0; + end; + + // Standardize the distance scores if elected + if (StdChk.Checked) then + begin + for j := 0 to Ncols-1 do + for i := 0 to Nrows-1 do + Distance[i,j] := (Distance[i,j] - means[j]) / stddevs[j]; + end; + + if (ReplaceChk.Checked) then // replace original values in grid with z scores if elected + begin + for i := 1 to Nrows do + begin + if (not GoodRecord(i,NoSelected,ColSelected)) then continue; + for j := 1 to Ncols do + begin + col := ColSelected[j-1]; + outline := format('%6.4f',[Distance[i-1,j-1]]); + OS3MainFrm.DataGrid.Cells[col,i] := outline; + end; + end; + end; + + // Convert data matrix to initial matrix of error potentials + for i := 1 to Nrows do + begin +// if (not GoodRecord(i,NoSelected,ColSelected)) then continue; + for j := 1 to Ncols do W[j-1] := Distance[i-1,j-1]; + for j := i to Nrows do + begin +// if (not GoodRecord(i,NoSelected,ColSelected)) then continue; + Distance[i-1,j-1] := 0.0; + for k := 1 to Ncols do Distance[i-1,j-1] := Distance[i-1,j-1] + + (Distance[j-1,k-1] - W[k-1]) * (Distance[j-1,k-1] - W[k-1]); + Distance[i-1,j-1] := Distance[i-1,j-1] / 2.0; + end; + end; + for i := 1 to Nrows do + for j := i to Nrows do Distance[j-1,i-1] := 0.0; + + // Now, group the cases for maximum groups down + if MaxGrpsChk.Checked then + begin + k1 := StrToInt(MaxGrps.Text); + n3 := Nrows; + end + else begin + k1 := 2; + n3 := Nrows; + end; + + // Initialize group membership and group-n vectors + for i := 0 to Nrows-1 do + begin + k4[i] := i+1; + k5[i] := i+1; + w2[i] := 1; + end; + + // Locate optimal combination, if more than 2 groups remain +next1: + n3 := n3 - 1; + if (n3 > 1) then + begin + x1 := 100000000000.0; + for i := 1 to Nrows do + begin + if (k5[i-1] = i) then + begin + for j := i to Nrows do + begin + if ((i <> j) and (k5[j-1] = j)) then + begin + d1 := Distance[i-1,j-1] - Distance[i-1,i-1] - Distance[j-1,j-1]; + if (d1 < x1) then + begin + x1 := d1; + L := i; + M := j; + end; // end if + end; // end if + end; // next j + end; // end if + end; // next i + n4 := w2[L-1]; + n5 := w2[M-1]; + + OutPutFrm.RichEdit.Lines.Add(''); + linecount := linecount + 1; + GrpCnt := GrpCnt + 1; + XAxis[GrpCnt-1] := n3; + YAxis[GrpCnt-1] := x1; + if (x1 > MaxError) then MaxError := x1; + outline := format('%d groups after combining group %d (n := %d ) and group %d (n := %d) error := %7.3f', + [n3, L, n4, M, n5, x1]); + OutPutFrm.RichEdit.Lines.Add(outline); + linecount := linecount + 1; + if (linecount >= 60) then + begin + OutPutFrm.ShowModal; + OutPutFrm.RichEdit.Clear; + linecount := 0; + end; + w3 := w2[L-1] + w2[M-1]; + x1 := Distance[L-1,M-1] * w3; + Y := Distance[L-1,L-1] * w2[L-1] + Distance[M-1,M-1] * w2[M-1]; + Distance[L-1,L-1] := Distance[L-1,M-1]; + for i := 1 to Nrows do + if (k5[i-1] = M) then k5[i-1] := L; + for i := 1 to Nrows do + begin + if ((i <> L) and (k5[i-1] = i)) then + begin + if (i <= L) then + begin + Distance[i-1,L-1] := Distance[i-1,L-1] * (w2[i-1] + w2[L-1]) + + Distance[i-1,M-1] * (w2[i-1] + w2[M-1]) + + x1 - Y - Distance[i-1,i-1] * w2[i-1]; + Distance[i-1,L-1] := Distance[i-1,L-1] / (w2[i-1] + w3); + end + else + begin + Distance[L-1,i-1] := Distance[L-1,i-1] * (w2[L-1] + w2[i-1]) + + (Distance[M-1,i-1] + Distance[i-1,M-1]) * (w2[M-1] + w2[i-1]); + Distance[L-1,i-1] := (Distance[L-1,i-1]+ x1 - Y + - Distance[i-1,i-1] * w2[i-1]) / (w2[i-1] + w3); + end; + end; + end; + w2[L-1] := w3; + if (n3 > k1) then goto next1; + + // print group memberships of all objects, if optioned + for i := 1 to Nrows do + begin + if (k5[i-1] = i) then + begin + L := 0; + for j := 1 to Nrows do + begin + if (k5[j-1] = i) then + begin + L := L + 1; + L1[L-1] := k4[j-1]; + if k3 = 1 then L1[L-1] := j; + end; + end; + if k3 = 1 then + begin + outline := format('Group %d (n := %d)',[i,L]); + OutPutFrm.RichEdit.Lines.Add(outline); + outline := ''; + for j := 1 to L do + begin + outline := format(' Object := %s',[rowlabels[L1[j-1]-1]]); + OutPutFrm.RichEdit.Lines.Add(outline); + linecount := linecount + 1; + end; + if (linecount >= 60) then + begin + OutPutFrm.ShowModal; + OutPutFrm.RichEdit.Clear; + linecount := 0; + end; + end; // end if + end; // end if + end; // next i + goto next1; + end; // end if + if (linecount > 0) then OutPutFrm.ShowModal; + + if (PlotChk.Checked) then + begin + SetLength(GraphFrm.Ypoints,1,GrpCnt); + SetLength(GraphFrm.Xpoints,1,GrpCnt); + for i := 1 to GrpCnt do + begin + GraphFrm.Ypoints[0,i-1] := YAxis[i-1]; + GraphFrm.Xpoints[0,i-1] := XAxis[i-1]; + end; + GraphFrm.nosets := 1; + GraphFrm.nbars := GrpCnt; + GraphFrm.Heading := 'NO. GROUPS VERSUS GROUPING ERROR'; + GraphFrm.XTitle := 'NO. GROUPS'; + GraphFrm.YTitle := 'ERROR'; +// GraphFrm.Ypoints[1] := YAxis; +// GraphFrm.Xpoints[1] := XAxis; + GraphFrm.AutoScale := true; + GraphFrm.PtLabels := false; + GraphFrm.GraphType := 7; // 2d points + GraphFrm.BackColor := clYellow; + GraphFrm.ShowBackWall := true; + GraphFrm.ShowModal; +end; + + // clean up + ColSelected := nil; + rowlabels := nil; + varlabels := nil; + Distance := nil; + stddevs := nil; + variances := nil; + means := nil; + YAxis := nil; + XAxis := nil; + W := nil; + L1 := nil; + k5 := nil; + k4 := nil; + w2 := nil; + GraphFrm.Xpoints := nil; + GraphFrm.Ypoints := nil; +end; + +procedure THierarchFrm.PredInClick(Sender: TObject); +VAR i, index : integer; +begin + index := VarList.Items.Count; + i := 0; + while i < index do + begin + if (VarList.Selected[i]) then + begin + PredList.Items.Add(VarList.Items.Strings[i]); + VarList.Items.Delete(i); + index := index - 1; + i := 0; + end + else i := i + 1; + end; + PredOut.Visible := true; +end; + +procedure THierarchFrm.PredOutClick(Sender: TObject); +VAR index : integer; +begin + index := PredList.ItemIndex; + if index < 0 then + begin + PredOut.Visible := false; + exit; + end; + VarList.Items.Add(PredList.Items.Strings[index]); + PredList.Items.Delete(index); +end; + +initialization + {$I hierarchunit.lrs} + +end. + diff --git a/applications/lazstats/source_orig/hypergeounit.lfm b/applications/lazstats/source_orig/hypergeounit.lfm new file mode 100644 index 000000000..dfb53cac3 --- /dev/null +++ b/applications/lazstats/source_orig/hypergeounit.lfm @@ -0,0 +1,182 @@ +object HyperGeoForm: THyperGeoForm + Left = 288 + Height = 403 + Top = 161 + Width = 320 + Caption = 'Hypergeometric Probabilities' + ClientHeight = 403 + ClientWidth = 320 + OnShow = ResetBtnClick + LCLVersion = '0.9.30' + object Label1: TLabel + Left = 7 + Height = 16 + Top = 20 + Width = 69 + Caption = 'Sample Size: ' + ParentColor = False + end + object Label2: TLabel + Left = 10 + Height = 16 + Top = 55 + Width = 153 + Caption = 'Number observed in sample:' + ParentColor = False + end + object Label3: TLabel + Left = 9 + Height = 16 + Top = 88 + Width = 85 + Caption = 'Population Size:' + ParentColor = False + end + object Label4: TLabel + Left = 7 + Height = 16 + Top = 123 + Width = 173 + Caption = 'Number observed in population:' + ParentColor = False + end + object Label5: TLabel + Left = 7 + Height = 16 + Top = 163 + Width = 85 + Caption = 'Probability of X:' + ParentColor = False + end + object Label6: TLabel + Left = 8 + Height = 16 + Top = 201 + Width = 138 + Caption = 'Probability greater than X:' + ParentColor = False + end + object Label7: TLabel + Left = 8 + Height = 16 + Top = 238 + Width = 153 + Caption = 'Probability less or equal to X:' + ParentColor = False + end + object Label8: TLabel + Left = 9 + Height = 16 + Top = 275 + Width = 171 + Caption = 'Probability greater or equal to X:' + ParentColor = False + end + object Label9: TLabel + Left = 7 + Height = 16 + Top = 313 + Width = 120 + Caption = 'Probability less than X:' + ParentColor = False + end + object ResetBtn: TButton + Left = 7 + Height = 31 + Top = 346 + Width = 76 + Caption = 'Reset' + OnClick = ResetBtnClick + TabOrder = 0 + end + object ComputeBtn: TButton + Left = 112 + Height = 31 + Top = 344 + Width = 76 + Caption = 'Compute' + OnClick = ComputeBtnClick + TabOrder = 1 + end + object ReturnBtn: TButton + Left = 216 + Height = 31 + Top = 344 + Width = 76 + Caption = 'Return' + ModalResult = 1 + TabOrder = 2 + end + object SampSizeEdit: TEdit + Left = 208 + Height = 23 + Top = 12 + Width = 76 + TabOrder = 3 + Text = 'SampSizeEdit' + end + object SampObsEdit: TEdit + Left = 208 + Height = 23 + Top = 48 + Width = 76 + TabOrder = 4 + Text = 'Edit1' + end + object PopSizeEdit: TEdit + Left = 208 + Height = 23 + Top = 80 + Width = 76 + TabOrder = 5 + Text = 'Edit1' + end + object PopObsEdit: TEdit + Left = 208 + Height = 23 + Top = 112 + Width = 76 + TabOrder = 6 + Text = 'Edit1' + end + object ProbXEdit: TEdit + Left = 208 + Height = 23 + Top = 152 + Width = 76 + TabOrder = 7 + Text = 'Edit1' + end + object ProbGTEdit: TEdit + Left = 208 + Height = 23 + Top = 192 + Width = 76 + TabOrder = 8 + Text = 'Edit1' + end + object ProbLEEdit: TEdit + Left = 208 + Height = 23 + Top = 231 + Width = 76 + TabOrder = 9 + Text = 'Edit1' + end + object ProbGEEdit: TEdit + Left = 208 + Height = 23 + Top = 268 + Width = 76 + TabOrder = 10 + Text = 'Edit1' + end + object ProbLTEdit: TEdit + Left = 208 + Height = 23 + Top = 306 + Width = 76 + TabOrder = 11 + Text = 'Edit1' + end +end diff --git a/applications/lazstats/source_orig/hypergeounit.lrs b/applications/lazstats/source_orig/hypergeounit.lrs new file mode 100644 index 000000000..2c1907c68 --- /dev/null +++ b/applications/lazstats/source_orig/hypergeounit.lrs @@ -0,0 +1,45 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('THyperGeoForm','FORMDATA',[ + 'TPF0'#13'THyperGeoForm'#12'HyperGeoForm'#4'Left'#3' '#1#6'Height'#3#147#1#3 + +'Top'#3#161#0#5'Width'#3'@'#1#7'Caption'#6#28'Hypergeometric Probabilities' + +#12'ClientHeight'#3#147#1#11'ClientWidth'#3'@'#1#6'OnShow'#7#13'ResetBtnClic' + +'k'#10'LCLVersion'#6#6'0.9.30'#0#6'TLabel'#6'Label1'#4'Left'#2#7#6'Height'#2 + +#16#3'Top'#2#20#5'Width'#2'E'#7'Caption'#6#13'Sample Size: '#11'ParentColor' + +#8#0#0#6'TLabel'#6'Label2'#4'Left'#2#10#6'Height'#2#16#3'Top'#2'7'#5'Width'#3 + +#153#0#7'Caption'#6#26'Number observed in sample:'#11'ParentColor'#8#0#0#6'T' + +'Label'#6'Label3'#4'Left'#2#9#6'Height'#2#16#3'Top'#2'X'#5'Width'#2'U'#7'Cap' + +'tion'#6#16'Population Size:'#11'ParentColor'#8#0#0#6'TLabel'#6'Label4'#4'Le' + +'ft'#2#7#6'Height'#2#16#3'Top'#2'{'#5'Width'#3#173#0#7'Caption'#6#30'Number ' + +'observed in population:'#11'ParentColor'#8#0#0#6'TLabel'#6'Label5'#4'Left'#2 + +#7#6'Height'#2#16#3'Top'#3#163#0#5'Width'#2'U'#7'Caption'#6#17'Probability o' + +'f X:'#11'ParentColor'#8#0#0#6'TLabel'#6'Label6'#4'Left'#2#8#6'Height'#2#16#3 + +'Top'#3#201#0#5'Width'#3#138#0#7'Caption'#6#27'Probability greater than X:' + +#11'ParentColor'#8#0#0#6'TLabel'#6'Label7'#4'Left'#2#8#6'Height'#2#16#3'Top' + +#3#238#0#5'Width'#3#153#0#7'Caption'#6#31'Probability less or equal to X:'#11 + +'ParentColor'#8#0#0#6'TLabel'#6'Label8'#4'Left'#2#9#6'Height'#2#16#3'Top'#3 + +#19#1#5'Width'#3#171#0#7'Caption'#6'"Probability greater or equal to X:'#11 + +'ParentColor'#8#0#0#6'TLabel'#6'Label9'#4'Left'#2#7#6'Height'#2#16#3'Top'#3 + +'9'#1#5'Width'#2'x'#7'Caption'#6#24'Probability less than X:'#11'ParentColor' + +#8#0#0#7'TButton'#8'ResetBtn'#4'Left'#2#7#6'Height'#2#31#3'Top'#3'Z'#1#5'Wid' + +'th'#2'L'#7'Caption'#6#5'Reset'#7'OnClick'#7#13'ResetBtnClick'#8'TabOrder'#2 + +#0#0#0#7'TButton'#10'ComputeBtn'#4'Left'#2'p'#6'Height'#2#31#3'Top'#3'X'#1#5 + +'Width'#2'L'#7'Caption'#6#7'Compute'#7'OnClick'#7#15'ComputeBtnClick'#8'TabO' + +'rder'#2#1#0#0#7'TButton'#9'ReturnBtn'#4'Left'#3#216#0#6'Height'#2#31#3'Top' + +#3'X'#1#5'Width'#2'L'#7'Caption'#6#6'Return'#11'ModalResult'#2#1#8'TabOrder' + +#2#2#0#0#5'TEdit'#12'SampSizeEdit'#4'Left'#3#208#0#6'Height'#2#23#3'Top'#2#12 + +#5'Width'#2'L'#8'TabOrder'#2#3#4'Text'#6#12'SampSizeEdit'#0#0#5'TEdit'#11'Sa' + +'mpObsEdit'#4'Left'#3#208#0#6'Height'#2#23#3'Top'#2'0'#5'Width'#2'L'#8'TabOr' + +'der'#2#4#4'Text'#6#5'Edit1'#0#0#5'TEdit'#11'PopSizeEdit'#4'Left'#3#208#0#6 + +'Height'#2#23#3'Top'#2'P'#5'Width'#2'L'#8'TabOrder'#2#5#4'Text'#6#5'Edit1'#0 + +#0#5'TEdit'#10'PopObsEdit'#4'Left'#3#208#0#6'Height'#2#23#3'Top'#2'p'#5'Widt' + +'h'#2'L'#8'TabOrder'#2#6#4'Text'#6#5'Edit1'#0#0#5'TEdit'#9'ProbXEdit'#4'Left' + +#3#208#0#6'Height'#2#23#3'Top'#3#152#0#5'Width'#2'L'#8'TabOrder'#2#7#4'Text' + +#6#5'Edit1'#0#0#5'TEdit'#10'ProbGTEdit'#4'Left'#3#208#0#6'Height'#2#23#3'Top' + +#3#192#0#5'Width'#2'L'#8'TabOrder'#2#8#4'Text'#6#5'Edit1'#0#0#5'TEdit'#10'Pr' + +'obLEEdit'#4'Left'#3#208#0#6'Height'#2#23#3'Top'#3#231#0#5'Width'#2'L'#8'Tab' + +'Order'#2#9#4'Text'#6#5'Edit1'#0#0#5'TEdit'#10'ProbGEEdit'#4'Left'#3#208#0#6 + +'Height'#2#23#3'Top'#3#12#1#5'Width'#2'L'#8'TabOrder'#2#10#4'Text'#6#5'Edit1' + +#0#0#5'TEdit'#10'ProbLTEdit'#4'Left'#3#208#0#6'Height'#2#23#3'Top'#3'2'#1#5 + +'Width'#2'L'#8'TabOrder'#2#11#4'Text'#6#5'Edit1'#0#0#0 +]); diff --git a/applications/lazstats/source_orig/hypergeounit.pas b/applications/lazstats/source_orig/hypergeounit.pas new file mode 100644 index 000000000..c2a70e458 --- /dev/null +++ b/applications/lazstats/source_orig/hypergeounit.pas @@ -0,0 +1,181 @@ +unit HyperGeoUnit; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, + StdCtrls, functionsLib, OutPutUnit; + +type + + { THyperGeoForm } + + THyperGeoForm = class(TForm) + ResetBtn: TButton; + ComputeBtn: TButton; + ReturnBtn: TButton; + SampSizeEdit: TEdit; + SampObsEdit: TEdit; + PopSizeEdit: TEdit; + PopObsEdit: TEdit; + ProbXEdit: TEdit; + ProbGTEdit: TEdit; + ProbLEEdit: TEdit; + ProbGEEdit: TEdit; + ProbLTEdit: TEdit; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + Label4: TLabel; + Label5: TLabel; + Label6: TLabel; + Label7: TLabel; + Label8: TLabel; + Label9: TLabel; + procedure ComputeBtnClick(Sender: TObject); + procedure ResetBtnClick(Sender: TObject); + procedure FisherTable(A,B,C,D, p, SumP : double); + private + { private declarations } + + public + { public declarations } + end; + +var + HyperGeoForm: THyperGeoForm; + +implementation + +{ THyperGeoForm } + +procedure THyperGeoForm.ResetBtnClick(Sender: TObject); +begin + SampSizeEdit.Text := ''; + SampObsEdit.Text := ''; + PopSizeEdit.Text := ''; + PopObsEdit.Text := ''; + ProbXEdit.Text := ''; + ProbGEEdit.Text := ''; + ProbLTEdit.Text := ''; + ProbLEEdit.Text := ''; + ProbGTEdit.Text := ''; + label5.Visible := false; + label6.Visible := false; + label7.Visible := false; + label8.Visible := false; + label9.Visible := false; + ProbXEdit.Visible := false; + ProbGEEdit.Visible := false; + ProbLTEdit.Visible := false; + ProbLEEdit.Visible := false; + ProbGTEdit.Visible := false; +end; + +procedure THyperGeoForm.ComputeBtnClick(Sender: TObject); +VAR + SampObs, PopObs, SampSize, PopSize, N : double; + A, B, C, D, APlusC, BPlusD, APlusB, CPlusD : double; + largest : integer; + ProbX, Prob, SumProb, ProbGE, ProbGT, ProbLT, ProbLE : double; + done : boolean; + outvalue : string; +begin + done := false; + SumProb := 0.0; + label5.Visible := true; + label6.Visible := true; + label7.Visible := true; + label8.Visible := true; + label9.Visible := true; + ProbXEdit.Visible := true; + ProbGEEdit.Visible := true; + ProbLTEdit.Visible := true; + ProbLEEdit.Visible := true; + ProbGTEdit.Visible := true; + SampObs := StrToFloat(SampObsEdit.Text); + PopObs := StrToFloat(PopObsEdit.Text); + SampSize := StrToFloat(SampSizeEdit.Text); + PopSize := StrToFloat(PopSizeEdit.Text); + A := SampObs; + B := SampSize - A; + C := PopObs; + D := PopSize - C; + APlusC := A + C; + BPlusD := B + D; + APlusB := A + B; + CPlusD := C + D; + N := A + B + C + D; + +// largest := 1; + OutPutFrm.RichEdit.Clear; + OutPutFrm.RichEdit.Lines.Add('Hypergeometric Distribution Calculations'); + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add('Accumulating Values of the distribution'); + OutPutFrm.RichEdit.Lines.Add(''); + ProbX := combos(A,C) * combos(B,D) / combos(APlusB,CPlusD); + outvalue := format('%6.4f',[ProbX]); + ProbXEdit.Text := outvalue; + SumProb := SumProb + ProbX; + FisherTable(A,B,C,D,ProbX,SumProb); + + // get more extreme probabilities + while not done do + begin + if A = APlusB then done := true + else begin + A := A + 1; + B := B - 1; + if (A < 0) or (B < 0) or (C < 0) or (D < 0) then done := true; + end; + if not done then + begin + Prob := combos(A,C) * combos(B,D) / combos(APlusB,CPlusD); + SumProb := SumProb + Prob; + FisherTable(A,B,C,D,Prob,SumProb); + end; + end; // end while not done + OutPutFrm.ShowModal; + ProbGE := SumProb; + ProbGT := SumProb - ProbX; + ProbLT := 1.0 - ProbGE; + ProbLE := ProbLT + ProbX; + outvalue := format('%6.4f',[ProbGE]); + ProbGEEdit.Text := outvalue; + outvalue := format('%6.4f',[ProbLE]); + ProbLEEdit.Text := outvalue; + outvalue := format('%6.4f',[ProbGT]); + ProbGTEdit.Text := outvalue; + outvalue := format('%6.4f',[ProbLT]); + ProbLTEdit.Text := outvalue; + OutPutFrm.RichEdit.Clear; + +end; + +procedure THyperGeoForm.FisherTable(A,B,C,D, p, SumP : double); +VAR + outline : string; +begin + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add('Table for Hypergeometric Probabilities'); + OutPutFrm.RichEdit.Lines.Add(' Column'); + OutPutFrm.RichEdit.Lines.Add('Row 1 2'); + outline := format(' 1 %10.0f %10.0f',[A,B]); + OutPutFrm.RichEdit.Lines.Add(outline); + outline := format(' 2 %10.0f %10.0f',[C,D]); + OutPutFrm.RichEdit.Lines.Add(outline); + outline := format('Probability = %6.4f',[p]); + OutPutFrm.RichEdit.Lines.Add(outline); + OutPutFrm.RichEdit.Lines.Add(''); + outline := format('Cumulative Probability = %6.4f',[SumP]); + OutPutFrm.RichEdit.Lines.Add(outline); + OutPutFrm.RichEdit.Lines.Add(''); +end; + +initialization + {$I hypergeounit.lrs} + +end. + diff --git a/applications/lazstats/source_orig/interruptedunit.lfm b/applications/lazstats/source_orig/interruptedunit.lfm new file mode 100644 index 000000000..45709e35c --- /dev/null +++ b/applications/lazstats/source_orig/interruptedunit.lfm @@ -0,0 +1,291 @@ +object InterruptedFrm: TInterruptedFrm + Left = 66 + Height = 337 + Top = 66 + Width = 537 + Align = alCustom + AutoSize = True + BorderIcons = [biSystemMenu] + BorderStyle = bsDialog + Caption = 'Interrupted Time Series Analysis' + ClientHeight = 337 + ClientWidth = 537 + OnShow = FormShow + Position = poDefault + LCLVersion = '0.9.28.2' + object Label1: TLabel + Left = 2 + Height = 14 + Top = 0 + Width = 90 + Caption = 'Available Variables' + ParentColor = False + end + object Label2: TLabel + Left = 250 + Height = 14 + Top = 2 + Width = 138 + Caption = 'Pre-Treatment Observations' + ParentColor = False + end + object Label3: TLabel + Left = 250 + Height = 14 + Top = 153 + Width = 143 + Caption = 'Post-Treatment Observations' + ParentColor = False + end + object VarList: TListBox + Left = 0 + Height = 271 + Top = 23 + Width = 188 + ItemHeight = 0 + MultiSelect = True + TabOrder = 0 + end + object PreInBtn: TBitBtn + Left = 194 + Height = 29 + Top = 23 + Width = 35 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00216324B81D5E2006FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF002A702F38256929F7216324D9FFFFFF00FFFFFF00FFFFFF00FFFFFF0061BE + 6DFF5DB868FF58B162FF53A95CFF4DA156FF47994FFF419149FF3B8842FF3580 + 3BFF3F8845FF59A15EFF448B49FF216324CFFFFFFF00FFFFFF00FFFFFF0065C3 + 71FFA0D7A9FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF458C4AFF216324C4FFFFFF00FFFFFF0068C7 + 74FFA5DAAEFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF4A9150FF256929C9FFFFFF00FFFFFF0068C7 + 74FF68C774FF65C371FF61BE6DFF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF5AA362FF559D5CFF2F7835D1FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00419149F73B8842DBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0047994FBB41914906FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + NumGlyphs = 0 + OnClick = PreInBtnClick + TabOrder = 1 + end + object PreOutBtn: TBitBtn + Left = 194 + Height = 29 + Top = 64 + Width = 35 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF004DA1560647994FB8FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0053A95CD94DA156F747994F38FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF005DB868CF71BE7BFF7AC183FF5BAA64FF47994FFF419149FF3B8842FF3580 + 3BFF2F7835FF2A702FFF256929FF216324FF1D5E20FFFFFFFF00FFFFFF0065C3 + 71C47BC886FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF72BD78FF216324FFFFFFFF00FFFFFF0068C7 + 74C97FCC8AFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF78C07EFF256929FFFFFFFF00FFFFFF00FFFF + FF0068C774D180CD8BFF7CC987FF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF3B8842FF35803BFF2F7835FF2A702FFFFFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C774DB65C371F7FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C7740668C774BBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + NumGlyphs = 0 + OnClick = PreOutBtnClick + TabOrder = 2 + end + object PostInBtn: TBitBtn + Left = 194 + Height = 29 + Top = 169 + Width = 35 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00216324B81D5E2006FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF002A702F38256929F7216324D9FFFFFF00FFFFFF00FFFFFF00FFFFFF0061BE + 6DFF5DB868FF58B162FF53A95CFF4DA156FF47994FFF419149FF3B8842FF3580 + 3BFF3F8845FF59A15EFF448B49FF216324CFFFFFFF00FFFFFF00FFFFFF0065C3 + 71FFA0D7A9FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF458C4AFF216324C4FFFFFF00FFFFFF0068C7 + 74FFA5DAAEFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF4A9150FF256929C9FFFFFF00FFFFFF0068C7 + 74FF68C774FF65C371FF61BE6DFF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF5AA362FF559D5CFF2F7835D1FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00419149F73B8842DBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0047994FBB41914906FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + NumGlyphs = 0 + OnClick = PostInBtnClick + TabOrder = 3 + end + object PostOutBtn: TBitBtn + Left = 194 + Height = 29 + Top = 208 + Width = 35 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF004DA1560647994FB8FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0053A95CD94DA156F747994F38FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF005DB868CF71BE7BFF7AC183FF5BAA64FF47994FFF419149FF3B8842FF3580 + 3BFF2F7835FF2A702FFF256929FF216324FF1D5E20FFFFFFFF00FFFFFF0065C3 + 71C47BC886FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF72BD78FF216324FFFFFFFF00FFFFFF0068C7 + 74C97FCC8AFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF78C07EFF256929FFFFFFFF00FFFFFF00FFFF + FF0068C774D180CD8BFF7CC987FF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF3B8842FF35803BFF2F7835FF2A702FFFFFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C774DB65C371F7FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C7740668C774BBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + NumGlyphs = 0 + OnClick = PostOutBtnClick + TabOrder = 4 + end + object PreList: TListBox + Left = 239 + Height = 118 + Top = 23 + Width = 155 + ItemHeight = 0 + MultiSelect = True + TabOrder = 5 + end + object PostList: TListBox + Left = 239 + Height = 127 + Top = 169 + Width = 158 + ItemHeight = 0 + MultiSelect = True + TabOrder = 6 + end + object ResetBtn: TButton + Left = 418 + Height = 27 + Top = 40 + Width = 72 + Caption = 'Reset' + OnClick = ResetBtnClick + TabOrder = 7 + end + object CancelBtn: TButton + Left = 418 + Height = 27 + Top = 104 + Width = 72 + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 8 + end + object ComputeBtn: TButton + Left = 418 + Height = 27 + Top = 169 + Width = 72 + Caption = 'Compute' + OnClick = ComputeBtnClick + TabOrder = 9 + end + object ReturnBtn: TButton + Left = 418 + Height = 27 + Top = 232 + Width = 72 + Caption = 'Return' + ModalResult = 1 + TabOrder = 10 + end + object CorrChk: TCheckBox + Left = 1 + Height = 17 + Top = 305 + Width = 110 + Caption = 'ShowCorrelograms' + TabOrder = 11 + end +end diff --git a/applications/lazstats/source_orig/interruptedunit.lrs b/applications/lazstats/source_orig/interruptedunit.lrs new file mode 100644 index 000000000..23cf61db9 --- /dev/null +++ b/applications/lazstats/source_orig/interruptedunit.lrs @@ -0,0 +1,237 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('TInterruptedFrm','FORMDATA',[ + 'TPF0'#15'TInterruptedFrm'#14'InterruptedFrm'#4'Left'#2'B'#6'Height'#3'Q'#1#3 + +'Top'#2'B'#5'Width'#3#25#2#5'Align'#7#8'alCustom'#8'AutoSize'#9#11'BorderIco' + +'ns'#11#12'biSystemMenu'#0#11'BorderStyle'#7#8'bsDialog'#7'Caption'#6' Inter' + +'rupted Time Series Analysis'#12'ClientHeight'#3'Q'#1#11'ClientWidth'#3#25#2 + +#6'OnShow'#7#8'FormShow'#8'Position'#7#9'poDefault'#10'LCLVersion'#6#8'0.9.2' + +'8.2'#0#6'TLabel'#6'Label1'#4'Left'#2#2#6'Height'#2#14#3'Top'#2#0#5'Width'#2 + +'Z'#7'Caption'#6#19'Available Variables'#11'ParentColor'#8#0#0#6'TLabel'#6'L' + +'abel2'#4'Left'#3#250#0#6'Height'#2#14#3'Top'#2#2#5'Width'#3#138#0#7'Caption' + +#6#26'Pre-Treatment Observations'#11'ParentColor'#8#0#0#6'TLabel'#6'Label3'#4 + +'Left'#3#250#0#6'Height'#2#14#3'Top'#3#153#0#5'Width'#3#143#0#7'Caption'#6#27 + +'Post-Treatment Observations'#11'ParentColor'#8#0#0#8'TListBox'#7'VarList'#4 + +'Left'#2#0#6'Height'#3#15#1#3'Top'#2#23#5'Width'#3#188#0#10'ItemHeight'#2#0 + +#11'MultiSelect'#9#8'TabOrder'#2#0#0#0#7'TBitBtn'#8'PreInBtn'#4'Left'#3#194#0 + +#6'Height'#2#29#3'Top'#2#23#5'Width'#2'#'#10'Glyph.Data'#10':'#4#0#0'6'#4#0#0 + +'BM6'#4#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#16#0#0#0#16#0#0#0#1#0' '#0#0#0#0#0#0#4 + +#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0'!c$'#184#29'^ '#6#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0'*p/8%i)'#247'!c$'#217#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0'a'#190'm'#255']'#184'h'#255'X'#177'b'#255'S'#169'\' + +#255'M'#161'V'#255'G'#153'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';'#255'?' + +#136'E'#255'Y'#161'^'#255'D'#139'I'#255'!c$'#207#255#255#255#0#255#255#255#0 + +#255#255#255#0'e'#195'q'#255#160#215#169#255#156#213#165#255#152#211#161#255 + +#148#208#157#255#144#206#152#255#139#203#147#255#135#201#142#255#130#198#137 + +#255'~'#195#132#255'z'#193#128#255'v'#190'|'#255'E'#140'J'#255'!c$'#196#255 + +#255#255#0#255#255#255#0'h'#199't'#255#165#218#174#255#162#216#171#255#158 + +#214#167#255#154#212#163#255#150#210#159#255#147#207#154#255#142#204#149#255 + +#137#202#144#255#133#199#139#255#129#197#135#255'}'#194#130#255'J'#145'P'#255 + +'%i)'#201#255#255#255#0#255#255#255#0'h'#199't'#255'h'#199't'#255'e'#195'q' + +#255'a'#190'm'#255']'#184'h'#255'X'#177'b'#255'S'#169'\'#255'M'#161'V'#255'G' + +#153'O'#255'A'#145'I'#255'Z'#163'b'#255'U'#157'\'#255'/x5'#209#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0'A'#145'I'#247';'#136'B'#219#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0'G'#153'O'#187'A'#145'I'#6#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#9'NumGlyphs'#2#0#7'OnClick'#7#13'PreInBtnClick'#8'TabOrder'#2 + ,#1#0#0#7'TBitBtn'#9'PreOutBtn'#4'Left'#3#194#0#6'Height'#2#29#3'Top'#2'@'#5 + +'Width'#2'#'#10'Glyph.Data'#10':'#4#0#0'6'#4#0#0'BM6'#4#0#0#0#0#0#0'6'#0#0#0 + +'('#0#0#0#16#0#0#0#16#0#0#0#1#0' '#0#0#0#0#0#0#4#0#0'd'#0#0#0'd'#0#0#0#0#0#0 + +#0#0#0#0#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'M'#161'V'#6'G'#153'O' + +#184#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'S'#169'\'#217'M'#161'V' + +#247'G'#153'O8'#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0']'#184'h'#207'q'#190'{'#255'z'#193#131#255 + +'['#170'd'#255'G'#153'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';'#255'/x5' + +#255'*p/'#255'%i)'#255'!c$'#255#29'^ '#255#255#255#255#0#255#255#255#0'e'#195 + +'q'#196'{'#200#134#255#156#213#165#255#152#211#161#255#148#208#157#255#144 + +#206#152#255#139#203#147#255#135#201#142#255#130#198#137#255'~'#195#132#255 + +'z'#193#128#255'v'#190'|'#255'r'#189'x'#255'!c$'#255#255#255#255#0#255#255 + +#255#0'h'#199't'#201#127#204#138#255#162#216#171#255#158#214#167#255#154#212 + +#163#255#150#210#159#255#147#207#154#255#142#204#149#255#137#202#144#255#133 + +#199#139#255#129#197#135#255'}'#194#130#255'x'#192'~'#255'%i)'#255#255#255 + +#255#0#255#255#255#0#255#255#255#0'h'#199't'#209#128#205#139#255'|'#201#135 + +#255']'#184'h'#255'X'#177'b'#255'S'#169'\'#255'M'#161'V'#255'G'#153'O'#255'A' + +#145'I'#255';'#136'B'#255'5'#128';'#255'/x5'#255'*p/'#255#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0'h'#199't'#219'e'#195'q'#247#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0'h'#199't'#6'h'#199't'#187#255#255#255 + +#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#9'NumGlyp' + +'hs'#2#0#7'OnClick'#7#14'PreOutBtnClick'#8'TabOrder'#2#2#0#0#7'TBitBtn'#9'Po' + +'stInBtn'#4'Left'#3#194#0#6'Height'#2#29#3'Top'#3#169#0#5'Width'#2'#'#10'Gly' + +'ph.Data'#10':'#4#0#0'6'#4#0#0'BM6'#4#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#16#0#0#0 + +#16#0#0#0#1#0' '#0#0#0#0#0#0#4#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + ,#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'!c$' + +#184#29'^ '#6#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0'*p/8%i)'#247'!c$'#217#255#255#255 + +#0#255#255#255#0#255#255#255#0#255#255#255#0'a'#190'm'#255']'#184'h'#255'X' + +#177'b'#255'S'#169'\'#255'M'#161'V'#255'G'#153'O'#255'A'#145'I'#255';'#136'B' + +#255'5'#128';'#255'?'#136'E'#255'Y'#161'^'#255'D'#139'I'#255'!c$'#207#255#255 + +#255#0#255#255#255#0#255#255#255#0'e'#195'q'#255#160#215#169#255#156#213#165 + +#255#152#211#161#255#148#208#157#255#144#206#152#255#139#203#147#255#135#201 + +#142#255#130#198#137#255'~'#195#132#255'z'#193#128#255'v'#190'|'#255'E'#140 + +'J'#255'!c$'#196#255#255#255#0#255#255#255#0'h'#199't'#255#165#218#174#255 + +#162#216#171#255#158#214#167#255#154#212#163#255#150#210#159#255#147#207#154 + +#255#142#204#149#255#137#202#144#255#133#199#139#255#129#197#135#255'}'#194 + +#130#255'J'#145'P'#255'%i)'#201#255#255#255#0#255#255#255#0'h'#199't'#255'h' + +#199't'#255'e'#195'q'#255'a'#190'm'#255']'#184'h'#255'X'#177'b'#255'S'#169'\' + +#255'M'#161'V'#255'G'#153'O'#255'A'#145'I'#255'Z'#163'b'#255'U'#157'\'#255'/' + +'x5'#209#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255 + +#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0'A'#145'I'#247';'#136'B'#219#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0'G'#153'O'#187'A'#145'I'#6#255#255#255 + +#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#9'NumGlyphs'#2#0#7'OnClick'#7#14'PostInBtnClick' + +#8'TabOrder'#2#3#0#0#7'TBitBtn'#10'PostOutBtn'#4'Left'#3#194#0#6'Height'#2#29 + +#3'Top'#3#208#0#5'Width'#2'#'#10'Glyph.Data'#10':'#4#0#0'6'#4#0#0'BM6'#4#0#0 + +#0#0#0#0'6'#0#0#0'('#0#0#0#16#0#0#0#16#0#0#0#1#0' '#0#0#0#0#0#0#4#0#0'd'#0#0 + +#0'd'#0#0#0#0#0#0#0#0#0#0#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'M'#161'V' + +#6'G'#153'O'#184#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'S'#169'\'#217 + +'M'#161'V'#247'G'#153'O8'#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0']'#184'h'#207'q'#190'{'#255'z'#193 + +#131#255'['#170'd'#255'G'#153'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';' + +#255'/x5'#255'*p/'#255'%i)'#255'!c$'#255#29'^ '#255#255#255#255#0#255#255#255 + +#0'e'#195'q'#196'{'#200#134#255#156#213#165#255#152#211#161#255#148#208#157 + ,#255#144#206#152#255#139#203#147#255#135#201#142#255#130#198#137#255'~'#195 + +#132#255'z'#193#128#255'v'#190'|'#255'r'#189'x'#255'!c$'#255#255#255#255#0 + +#255#255#255#0'h'#199't'#201#127#204#138#255#162#216#171#255#158#214#167#255 + +#154#212#163#255#150#210#159#255#147#207#154#255#142#204#149#255#137#202#144 + +#255#133#199#139#255#129#197#135#255'}'#194#130#255'x'#192'~'#255'%i)'#255 + +#255#255#255#0#255#255#255#0#255#255#255#0'h'#199't'#209#128#205#139#255'|' + +#201#135#255']'#184'h'#255'X'#177'b'#255'S'#169'\'#255'M'#161'V'#255'G'#153 + +'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';'#255'/x5'#255'*p/'#255#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0'h'#199't'#219'e'#195'q'#247 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0'h'#199't'#6'h'#199't'#187 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#9'NumGlyphs'#2#0#7'OnClick'#7#15'PostOutBtnClick'#8'TabOrder'#2#4#0#0 + +#8'TListBox'#7'PreList'#4'Left'#3#239#0#6'Height'#2'v'#3'Top'#2#23#5'Width'#3 + +#155#0#10'ItemHeight'#2#0#11'MultiSelect'#9#8'TabOrder'#2#5#0#0#8'TListBox'#8 + +'PostList'#4'Left'#3#239#0#6'Height'#2#127#3'Top'#3#169#0#5'Width'#3#158#0#10 + +'ItemHeight'#2#0#11'MultiSelect'#9#8'TabOrder'#2#6#0#0#7'TButton'#8'ResetBtn' + +#4'Left'#3#162#1#6'Height'#2#27#3'Top'#2'('#5'Width'#2'H'#7'Caption'#6#5'Res' + +'et'#7'OnClick'#7#13'ResetBtnClick'#8'TabOrder'#2#7#0#0#7'TButton'#9'CancelB' + +'tn'#4'Left'#3#162#1#6'Height'#2#27#3'Top'#2'h'#5'Width'#2'H'#7'Caption'#6#6 + +'Cancel'#11'ModalResult'#2#2#8'TabOrder'#2#8#0#0#7'TButton'#10'ComputeBtn'#4 + +'Left'#3#162#1#6'Height'#2#27#3'Top'#3#169#0#5'Width'#2'H'#7'Caption'#6#7'Co' + +'mpute'#7'OnClick'#7#15'ComputeBtnClick'#8'TabOrder'#2#9#0#0#7'TButton'#9'Re' + +'turnBtn'#4'Left'#3#162#1#6'Height'#2#27#3'Top'#3#232#0#5'Width'#2'H'#7'Capt' + +'ion'#6#6'Return'#11'ModalResult'#2#1#8'TabOrder'#2#10#0#0#9'TCheckBox'#7'Co' + +'rrChk'#4'Left'#2#1#6'Height'#2#17#3'Top'#3'1'#1#5'Width'#2'n'#7'Caption'#6 + +#16'ShowCorrelograms'#8'TabOrder'#2#11#0#0#0 +]); diff --git a/applications/lazstats/source_orig/interruptedunit.pas b/applications/lazstats/source_orig/interruptedunit.pas new file mode 100644 index 000000000..45b3db7c3 --- /dev/null +++ b/applications/lazstats/source_orig/interruptedunit.pas @@ -0,0 +1,909 @@ +unit InterruptedUnit; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, + StdCtrls, Buttons, MainUnit, Globals, DataProcs, OutPutUnit, + AutoPlotUnit, GraphLib; + +type + + { TInterruptedFrm } + + TInterruptedFrm = class(TForm) + CorrChk: TCheckBox; + PreInBtn: TBitBtn; + PreOutBtn: TBitBtn; + PostInBtn: TBitBtn; + PostOutBtn: TBitBtn; + ResetBtn: TButton; + CancelBtn: TButton; + ComputeBtn: TButton; + ReturnBtn: TButton; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + VarList: TListBox; + PreList: TListBox; + PostList: TListBox; + procedure ComputeBtnClick(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure PostInBtnClick(Sender: TObject); + procedure PostOutBtnClick(Sender: TObject); + procedure PreInBtnClick(Sender: TObject); + procedure PreOutBtnClick(Sender: TObject); + procedure ResetBtnClick(Sender: TObject); + procedure matinverse(Sender: TObject); + procedure plotit( Sender: TObject); + procedure PlotFuncs(Sender: TObject); + + private + { private declarations } + z : DblDyneVec; + y : DblDyneVec; + x : DblDyneMat; + x1 : array[1..4,1..4] of double; + x2 : array[1..4,1..4] of double; + x3 : array[1..4] of double; + t : array[1..4] of double; + p : array[1..100] of double; + p1 : array[1..4] of double; + ii3 : array[1..4,1..3] of double; + p2 : array[1..4] of double; + s : array[1..4] of double; + t2 : array[1..4] of double; + b : array[1..4,1..1] of double; + x4 : array[1..50,1..10] of double; + d : array[1..50,1..5] of double; + r : array[1..50] of double; + x5 : array[1..50,1..11] of double; + a1 : array[1..10] of double; + a2 : array[1..10] of double; + r2 : array[1..10] of double; + e : array[1..10] of double; + f2 : array[1..5,1..10] of double; + pl : string; + f1s, g1s, g2s, g3s, g4s, g5s, g6s, g7s, g8s : string; + c9, g, c, g1, t3, t4, t5, t6, f4, n7, d7, y1, xx3, f1, f2x, s1 : double; + s3, s4, h, f3, y2, a, det, amax : double; + col, n, n1, n2, n4, n5, n6, m, l1, l2, i3, t1, NoGoodCases : integer; + n3, j1, m1, i1, R1 : integer; + + public + { public declarations } + end; + +var + InterruptedFrm: TInterruptedFrm; + +implementation + +{ TInterruptedFrm } + +procedure TInterruptedFrm.ResetBtnClick(Sender: TObject); +VAR i : integer; +begin + VarList.Clear; + PreList.Clear; + PostList.Clear; + for i := 1 to NoVariables do + VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]); + PreOutBtn.Visible := false; + PostOutBtn.Visible := false; + PreInBtn.Visible := true; + PostInBtn.Visible := true; +end; + +procedure TInterruptedFrm.FormShow(Sender: TObject); +begin + ResetBtnClick(Self); +end; + +procedure TInterruptedFrm.ComputeBtnClick(Sender: TObject); +label 300; +var + i, i2, j, j2, j3, k : integer; + ColNoSelected : IntDyneVec; + rxy : DblDyneVec; + heading : string; +begin + g1s := 't..change in level '; + g2s := 't..change in slope '; + g3s := 'scaled posterior '; + g4s := 'lower 99 percent '; + g5s := 'lower 95 percent '; + g6s := 'delta '; + g7s := 'upper 95 percent '; + g8s := 'upper 99 percent '; + c9 := 1.0E-15; + n1 := 0; + n2 := 0; + g := 0.01; + NoGoodCases := 0; + OutPutFrm.RichEdit.Clear; + OutPutFrm.RichEdit.Lines.Add('Interrupted Time Series Analysis'); + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add('Adapted from the Fortran program written by Glass and Maguire'); + OutPutFrm.RichEdit.Lines.Add('and based on Box and Tiao IMA(1,1) procedure. Published in'); + OutPutFrm.RichEdit.Lines.Add('How To Do Psychotherapy and How to Evaluate It by'); + OutPutFrm.RichEdit.Lines.Add('John M. Gottman and Sandra R. Leiblum, Holt, Rinehart and '); + OutPutFrm.RichEdit.Lines.Add('Winston, Inc., New York, 1974.'); + OutPutFrm.RichEdit.Lines.Add(''); + n1 := PreList.Items.Count; + n2 := PostList.Items.Count; + t1 := n1 + n2; + if t1 < 5 then + begin + ShowMessage('There must be more than 4 total values in the series.'); + exit; + end; + // allocate space + SetLength(z,t1); + SetLength(y,t1); + SetLength(x,t1,4); + SetLength(ColNoSelected,t1); + SetLength(rxy,t1); + + // Get column numbers of variables selected + for i := 1 to n1 do + begin + for j := 1 to NoVariables do + begin + if PreList.Items.Strings[i-1] = OS3MainFrm.DataGrid.Cells[j,0] then + ColNoSelected[i-1] := j; + end; + end; + for i := 1 to n2 do + begin + for j := 1 to NoVariables do + begin + if PostList.Items.Strings[i-1] = OS3MainFrm.DataGrid.Cells[j,0] then + ColNoSelected[n1+i-1] := j; + end; + end; + + // read pre and post values - average for the cases + for j := 0 to t1-1 do z[j] := 0.0; + for i := 1 to NoCases do + begin + if NOT GoodRecord(i,t1,ColNoSelected) then continue; + for j := 0 to t1-1 do + begin + col := ColNoSelected[j]; + z[j] := z[j] + StrToFloat(OS3MainFrm.DataGrid.Cells[col,i]); + NoGoodCases := NoGoodCases + 1; + end; + end; + for j := 0 to t1-1 do z[j] := z[j] / NoGoodCases; + + // plot correlograms + for j3 := 1 to 4 do + begin + case j3 of + 1 : begin + f1s := 'Pre-Treatment Data'; + n4 := n1; + l1 := 1; + l2 := n1; + OutPutFrm.RichEdit.Lines.Add('Correlogram of Pre-Treatment Raw Data'); + heading := 'Correlogram of Pre-Treatment Raw Data'; + i2 := 0; + for i := l1 to l2 do + begin + i2 := i2 + 1; + y[i2-1] := z[i-1]; + end; + end; + 2 : begin + f1s := 'Post-Treatment Data'; + n4 := n2; + l1 := n1 + 1; + l2 := t1; + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add('Correlogram of Post-Treatment Raw Data'); + heading := 'Correlogram of Post-Treatment Raw Data'; + i2 := 0; + for i := l1 to l2 do + begin + i2 := i2 + 1; + y[i2-1] := z[i-1]; + end; + end; + 3 : begin + f1s := 'Pre-Treatment Data'; + n4 := n1 - 1; + l1 := 1; + l2 := n1 - 1; + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add('Correlogram of Pre-Treatment Differences'); + heading := 'Correlogram of Pre-Treatment Differences'; + i2 := 0; + for i := l1 to l2 do + begin + i2 := i2 + 1; + i3 := i + 1; + y[i2-1] := z[i3-1] - z[i-1]; + end; + end; + 4 : begin + f1s := 'Post-Treatment Data'; + n4 := n2-1; + l1 := n1 + 1; + l2 := t1 - 1; + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add('Correlogram of Post-Treatment Differences'); + heading := 'Correlogram of Post-Treatment Differences'; + i2 := 0; + for i := l1 to l2 do + begin + i2 := i2 + 1; + i3 := i + 1; + y[i2-1] := z[i3-1] - z[i-1]; + end; + end; + end; + j2 := n4 * 3 div 4; + for k := 1 to j2 do + begin + n5 := n4 - k; + c := 0.0; + t3 := 0.0; + t4 := 0.0; + t5 := 0.0; + t6 := 0.0; + for i := 1 to n5 do + begin + n6 := i + k; + c := c + y[i-1] * y[n6-1]; + t3 := t3 + y[i-1]; + t4 := t4 + y[n6-1]; + t5 := t5 + y[i-1] * y[i-1]; + t6 := t6 + y[n6-1] * y[n6-1]; + end; + f4 := n5; + n7 := c - (t3 * t4) / f4; + d7 := (t5 - (t3 * t3) / f4) * (t6 - (t4 * t4) / f4); + if d7 > 0.0 then + begin + d7 := sqrt(d7); + r[k] := n7 / d7; + end + else r[k] := 1.0; + pl := format('lag %3d r %4.2f',[k,r[k]]); + OutPutFrm.RichEdit.Lines.Add(pl); + end; // next k + s4 := 1; + n := 1; + m := j2; + for i := 1 to j2 do x4[i,1] := r[i]; +// plotit(Self); + if CorrChk.Checked then + begin + rxy[0] := 0.0; + for i := 1 to j2 do rxy[i] := r[i]; + AutoPlotFrm.PlotPartCors := false; + AutoPlotFrm.PlotLimits := false; + AutoPlotFrm.correlations := rxy; + AutoPlotFrm.partcors := rxy; + AutoPlotFrm.uplimit := 0.99; + AutoPlotFrm.lowlimit := -0.99; + AutoPlotFrm.npoints := j2+1; + AutoPlotFrm.DepVarEdit := heading; + AutoPlotFrm.ShowModal; + end; + end; // next j3 + OutPutFrm.ShowModal; + OutPutFrm.RichEdit.Clear; + + // Now do the analysis + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add(' residual t for change in t for'); + OutPutFrm.RichEdit.Lines.Add(' gamma variance level level level change'); +300: + y[0] := z[0]; + for i := 1 to t1-1 do + begin + i1 := i - 1; + y1 := abs(y[i1]); + if (y1 - c9) <= 0.0 then y[i] := z[i] - z[i1] + else if (y1 - 0.000001) > 0 then y[i] := (z[i] - z[i1]) + (1.0 - g) * y[i1]; + g1 := abs(1.0 - g); + if (g1 - 0.001) > 0 then y[i] := (z[i] - z[i1]) + (1.0 - g) * y[i1] + else y[i] := z[i] - z[i1]; + end; + for i := 0 to t1 - 1 do x[i,0] := 1; + for i := 1 to n1 do x[i-1,1] := 0.0; + for i := n1 + 1 to t1 do x[i-1,1] := 1.0; + x[0,2] := 1.0; + x[1,2] := 1.0 - g; + for i := 2 to t1-1 do + begin + i1 := i - 1; + x[i,2] := x[1,2] * x[i1,2]; + xx3 := abs(x[i,2]); + if (c9 - xx3) <= 0.0 then continue; + x[i,2] := 0.0; + end; + for i := 1 to n1 do x[i-1,3] := 0.0; + for i := n1 to t1-1 do + begin + i1 := i-n1; + x[i,3] := x[i1,2]; + xx3 := abs(x[i,3]); + if (c9 - xx3) <= 0.0 then continue; + x[i,3] := 0.0; + end; + for i := 1 to 4 do + begin + for j := 1 to 4 do + begin + x2[i,j] := 0.0; + x1[i,j] := 0.0; + end; + end; + for i := 1 to 4 do + for j := 1 to 4 do + for k := 1 to t1 do + x2[i,j] := x2[i,j] + x[k-1,i-1] * x[k-1,j-1]; + for i := 1 to 4 do + for j := 1 to 4 do + x1[i,j] := x2[i,j]; + for i := 1 to 4 do x3[i] := 0.0; + for i := 1 to 4 do + for j := 1 to t1 do + x3[i] := x3[i] + x[j-1,i-1] * y[j-1]; + for i := 1 to 4 do b[i,1] := x3[i]; + matinverse(Self); + for i := 1 to 4 do t[i] := b[i,1]; + for i := 1 to 4 do s[i] := x1[i,i]; + f1 := t1; + y1 := 0.0; + for i := 0 to t1-1 do + begin + y1 := y1 + y[i] * y[i]; + end; + for i := 1 to 4 do x3[i] := 0.0; + for j := 1 to 4 do + for i := 1 to 4 do + begin + x3[j] := x3[j] + t[i] * x2[i,j]; + end; + f2x := 0.0; + for i := 1 to 4 do + begin + f2x := f2x + x3[i] * t[i]; + end; + s1 := y1 - f2x; + s1 := s1 / (f1 - 4.0); + for i := 1 to 4 do + begin + s[i] := sqrt(s1 * s[i]); + t2[i] := t[i] / s[i]; + end; + s3 := ln(s1); + det := ln(det); + h := (-0.5 * det) - (0.5 * (f1 - 4.0) * s3); + h := 0.4342945 * h; + j1 := j1 + 1; + x5[j1,1] := g; + x5[j1,2] := s1; + x5[j1,3] := t[3]; + x5[j1,4] := t2[3]; + x5[j1,5] := t[4]; + x5[j1,6] := t2[4]; + x5[j1,7] := t[1]; + x5[j1,8] := t2[1]; + x5[j1,9] := t[2]; + x5[j1,10] := t2[2]; + if (t1 - 30) >= 0 then + begin + d[j1,1] := t[4] - 2.58 * s[4]; + d[j1,2] := t[4] - 1.96 * s[4]; + d[j1,3] := t[4]; + d[j1,4] := t[4] + 1.96 * s[4]; + d[j1,5] := t[4] + 2.58 * s[4]; + end; + n3 := n3 + 1; + p[n3] := h; + g := g + 0.04; + if (n3 - 49) <= 0 then goto 300; + f3 := p[1]; + for i := 2 to 49 do if (f3 - p[i]) < 0 then f3 := p[i]; + for i := 1 to 49 do + begin + p[i] := p[i] - f3; + y2 := abs(p[i]); + if (y2 - 35) >= 0 then p[i] := 0.0 + else begin + p[i] := p[i] / 0.4342945; + p[i] := exp(p[i]); + end; + end; + a := 0.0; + for i := 2 to 49 do + begin + i2 := i - 1; + a := a + 0.005 * (p[i] + p[i1]); + end; + for i := 1 to 49 do p[i] := p[i] / a; + for i := 1 to 49 do x5[i,11] := p[i]; + for i := 1 to 49 do + begin + pl := format('%2d ',[i]); + for j := 1 to 6 do + pl := pl + format('%6.2f ',[x5[i,j]]); + OutPutFrm.RichEdit.Lines.Add(pl); + end; + + OutPutFrm.ShowModal; + OutPutFrm.RichEdit.Clear; + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add(''); + pl := ' t for change in t for scaled'; + OutPutFrm.RichEdit.Lines.Add(pl); + pl := ' slope slope slope change posterior'; + OutPutFrm.RichEdit.Lines.Add(pl); + for i := 1 to 49 do + begin + pl := format('%2d ',[i]); + for j := 7 to 11 do + pl := pl + format('%6.2f ',[x5[i,j]]); + OutPutFrm.RichEdit.Lines.Add(pl); + end; + + OutPutFrm.ShowModal; + OutPutFrm.RichEdit.Clear; + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add(''); + for i := 1 to 49 do + begin + x4[i,1] := x5[i,5]; + x4[i,2] := x5[i,9]; + x4[i,3] := x5[i,11]; + end; + m := 49; + n := 3; + i3 := 1; + f1s := g1s + g2s + g3s; + PlotFuncs(Self); + plotit(Self); // plot the f[i,j] values + OutPutFrm.ShowModal; + OutPutFrm.RichEdit.Clear; + n := 5; + if (t1 - 30) >= 0 then + begin // do confidence intervals around delta + for i := 1 to 49 do + for j := 1 to 5 do + x4[i,j] := d[i,j]; + f1s := g4s + g5s + g6s + g7s + g8s; + pl := 'Confidence Intervals Around Delta'; + OutPutFrm.RichEdit.Lines.Add(pl); + pl := 'gamma lower 99 lower 95 delta upper 95 upper 99'; + OutPutFrm.RichEdit.Lines.Add(pl); + for i := 1 to 49 do + begin + pl := format('%6.2f ',[x5[i,1]]); + for j := 1 to 5 do + pl := pl + format('%6.2f ',[d[i,j]]); + OutPutFrm.RichEdit.Lines.Add(pl); + end; + OutPutFrm.RichEdit.Lines.Add(''); + pl := 'Graph of Confidence Intervals Around Delta Hat'; + OutPutFrm.RichEdit.Lines.Add(pl); + plotit(Self); // plot f matrix + end; + + OutPutFrm.ShowModal; + + // clean up + rxy := nil; + ColNoSelected := nil; + x := nil; + y := nil; + z := nil; +end; + +procedure TInterruptedFrm.PostInBtnClick(Sender: TObject); +VAR i, index : integer; +begin + index := VarList.Items.Count; + i := 0; + while i < index do + begin + if (VarList.Selected[i]) then + begin + PostList.Items.Add(VarList.Items.Strings[i]); + VarList.Items.Delete(i); + index := index - 1; + i := 0; + end + else i := i + 1; + end; + PostOutBtn.Visible := true; + if VarList.Items.Count = 0 then PostInBtn.Visible := false; +end; + +procedure TInterruptedFrm.PostOutBtnClick(Sender: TObject); +VAR index : integer; +begin + index := PostList.ItemIndex; + if index >= 0 then + begin + VarList.Items.Add(PostList.Items.Strings[index]); + PostList.Items.Delete(index); + PostInBtn.Visible := true; + if PostList.Items.Count = 0 then PostOutBtn.Visible := false; + end; +end; + +procedure TInterruptedFrm.PreInBtnClick(Sender: TObject); +VAR i, index : integer; +begin + index := VarList.Items.count; + i := 0; + while i < index do + begin + if (VarList.Selected[i]) then + begin + PreList.Items.Add(VarList.Items.Strings[i]); + VarList.Items.Delete(i); + index := index - 1; + i := 0; + end + else i := i + 1; + end; + PreOutBtn.Visible := true; + if VarList.Items.Count = 0 then PreInBtn.Visible := false; +end; + +procedure TInterruptedFrm.PreOutBtnClick(Sender: TObject); +VAR index : integer; +begin + index := PreList.ItemIndex; + if index >= 0 then + begin + VarList.Items.Add(PreList.Items.Strings[index]); + PreList.Items.Delete(index); + PreInBtn.Visible := true; + if PreList.Items.Count = 0 then PreOutBtn.Visible := false; + end; +end; + +procedure TInterruptedFrm.matinverse(Sender: TObject); +var + i, j, j2, j4, k, L, Lc : integer; + temp : double; +begin + //Matrix inverse and determinant + + det := 1; + m1 := 1; + N := 4; + For i := 1 To 4 do + begin + p1[i] := 0.0; + For j := 1 To 2 do ii3[i, j] := 0.0; + end; + For i := 1 To N do + begin + amax := 0.0; + For j := 1 To N do + begin + If (p1[j] - 1) <> 0 Then + begin + For k := 1 To N do + begin + If (p1[k] - 1) <> 0 Then + begin + If (p1[k] - 1) > 0 Then Exit; + If Abs(amax) - Abs(x1[j, k]) <= 0 Then + begin + R1 := j; + i1 := k; + amax := x1[j, k]; + End; + End; + end; + End; + end; + p1[i1] := p1[i1] + 1; + If (R1 - i1) <> 0 Then //Swap + begin + det := -det; + For L := 1 To N do + begin + s4 := x1[R1, L]; + x1[R1, L] := x1[i1, L]; + x1[i1, L] := s4; + end; + If m1 > 0 Then //Swap + begin + For L := 1 To m1 do + begin + s4 := b[R1, L]; + b[R1, L] := b[i1, L]; + b[i1, L] := s4; + end; + End; + End; + ii3[i, 1] := R1; + ii3[i, 2] := i1; + p2[i] := x1[i1, i1]; + det := det * p2[i]; + If p2[i] = 0 Then + begin + ShowMessage('A singular matrix was found.'); + Exit; + End; + x1[i1, i1] := 1; + For L := 1 To N do + begin + x1[i1, L] := x1[i1, L] / p2[i]; + end; + If m1 > 0 Then + begin + For L := 1 To m1 do + begin + b[i1, L] := b[i1, L] / p2[i]; + end; + End; + For Lc := 1 To N do + begin + If (Lc - i1) <> 0 Then + begin + temp := x1[Lc,i1]; + x1[L1,i1] := 0.0; + For L := 1 To N do + begin + x1[Lc,L] := x1[Lc,L] - x1[i1,L] * temp; + end; + If m1 > 0 Then + begin + For L := 1 To m1 do + b[L1, L] := b[L1, L] - b[i1, L] * temp; + End; + End; + end; + end; + For i := 1 To N do + begin + L := N + 1 - i; + If (ii3[L, 1] - ii3[L, 2]) <> 0 Then + begin + j2 := round(ii3[L, 1]); + j4 := round(ii3[L, 2]); + For k := 1 To N do + begin + s4 := x1[k, j2]; + x1[k, j2] := x1[k, j4]; + x1[k, j4] := s4; + end; + End; + end; +end; +//-------------------------------------------------------------------- + +procedure TInterruptedFrm.plotit( Sender: TObject); +label 2180, 2660; +var + i, i2, ip, j, k, L, n8 : integer; + bstr, p1str, p2str : string; + c5, z2 : double; + +begin + For i := 1 To N do + begin + a1[i] := 1E+37; + a2[i] := -1E+37; + end; + bstr := '153510cmha'; + For i := 1 To M do + begin + For j := 1 To N do + begin + c5 := x4[i, j] - a1[j]; + If c5 >= 0 Then goto 2180; + a1[j] := x4[i, j]; +2180: c5 := x4[i, j] - a2[j]; + If c5 <= 0 Then continue; + a2[j] := x4[i, j]; + end; + end; + If (N - 5) = 0 Then + begin + For j := 1 To 5 do + begin + a2[j] := a2[5]; + a1[j] := a1[1]; + end; + End; + n8 := N; + For j := 1 To N do + begin + r2[j] := (a2[j] - a1[j]) / 55; + end; + For j := 1 To N do + begin + e[j] := (a2[j] - a1[j]) / 4; + f2[1, j] := a1[j] + 0.05; + c5 := a1[j]; + If c5 < 0 Then + begin + f2[1, j] := f2[1, j] - 0.1; + End; + f2[5, j] := a2[j] - 0.05; + c5 := a2[j]; + If c5 < 0 Then + begin + f2[5, j] := f2[5, j] - 0.1; + End; + f2[2, j] := a1[j] + e[j] + 0.05; + c5 := f2[2, j]; + If c5 < 0 Then + begin + f2[2, j] := f2[2, j] - 0.1; + End; + f2[3, j] := a1[j] + e[j] * 2 + 0.05; + c5 := f2[3, j]; + If c5 < 0 Then + begin + f2[3, j] := f2[3, j] - 0.1; + End; + f2[4, j] := a2[j] - e[j] + 0.05; + c5 := f2[4, j]; + If c5 < 0 Then + begin + f2[4, j] := f2[4, j] - 0.1; + End; + end; + + For j := 1 To n8 do + begin + pl := bstr[j] + ' '; + For i := 1 To 5 do + begin + pl := pl + format('%6.2f ',[f2[i,j]]); + end; + pl := pl + copy(bstr, j, 1); + OutPutFrm.RichEdit.Lines.Add(pl); + end; + pl := ''; + OutPutFrm.RichEdit.Lines.Add('----------------------------------------------------------------------'); + + for i2 := 1 to 73 do + begin + p2str := p2str + ' '; + p1str := p1str + ' '; + end; + For i := 1 To M do + begin + For i2 := 1 To 72 do p1str[i2] := ' '; + k := 0; + p1str[1] := '.'; + For i2 := 1 To 5 do + begin + k := k + 14; + p1str[k] := '.'; + end; + n7 := i; + while N7 >= 0 do + begin + n7 := n7 - 10; + end; + If n7 >= 0 Then + begin + k := 3; + p1str[k] := '-'; + For i2 := 3 To 30 do + begin + k := k + 2; + p1str[k] := '-'; + end; + End; + For k := 1 To N do + begin + If r2[k] > 0 Then + z2 := (x4[i, k] - a1[k]) / r2[k] + 1 + Else z2 := 0; + L := round(z2); + If (L - 1) < 0 Then L := 1; + If (55 - L) < 0 Then L := 55; + If (p1str[L] = ' ') Or (p1str[L] = '.') Or (p1str[L] = '-') Then + begin + p2str[k] := bstr[k]; + p1str[L] := p2str[k]; + end + Else begin + p1str[L] := '+'; + End; + end; + If (s4 - 1) = 0 Then goto 2660; + OutPutFrm.RichEdit.Lines.Add(''); +2660: + pl := format('%2d. ',[i]); + For ip := 1 To 55 do pl := pl + p1str[ip]; + pl := pl + format('. %2d',[i]); + OutPutFrm.RichEdit.Lines.Add(pl); + end; + OutPutFrm.RichEdit.Lines.Add('----------------------------------------------------------------------'); + OutPutFrm.RichEdit.Lines.Add(''); + For j := 1 To n8 do + begin + pl := bstr[j] + ' '; + For i := 1 To 5 do + begin + pl := pl + format('%6.2f ',[f2[i,j]]); + end; + pl := pl + bstr[j]; + OutPutFrm.RichEdit.Lines.Add(pl); + end; + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add(' Plot Description'); + OutPutFrm.RichEdit.Lines.Add('title character minimum maximum resolution'); + + For j := 1 To N do + begin + pl := copy(f1s,j*20-19,20); + pl := pl + ' ' + bstr[j]; + pl := pl + ' ' + format('%6.2f',[a1[j]]); + pl := pl + ' ' + format('%6.2f',[a2[j]]); + pl := pl + ' ' + format('%6.2f',[r2[j]]); + OutPutFrm.RichEdit.Lines.Add(pl); + end; + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add(''); +end; +//------------------------------------------------------------------- + +procedure TInterruptedFrm.PlotFuncs(Sender: TObject); +var + i, j : integer; + title : string; + gamma : double; +begin + // Allocate space for point sets of means + SetLength(GraphFrm.Ypoints,3,50); + SetLength(GraphFrm.Xpoints,3,50); + // store points for means + gamma := 0.0; + for i := 1 to 49 do + begin + for j := 1 to 3 do + begin + GraphFrm.Ypoints[j-1,i-1] := x4[i,j]; + GraphFrm.Xpoints[j-1,i-1] := gamma; + end; + gamma := gamma + 0.04; + end; + title := 'Plot of ts for change in level and slope and posterior'; + GraphFrm.nosets := 3; + GraphFrm.nbars := 49; + GraphFrm.Heading := title; + GraphFrm.SetLabels[1] := 'level'; + GraphFrm.SetLabels[2] := 'slope'; + GraphFrm.SetLabels[3] := 'posterior'; + GraphFrm.XTitle := 'Gamma Increment'; + GraphFrm.YTitle := 't'; + GraphFrm.barwideprop := 0.5; + GraphFrm.AutoScale := true; + GraphFrm.GraphType := 5; // 2d line chart + GraphFrm.BackColor := clYellow; + GraphFrm.WallColor := clBlack; + GraphFrm.FloorColor := clLtGray; + GraphFrm.ShowBackWall := true; + GraphFrm.ShowModal; + + GraphFrm.Xpoints := nil; + GraphFrm.Ypoints := nil; +end; + +initialization + {$I interruptedunit.lrs} + +end. + diff --git a/applications/lazstats/source_orig/inversezunit.lfm b/applications/lazstats/source_orig/inversezunit.lfm new file mode 100644 index 000000000..020d8db59 --- /dev/null +++ b/applications/lazstats/source_orig/inversezunit.lfm @@ -0,0 +1,80 @@ +object InversezForm: TInversezForm + Left = 288 + Height = 179 + Top = 161 + Width = 320 + Caption = 'Normal z for a given probability' + ClientHeight = 179 + ClientWidth = 320 + OnShow = ResetBtnClick + LCLVersion = '0.9.30' + object Label1: TLabel + Left = 9 + Height = 16 + Top = 13 + Width = 136 + Caption = 'Cumulative Probability = ' + ParentColor = False + end + object ProbEdit: TEdit + Left = 153 + Height = 23 + Top = 7 + Width = 65 + TabOrder = 0 + Text = 'ProbEdit' + end + object Label2: TLabel + Left = 8 + Height = 16 + Top = 46 + Width = 144 + Caption = 'Corresponds to a z value = ' + ParentColor = False + end + object ZEdit: TEdit + Left = 154 + Height = 23 + Top = 39 + Width = 65 + TabOrder = 1 + Text = 'ZEdit' + end + object CancelBtn: TButton + Left = 8 + Height = 33 + Top = 80 + Width = 82 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end + object ResetBtn: TButton + Left = 113 + Height = 33 + Top = 80 + Width = 82 + Caption = 'Reset' + OnClick = ResetBtnClick + TabOrder = 3 + end + object ComputeBtn: TButton + Left = 216 + Height = 33 + Top = 80 + Width = 82 + Caption = 'Compute' + OnClick = ComputeBtnClick + TabOrder = 4 + end + object ReturnBtn: TButton + Left = 115 + Height = 33 + Top = 130 + Width = 77 + Caption = 'Return' + ModalResult = 1 + TabOrder = 5 + end +end diff --git a/applications/lazstats/source_orig/inversezunit.lrs b/applications/lazstats/source_orig/inversezunit.lrs new file mode 100644 index 000000000..f2a19e094 --- /dev/null +++ b/applications/lazstats/source_orig/inversezunit.lrs @@ -0,0 +1,23 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('TInversezForm','FORMDATA',[ + 'TPF0'#13'TInversezForm'#12'InversezForm'#4'Left'#3' '#1#6'Height'#3#179#0#3 + +'Top'#3#161#0#5'Width'#3'@'#1#7'Caption'#6' Normal z for a given probability' + +#12'ClientHeight'#3#179#0#11'ClientWidth'#3'@'#1#6'OnShow'#7#13'ResetBtnClic' + +'k'#10'LCLVersion'#6#6'0.9.30'#0#6'TLabel'#6'Label1'#4'Left'#2#9#6'Height'#2 + +#16#3'Top'#2#13#5'Width'#3#136#0#7'Caption'#6#25'Cumulative Probability = ' + +#11'ParentColor'#8#0#0#5'TEdit'#8'ProbEdit'#4'Left'#3#153#0#6'Height'#2#23#3 + +'Top'#2#7#5'Width'#2'A'#8'TabOrder'#2#0#4'Text'#6#8'ProbEdit'#0#0#6'TLabel'#6 + +'Label2'#4'Left'#2#8#6'Height'#2#16#3'Top'#2'.'#5'Width'#3#144#0#7'Caption'#6 + +#27'Corresponds to a z value = '#11'ParentColor'#8#0#0#5'TEdit'#5'ZEdit'#4'L' + +'eft'#3#154#0#6'Height'#2#23#3'Top'#2''''#5'Width'#2'A'#8'TabOrder'#2#1#4'Te' + +'xt'#6#5'ZEdit'#0#0#7'TButton'#9'CancelBtn'#4'Left'#2#8#6'Height'#2'!'#3'Top' + +#2'P'#5'Width'#2'R'#6'Cancel'#9#7'Caption'#6#6'Cancel'#11'ModalResult'#2#2#8 + +'TabOrder'#2#2#0#0#7'TButton'#8'ResetBtn'#4'Left'#2'q'#6'Height'#2'!'#3'Top' + +#2'P'#5'Width'#2'R'#7'Caption'#6#5'Reset'#7'OnClick'#7#13'ResetBtnClick'#8'T' + +'abOrder'#2#3#0#0#7'TButton'#10'ComputeBtn'#4'Left'#3#216#0#6'Height'#2'!'#3 + +'Top'#2'P'#5'Width'#2'R'#7'Caption'#6#7'Compute'#7'OnClick'#7#15'ComputeBtnC' + +'lick'#8'TabOrder'#2#4#0#0#7'TButton'#9'ReturnBtn'#4'Left'#2's'#6'Height'#2 + +'!'#3'Top'#3#130#0#5'Width'#2'M'#7'Caption'#6#6'Return'#11'ModalResult'#2#1#8 + +'TabOrder'#2#5#0#0#0 +]); diff --git a/applications/lazstats/source_orig/inversezunit.pas b/applications/lazstats/source_orig/inversezunit.pas new file mode 100644 index 000000000..f5a3dd629 --- /dev/null +++ b/applications/lazstats/source_orig/inversezunit.pas @@ -0,0 +1,60 @@ +unit InversezUnit; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, + StdCtrls, functionslib; + +type + + { TInversezForm } + + TInversezForm = class(TForm) + CancelBtn: TButton; + ComputeBtn: TButton; + ResetBtn: TButton; + ReturnBtn: TButton; + ZEdit: TEdit; + Label2: TLabel; + ProbEdit: TEdit; + Label1: TLabel; + procedure ComputeBtnClick(Sender: TObject); + procedure ResetBtnClick(Sender: TObject); + private + { private declarations } + public + { public declarations } + end; + +var + InversezForm: TInversezForm; + +implementation + +{ TInversezForm } + +procedure TInversezForm.ResetBtnClick(Sender: TObject); +begin + ProbEdit.Text := ''; + ZEdit.Text := ''; +end; + +procedure TInversezForm.ComputeBtnClick(Sender: TObject); +VAR + Prob, Zscore : double; + outvalue : string; +begin + Prob := StrToFloat(ProbEdit.Text); + Zscore := inversez(Prob); + outvalue := format('%6.4f',[Zscore]); + ZEdit.Text := outvalue; +end; + +initialization + {$I inversezunit.lrs} + +end. + diff --git a/applications/lazstats/source_orig/itembankingunit.lfm b/applications/lazstats/source_orig/itembankingunit.lfm new file mode 100644 index 000000000..07e76826a --- /dev/null +++ b/applications/lazstats/source_orig/itembankingunit.lfm @@ -0,0 +1,245 @@ +object ItemBankFrm: TItemBankFrm + Left = 139 + Height = 565 + Top = 107 + Width = 346 + Caption = 'Item Banking' + ClientHeight = 545 + ClientWidth = 346 + Menu = MainMenu1 + OnCreate = FormCreate + OnShow = FormShow + LCLVersion = '0.9.30.4' + object Label1: TLabel + Left = 10 + Height = 16 + Top = 40 + Width = 86 + Caption = 'No. Item Codes:' + ParentColor = False + end + object NItemCodesText: TEdit + Left = 156 + Height = 23 + Top = 32 + Width = 44 + TabOrder = 0 + end + object BankNameLabel: TLabel + Left = 8 + Height = 16 + Top = 8 + Width = 92 + Caption = 'Item Bank Name:' + ParentColor = False + end + object BankNameText: TEdit + Left = 112 + Height = 23 + Top = 0 + Width = 224 + TabOrder = 1 + end + object NMCItemsLabel: TLabel + Left = 8 + Height = 16 + Top = 72 + Width = 142 + Caption = 'No. Multiple Choice Items:' + ParentColor = False + end + object NMCItemsText: TEdit + Left = 156 + Height = 23 + Top = 64 + Width = 44 + TabOrder = 2 + end + object TFItemsLabel: TLabel + Left = 8 + Height = 16 + Top = 104 + Width = 113 + Caption = 'No. True-False Items:' + ParentColor = False + end + object NTFItemsText: TEdit + Left = 156 + Height = 23 + Top = 96 + Width = 44 + TabOrder = 3 + end + object NMatchLabel: TLabel + Left = 8 + Height = 16 + Top = 136 + Width = 109 + Caption = 'No. Matching Items:' + ParentColor = False + end + object NMatchItemsText: TEdit + Left = 156 + Height = 23 + Top = 128 + Width = 44 + TabOrder = 4 + end + object NEssayLabel: TLabel + Left = 8 + Height = 16 + Top = 167 + Width = 86 + Caption = 'No. Essay Items:' + ParentColor = False + end + object NEssayText: TEdit + Left = 156 + Height = 23 + Top = 160 + Width = 44 + TabOrder = 5 + end + object FilesLabel: TLabel + Left = 16 + Height = 16 + Top = 320 + Width = 24 + Caption = 'Files' + ParentColor = False + end + object FileListBox1: TFileListBox + Left = 16 + Height = 188 + Top = 344 + Width = 267 + Directory = 'C:\Users\wgmiller\Desktop' + ItemHeight = 15 + TabOrder = 6 + end + object Button1: TButton + Left = 15 + Height = 19 + Top = 272 + Width = 305 + Caption = 'Click to Change Directory to Options Default Directory' + OnClick = Button1Click + TabOrder = 7 + end + object DirectoryEdit1: TEdit + Left = 16 + Height = 23 + Top = 296 + Width = 267 + TabOrder = 8 + Text = 'DirectoryEdit1' + end + object Label2: TLabel + Left = 10 + Height = 16 + Top = 200 + Width = 79 + Caption = 'Test Specified?' + ParentColor = False + end + object TestSpecifiedEdit: TEdit + Left = 156 + Height = 23 + Top = 192 + Width = 44 + TabOrder = 9 + end + object Label3: TLabel + Left = 9 + Height = 16 + Top = 231 + Width = 74 + Caption = 'No. Specified:' + ParentColor = False + end + object NSpecifiedEdit: TEdit + Left = 157 + Height = 23 + Top = 226 + Width = 43 + TabOrder = 10 + Text = 'NSpecifiedEdit' + end + object MainMenu1: TMainMenu + left = 272 + top = 72 + object MenuItem1: TMenuItem + Caption = 'Item Bank' + object OpenItemBank: TMenuItem + Caption = 'Open an existing item bank' + OnClick = OpenItemBankClick + end + object NewItemBank: TMenuItem + Caption = 'Create a new item bank' + OnClick = NewItemBankClick + end + object SaveBankMenu: TMenuItem + Caption = 'Save Current Item Bank' + OnClick = SaveBankMenuClick + end + object ExitThis: TMenuItem + Caption = 'Exit this procedure' + OnClick = ExitThisClick + end + end + object Operations: TMenuItem + Caption = 'Operations' + object CreateCodes: TMenuItem + Caption = 'Create Item Content Codes' + OnClick = CreateCodesClick + end + object ShowCodes: TMenuItem + Caption = 'Display all codes' + OnClick = ShowCodesClick + end + object MCItems: TMenuItem + Caption = 'Create or Edit Multiple Choice Items' + OnClick = MCItemsClick + end + object TFItems: TMenuItem + Caption = 'Create or Edit True-False Items' + OnClick = TFItemsClick + end + object MatchingItems: TMenuItem + Caption = 'Create or Edit Matching Items' + OnClick = MatchingItemsClick + end + object EssayItems: TMenuItem + Caption = 'Create or Edit Essay Items' + OnClick = EssayItemsClick + end + end + object TestOptions: TMenuItem + Caption = 'Test Options' + object TestSpecs: TMenuItem + Caption = 'Specify a test''s Contents' + OnClick = TestSpecsClick + end + object ListItems: TMenuItem + Caption = 'List all test items' + OnClick = ListItemsClick + end + object PrintTest: TMenuItem + Caption = 'Print a test to administer' + OnClick = PrintTestClick + end + end + end + object OpenDialog1: TOpenDialog + left = 272 + top = 184 + end + object SaveDialog1: TSaveDialog + left = 272 + top = 128 + end + object SelDir: TSelectDirectoryDialog + left = 208 + top = 184 + end +end diff --git a/applications/lazstats/source_orig/itembankingunit.lrs b/applications/lazstats/source_orig/itembankingunit.lrs new file mode 100644 index 000000000..c75e3995a --- /dev/null +++ b/applications/lazstats/source_orig/itembankingunit.lrs @@ -0,0 +1,65 @@ +LazarusResources.Add('TItemBankFrm','FORMDATA',[ + 'TPF0'#12'TItemBankFrm'#11'ItemBankFrm'#4'Left'#3#139#0#6'Height'#3'5'#2#3'To' + +'p'#2'k'#5'Width'#3'Z'#1#7'Caption'#6#12'Item Banking'#12'ClientHeight'#3'!' + +#2#11'ClientWidth'#3'Z'#1#4'Menu'#7#9'MainMenu1'#8'OnCreate'#7#10'FormCreate' + +#6'OnShow'#7#8'FormShow'#10'LCLVersion'#6#8'0.9.30.4'#0#6'TLabel'#6'Label1'#4 + +'Left'#2#10#6'Height'#2#16#3'Top'#2'('#5'Width'#2'V'#7'Caption'#6#15'No. Ite' + +'m Codes:'#11'ParentColor'#8#0#0#5'TEdit'#14'NItemCodesText'#4'Left'#3#156#0 + +#6'Height'#2#23#3'Top'#2' '#5'Width'#2','#8'TabOrder'#2#0#0#0#6'TLabel'#13'B' + +'ankNameLabel'#4'Left'#2#8#6'Height'#2#16#3'Top'#2#8#5'Width'#2'\'#7'Caption' + +#6#15'Item Bank Name:'#11'ParentColor'#8#0#0#5'TEdit'#12'BankNameText'#4'Lef' + +'t'#2'p'#6'Height'#2#23#3'Top'#2#0#5'Width'#3#224#0#8'TabOrder'#2#1#0#0#6'TL' + +'abel'#13'NMCItemsLabel'#4'Left'#2#8#6'Height'#2#16#3'Top'#2'H'#5'Width'#3 + +#142#0#7'Caption'#6#26'No. Multiple Choice Items:'#11'ParentColor'#8#0#0#5'T' + +'Edit'#12'NMCItemsText'#4'Left'#3#156#0#6'Height'#2#23#3'Top'#2'@'#5'Width'#2 + +','#8'TabOrder'#2#2#0#0#6'TLabel'#12'TFItemsLabel'#4'Left'#2#8#6'Height'#2#16 + +#3'Top'#2'h'#5'Width'#2'q'#7'Caption'#6#21'No. True-False Items:'#11'ParentC' + +'olor'#8#0#0#5'TEdit'#12'NTFItemsText'#4'Left'#3#156#0#6'Height'#2#23#3'Top' + +#2'`'#5'Width'#2','#8'TabOrder'#2#3#0#0#6'TLabel'#11'NMatchLabel'#4'Left'#2#8 + +#6'Height'#2#16#3'Top'#3#136#0#5'Width'#2'm'#7'Caption'#6#19'No. Matching It' + +'ems:'#11'ParentColor'#8#0#0#5'TEdit'#15'NMatchItemsText'#4'Left'#3#156#0#6 + +'Height'#2#23#3'Top'#3#128#0#5'Width'#2','#8'TabOrder'#2#4#0#0#6'TLabel'#11 + +'NEssayLabel'#4'Left'#2#8#6'Height'#2#16#3'Top'#3#167#0#5'Width'#2'V'#7'Capt' + +'ion'#6#16'No. Essay Items:'#11'ParentColor'#8#0#0#5'TEdit'#10'NEssayText'#4 + +'Left'#3#156#0#6'Height'#2#23#3'Top'#3#160#0#5'Width'#2','#8'TabOrder'#2#5#0 + +#0#6'TLabel'#10'FilesLabel'#4'Left'#2#16#6'Height'#2#16#3'Top'#3'@'#1#5'Widt' + +'h'#2#24#7'Caption'#6#5'Files'#11'ParentColor'#8#0#0#12'TFileListBox'#12'Fil' + +'eListBox1'#4'Left'#2#16#6'Height'#3#188#0#3'Top'#3'X'#1#5'Width'#3#11#1#9'D' + +'irectory'#6#25'C:\Users\wgmiller\Desktop'#10'ItemHeight'#2#15#8'TabOrder'#2 + +#6#0#0#7'TButton'#7'Button1'#4'Left'#2#15#6'Height'#2#19#3'Top'#3#16#1#5'Wid' + +'th'#3'1'#1#7'Caption'#6'6Click to Change Directory to Options Default Direc' + +'tory'#7'OnClick'#7#12'Button1Click'#8'TabOrder'#2#7#0#0#5'TEdit'#14'Directo' + +'ryEdit1'#4'Left'#2#16#6'Height'#2#23#3'Top'#3'('#1#5'Width'#3#11#1#8'TabOrd' + +'er'#2#8#4'Text'#6#14'DirectoryEdit1'#0#0#6'TLabel'#6'Label2'#4'Left'#2#10#6 + +'Height'#2#16#3'Top'#3#200#0#5'Width'#2'O'#7'Caption'#6#15'Test Specified?' + +#11'ParentColor'#8#0#0#5'TEdit'#17'TestSpecifiedEdit'#4'Left'#3#156#0#6'Heig' + +'ht'#2#23#3'Top'#3#192#0#5'Width'#2','#8'TabOrder'#2#9#0#0#6'TLabel'#6'Label' + +'3'#4'Left'#2#9#6'Height'#2#16#3'Top'#3#231#0#5'Width'#2'J'#7'Caption'#6#14 + +'No. Specified:'#11'ParentColor'#8#0#0#5'TEdit'#14'NSpecifiedEdit'#4'Left'#3 + +#157#0#6'Height'#2#23#3'Top'#3#226#0#5'Width'#2'+'#8'TabOrder'#2#10#4'Text'#6 + +#14'NSpecifiedEdit'#0#0#9'TMainMenu'#9'MainMenu1'#4'left'#3#16#1#3'top'#2'H' + +#0#9'TMenuItem'#9'MenuItem1'#7'Caption'#6#9'Item Bank'#0#9'TMenuItem'#12'Ope' + +'nItemBank'#7'Caption'#6#26'Open an existing item bank'#7'OnClick'#7#17'Open' + +'ItemBankClick'#0#0#9'TMenuItem'#11'NewItemBank'#7'Caption'#6#22'Create a ne' + +'w item bank'#7'OnClick'#7#16'NewItemBankClick'#0#0#9'TMenuItem'#12'SaveBank' + +'Menu'#7'Caption'#6#22'Save Current Item Bank'#7'OnClick'#7#17'SaveBankMenuC' + +'lick'#0#0#9'TMenuItem'#8'ExitThis'#7'Caption'#6#19'Exit this procedure'#7'O' + +'nClick'#7#13'ExitThisClick'#0#0#0#9'TMenuItem'#10'Operations'#7'Caption'#6 + +#10'Operations'#0#9'TMenuItem'#11'CreateCodes'#7'Caption'#6#25'Create Item C' + +'ontent Codes'#7'OnClick'#7#16'CreateCodesClick'#0#0#9'TMenuItem'#9'ShowCode' + +'s'#7'Caption'#6#17'Display all codes'#7'OnClick'#7#14'ShowCodesClick'#0#0#9 + +'TMenuItem'#7'MCItems'#7'Caption'#6'$Create or Edit Multiple Choice Items'#7 + +'OnClick'#7#12'MCItemsClick'#0#0#9'TMenuItem'#7'TFItems'#7'Caption'#6#31'Cre' + +'ate or Edit True-False Items'#7'OnClick'#7#12'TFItemsClick'#0#0#9'TMenuItem' + +#13'MatchingItems'#7'Caption'#6#29'Create or Edit Matching Items'#7'OnClick' + +#7#18'MatchingItemsClick'#0#0#9'TMenuItem'#10'EssayItems'#7'Caption'#6#26'Cr' + +'eate or Edit Essay Items'#7'OnClick'#7#15'EssayItemsClick'#0#0#0#9'TMenuIte' + +'m'#11'TestOptions'#7'Caption'#6#12'Test Options'#0#9'TMenuItem'#9'TestSpecs' + +#7'Caption'#6#25'Specify a test''s Contents'#7'OnClick'#7#14'TestSpecsClick' + +#0#0#9'TMenuItem'#9'ListItems'#7'Caption'#6#19'List all test items'#7'OnClic' + +'k'#7#14'ListItemsClick'#0#0#9'TMenuItem'#9'PrintTest'#7'Caption'#6#26'Print' + +' a test to administer'#7'OnClick'#7#14'PrintTestClick'#0#0#0#0#11'TOpenDial' + +'og'#11'OpenDialog1'#4'left'#3#16#1#3'top'#3#184#0#0#0#11'TSaveDialog'#11'Sa' + +'veDialog1'#4'left'#3#16#1#3'top'#3#128#0#0#0#22'TSelectDirectoryDialog'#6'S' + +'elDir'#4'left'#3#208#0#3'top'#3#184#0#0#0#0 +]); diff --git a/applications/lazstats/source_orig/itembankingunit.pas b/applications/lazstats/source_orig/itembankingunit.pas new file mode 100644 index 000000000..3ba04de74 --- /dev/null +++ b/applications/lazstats/source_orig/itembankingunit.pas @@ -0,0 +1,752 @@ +unit ItemBankingUnit; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, + Menus, EditBtn, StdCtrls, outputunit, FileCtrl, ItemCodesUnit, OptionsUnit, + TFItemUnit, EssayItemUnit, MCItemUnit, MatchItemUnit, TestSpecsUnit; + +type + Bank = Record + BankName : string; + NMCItems : integer; + NTFItems : integer; + NMatchItems : integer; + NEssayItems : integer; + NCodes : integer; + TestItems : integer; + end; + +type + MCItem = Record + ItemNumber : integer; + MajorCode : integer; + MinorCode : integer; + NoChoices : integer; + ItemStem : string; + ChoiceOne : string; + ChoiceTwo : string; + ChoiceThree : string; + ChoiceFour : string; + ChoiceFive : string; + CorrectChoice : char; + PicName : string; + end; + +type + TFItem = Record + ItemNumber : integer; + MajorCode : integer; + MinorCode : integer; + ItemStem : string; + CorrectChoice : char; + PicName : string; + end; + +type + MatchItem = Record + ItemNumber : integer; + MajorCode : integer; + MinorCode : integer; + NLeft : integer; + NRight : integer; + Left1 : string; + Left2 : string; + Left3 : string; + Left4 : string; + Left5 : string; + Right1 : string; + Right2 : string; + Right3 : string; + Right4 : string; + Right5 : string; + CorrectChoice : char; + PicName : string; + end; + +type + EssayItem = Record + ItemNumber : integer; + MajorCode : integer; + MinorCode : integer; + ItemStem : string; + Answer : string; + PicName : string; + end; + + +type CodeData = record + codenumber : integer; + majorcodes : integer; + minorcodes : integer; + Description : string; +end; +type testspec = record + ItemNumber : integer; + MajorCode : integer; + MinorCode : integer; + ItemType : string; +end; + +type + + { TItemBankFrm } + + TItemBankFrm = class(TForm) + BankNameLabel: TLabel; + BankNameText: TEdit; + Button1: TButton; + DirectoryEdit1: TEdit; + NSpecifiedEdit: TEdit; + Label3: TLabel; + TestSpecifiedEdit: TEdit; + FileListBox1: TFileListBox; + FilesLabel: TLabel; + Label2: TLabel; + ShowCodes: TMenuItem; + OpenDialog1: TOpenDialog; + SaveBankMenu: TMenuItem; + NEssayText: TEdit; + NEssayLabel: TLabel; + NMatchItemsText: TEdit; + NMatchLabel: TLabel; + NTFItemsText: TEdit; + SaveDialog1: TSaveDialog; + SelDir: TSelectDirectoryDialog; + TFItemsLabel: TLabel; + NMCItemsText: TEdit; + NMCItemsLabel: TLabel; + NItemCodesText: TEdit; + Label1: TLabel; + MainMenu1: TMainMenu; + MenuItem1: TMenuItem; + MCItems: TMenuItem; + MatchingItems: TMenuItem; + EssayItems: TMenuItem; + ListItems: TMenuItem; + ExitThis: TMenuItem; + CreateCodes: TMenuItem; + PrintTest: TMenuItem; + TestSpecs: TMenuItem; + TestOptions: TMenuItem; + TFItems: TMenuItem; + Operations: TMenuItem; + NewItemBank: TMenuItem; + OpenItemBank: TMenuItem; + procedure Button1Click(Sender: TObject); + procedure CreateCodesClick(Sender: TObject); + procedure EssayItemsClick(Sender: TObject); + procedure ExitThisClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure ListItemsClick(Sender: TObject); + procedure MatchingItemsClick(Sender: TObject); + procedure MCItemsClick(Sender: TObject); + procedure NewItemBankClick(Sender: TObject); + procedure OpenItemBankClick(Sender: TObject); + procedure PrintTestClick(Sender: TObject); + procedure SaveBankMenuClick(Sender: TObject); + procedure ShowCodesClick(Sender: TObject); + procedure TestSpecsClick(Sender: TObject); + procedure TFItemsClick(Sender: TObject); + private + { private declarations } + Bitmap : TBitmap; + Grect : TRect; + public + { public declarations } + CodesInfo : array[1..100] of CodeData; + MCItemInfo : array[1..100] of MCItem; + TFItemInfo : array[1..100] of TFItem; + MatchInfo : array[1..100] of MatchItem; + EssayInfo : array[1..100] of EssayItem; + TestContents : array[1..100] of testspec; + BankInfo : Bank; + // FileName : string; + + end; + +var + ItemBankFrm: TItemBankFrm; + +implementation + +{ TItemBankFrm } + +procedure TItemBankFrm.OpenItemBankClick(Sender: TObject); +var + FileName : string; + BankFile : TextFile; + i : integer; + cellvalue : integer; + nochoices : integer; +begin + OpenDialog1.DefaultExt := '.BNK'; + OpenDialog1.Filter := 'ALL (*.*)|*.*|Item Bank (*.BNK)|*.BNK'; + OpenDialog1.FilterIndex := 2; + if OpenDialog1.Execute then + begin + FileName := OpenDialog1.FileName; + BankNameText.Text := FileName; + FileName := OpenDialog1.FileName; + AssignFile(BankFile,FileName); + Reset(BankFile); + // place all data from the records in this file + // read general BankInfo first + Readln(BankFile,BankInfo.BankName); + Readln(BankFile,BankInfo.NMCItems); + NMCItemsText.Text := IntToStr(BankInfo.NMCItems); + Readln(BankFile,BankInfo.NTFItems); + NTFItemsText.Text := IntToStr(BankInfo.NTFItems); + Readln(BankFile,BankInfo.NMatchItems); + NMatchItemsText.Text := IntToStr(BankInfo.NMatchItems ); + Readln(BankFile,BankInfo.NEssayItems); + NEssayText.Text := IntToStr(BankInfo.NEssayItems ); + Readln(BankFile,BankInfo.NCodes); + NItemCodesText.Text := IntToStr(BankInfo.NCodes); + Readln(BankFile,BankInfo.TestItems); + NSpecifiedEdit.Text := IntToStr(BankInfo.TestItems); +// ShowMessage('Read no. of items by type'); + // now read codes + if BankInfo.Ncodes > 0 then + begin + for i := 1 to BankInfo.NCodes do + begin + Readln(BankFile,cellvalue); + CodesInfo[i].codenumber := cellvalue; + Readln(BankFile,cellvalue); + CodesInfo[i].majorcodes := cellvalue; + Readln(BankFile,cellvalue); + CodesInfo[i].minorcodes := cellvalue; + Readln(BankFile,CodesInfo[i].Description); + end; +// ShowMessage('Read item codes'); + end; + // now read MC items + if BankInfo.NMCItems > 0 then + begin + for i := 1 to BankInfo.NMCItems do + begin + Readln(BankFile,MCItemInfo[i].ItemNumber); + Readln(BankFile,MCItemInfo[i].MajorCode); + Readln(BankFile,MCItemInfo[i].MinorCode); + Readln(BankFile,MCItemInfo[i].NoChoices); + Readln(BankFile,MCItemInfo[i].ItemStem); + nochoices := McItemInfo[i].NoChoices; + if nochoices > 0 then Readln(BankFile,MCItemInfo[i].ChoiceOne); + if nochoices > 1 then Readln(BankFile,MCItemInfo[i].ChoiceTwo); + if nochoices > 2 then Readln(BankFile,MCItemInfo[i].ChoiceThree); + if nochoices > 3 then Readln(BankFile,MCItemInfo[i].ChoiceFour); + if nochoices > 4 then Readln(BankFile,MCItemInfo[i].ChoiceFive); + Readln(BankFile,MCItemInfo[i].CorrectChoice); + Readln(BankFile,MCItemInfo[i].PicName); + end; +// ShowMessage('Read MC items'); + end; + // now read T-F items + if BankInfo.NTFItems > 0 then + begin + for i := 1 to BankInfo.NTFItems do + begin + readln(BankFile,TFItemInfo[i].ItemNumber); + Readln(BankFile,TFItemInfo[i].MajorCode); + Readln(BankFile,TFItemInfo[i].MinorCode); + Readln(BankFile,TFItemInfo[i].ItemStem); + Readln(BankFile,TFItemInfo[i].CorrectChoice); + Readln(BankFile,TFItemInfo[i].PicName); + end; +// ShowMessage('Read True-False items'); + end; + // now read matching items + if BankInfo.NMatchItems > 0 then + begin + for i := 1 to BankInfo.NMatchItems do + begin + Readln(BankFile,MatchInfo[i].ItemNumber); + Readln(BankFile,MatchInfo[i].MajorCode); + Readln(BankFile,MatchInfo[i].MinorCode); + Readln(BankFile,MatchInfo[i].NLeft); + Readln(BankFile,MatchInfo[i].NRight); + nochoices := MatchInfo[i].NLeft; + if nochoices > 0 then Readln(BankFile,MatchInfo[i].Left1); + if nochoices > 1 then Readln(BankFile,MatchInfo[i].Left2); + if nochoices > 2 then Readln(BankFile,MatchInfo[i].Left3); + if nochoices > 3 then Readln(BankFile,MatchInfo[i].Left4); + if nochoices > 4 then Readln(BankFile,MatchInfo[i].Left5); + nochoices := MatchInfo[i].NRight; + if nochoices > 0 then Readln(BankFile,MatchInfo[i].Right1); + if nochoices > 1 then Readln(BankFile,MatchInfo[i].Right2); + if nochoices > 2 then Readln(BankFile,MatchInfo[i].Right3); + if nochoices > 3 then Readln(BankFile,MatchInfo[i].Right4); + if nochoices > 4 then Readln(BankFile,MatchInfo[i].Right5); + Readln(BankFile,MatchInfo[i].CorrectChoice); + Readln(BankFile,MatchInfo[i].PicName); + end; +// ShowMessage('Read Matching items'); + end; + // now read essay items + if BankInfo.NEssayItems > 0 then + begin + for i := 1 to BankInfo.NEssayItems do + begin + Readln(BankFile,EssayInfo[i].ItemNumber); + Readln(BankFile,EssayInfo[i].MajorCode); + Readln(BankFile,EssayInfo[i].MinorCode); + Readln(BankFile,EssayInfo[i].ItemStem); + Readln(BankFile,EssayInfo[i].Answer); + Readln(BankFile,EssayInfo[i].PicName); + end; +// ShowMessage('Read Essay items'); + end; + if BankInfo.TestItems > 0 then + begin + TestSpecifiedEdit.Text := 'Y'; + for i := 1 to BankInfo.TestItems do + begin + readln(BankFile,TestContents[i].ItemNumber); + readln(BankFile,TestContents[i].MajorCode); + readln(BankFile,TestContents[i].MinorCode); + readln(BankFile,TestContents[i].ItemType); + end; + end; + CloseFile(BankFile); + end; +end; + +procedure TItemBankFrm.PrintTestClick(Sender: TObject); +Var + outline : string[180]; + i, nmc, ntf, nessay, nmatch, itemno : integer; + mcitem, tfitem, essayitem, matchitem : integer; + nleft, nright : integer; + JPEG : TJPEGImage; +begin + itemno := 0; + nmc := StrToInt(NMCItemsText.Text); + ntf := StrToInt(NTFItemsText.Text); + nessay := StrToInt(NEssayText.Text); + nmatch := StrToInt(NMatchItemsText.Text); + OutPutFrm.RichEdit.Clear; + OutPutFrm.RichEdit.Lines.Add('Directions: This test may contain a variety of different item types.'); + OutPutFrm.RichEdit.Lines.Add('For each item, circle the correct answer or provide the answer if'); + OutPutFrm.RichEdit.Lines.Add('required. You may use the back of the test to provide answers to'); + OutPutFrm.RichEdit.Lines.Add('essay questions - just start with the item number.'); + OutPutFrm.RichEdit.Lines.Add('Start now!'); + OutPutFrm.RichEdit.Lines.Add(''); + if nmc > 0 then + begin + OutPutFrm.RichEdit.Lines.Add('MULTIPLE CHOICE ITEMS:'); + for i := 1 to BankInfo.TestItems do + begin + if TestContents[i].ItemType = 'MC' then + begin + itemno := itemno + 1; + outline := format('Item %d',[itemno]); + OutPutFrm.RichEdit.Lines.Add(outline); + mcitem := TestContents[i].ItemNumber; + if MCItemInfo[mcitem].PicName <> 'none' then + begin + outline := format('Reference picture = %s',[MCItemInfo[mcitem].PicName]); + OutPutFrm.RichEdit.Lines.Add(outline); + end; + { begin + Grect.Top := OutPutFrm.RichEdit.Lines.Count ; + Grect.Left := 20; + Grect.Right := 120; + Grect.Bottom := Grect.Top + 120; + JPEG := TJPEGImage.Create; + JPEG.LoadFromFile(MCItemInfo[mcitem].PicName) ; + OutPutFrm.Canvas.StretchDraw(Grect,JPEG); + JPEG.Free; + end; } + OutPutFrm.RichEdit.Lines.Add(MCItemInfo[mcitem].ItemStem); + nleft := MCItemInfo[mcitem].NoChoices; + OutPutFrm.RichEdit.Lines.Add('A. ' + MCItemInfo[mcitem].ChoiceOne); + OutPutFrm.RichEdit.Lines.Add('B. ' + MCItemInfo[mcitem].ChoiceTwo); + if nleft > 2 then + OutPutFrm.RichEdit.Lines.Add('C. ' + MCItemInfo[mcitem].ChoiceThree); + if nleft > 3 then + OutPutFrm.RichEdit.Lines.Add('D. ' + MCItemInfo[mcitem].ChoiceFour); + if nleft > 4 then + OutPutFrm.RichEdit.Lines.Add('E. ' + MCItemInfo[mcitem].ChoiceFive); + OutPutFrm.RichEdit.Lines.Add(''); + end; + end; + end; + if ntf > 0 then + begin + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add('TRUE OR FALSE ITEMS:'); + for i := 1 to BankInfo.TestItems do + begin + if TestContents[i].ItemType = 'TF' then + begin + itemno := itemno + 1; + outline := format('Item %d',[itemno]); + OutPutFrm.RichEdit.Lines.Add(outline); + tfitem := TestContents[i].ItemNumber; + OutPutFrm.RichEdit.Lines.Add(TFItemInfo[tfitem].ItemStem); + OutPutFrm.RichEdit.Lines.Add('A. TRUE'); + OutPutFrm.RichEdit.Lines.Add('B. False'); + end; + end; + OutPutFrm.RichEdit.Lines.Add(''); + end; + if nessay > 0 then + begin + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add('ESSAY ITEMS:'); + for i := 1 to BankInfo.TestItems do + begin + if TestContents[i].ItemType = 'Essay' then + begin + itemno := itemno + 1; + outline := format('Item %d',[itemno]); + OutPutFrm.RichEdit.Lines.Add(outline); + essayitem := TestContents[i].ItemNumber; + OutPutFrm.RichEdit.Lines.Add(EssayInfo[essayitem].ItemStem); + end; + end; + OutPutFrm.RichEdit.Lines.Add(''); + end; + if nmatch > 0 then + begin + OutPutFrm.RichEdit.Lines.Add('MATCHING ITEMS:'); + for i := 1 to BankInfo.TestItems do + begin + if TestContents[i].ItemType = 'Matching' then + begin + itemno := itemno + 1; + outline := format('Item %d',[itemno]); + OutPutFrm.RichEdit.Lines.Add(outline); + matchitem := TestContents[i].ItemNumber; + outline := format('A. %s',[ItemBankFrm.MatchInfo[matchitem].Left1]); + outline := outline + ' 1. '; + outline := outline + ItemBankFrm.MatchInfo[matchitem].Right1 ; + OutPutFrm.RichEdit.Lines.Add(outline); + outline := format('B. %s',[ItemBankFrm.MatchInfo[matchitem].Left2]); + nleft := ItemBankFrm.MatchInfo[matchitem].NLeft; + nright := ItemBankFrm.MatchInfo[matchitem].NRight; + if nright > 1 then + begin + outline := outline + ' 2. '; + outline := outline + ItemBankFrm.MatchInfo[matchitem].Right2; + end; + OutPutFrm.RichEdit.Lines.Add(outline); + if nleft > 2 then + begin + outline := format('C. %s',[ItemBankFrm.MatchInfo[matchitem].Left3]); + if nright > 2 then + begin + outline := outline + ' 3. '; + outline := outline + ItemBankFrm.MatchInfo[matchitem].Right3; + end; + OutPutFrm.RichEdit.Lines.Add(outline); + end; + + if nleft > 3 then + begin + outline := format('D. %s',[ItemBankFrm.MatchInfo[matchitem].Left4]); + if nright > 3 then + begin + outline := outline + ' 4. '; + outline := outline + ItemBankFrm.MatchInfo[matchitem].Right4; + end; + OutPutFrm.RichEdit.Lines.Add(outline); + end; + + if nleft > 4 then + begin + outline := format('E. %s',[ItemBankFrm.MatchInfo[matchitem].Left5]); + if nright > 4 then + begin + outline := outline + ' 5. '; + outline := outline + ItemBankFrm.MatchInfo[matchitem].Right5; + end; + OutPutFrm.RichEdit.Lines.Add(outline); + end; + + end; +// OutPutFrm.RichEdit.Lines.Add(''); + end; + OutPutFrm.RichEdit.Lines.Add(''); + end; + OutPutFrm.ShowModal; +end; + +procedure TItemBankFrm.SaveBankMenuClick(Sender: TObject); +var + FileName : string; + BankFile : TextFile; + i : integer; + cellvalue : integer; + nochoices : integer; + message : string; + nspecs : integer; +begin + if BankNameText.Text = '' then Close; + SaveDialog1.DefaultExt := '.BNK'; + SaveDialog1.Filter := 'ALL (*.*)|*.*|ItemBank (*.BNK)|*.BNK'; + SaveDialog1.FilterIndex := 2; + if SaveDialog1.Execute then + begin + FileName := SaveDialog1.FileName; + AssignFile(BankFile,FileName); + Rewrite(BankFile); + BankInfo.BankName := FileName; + // place all data from the records in this file + // write general BankInfo first + writeln(BankFile,BankInfo.BankName); + writeln(BankFile,BankInfo.NMCItems); + writeln(BankFile,BankInfo.NTFItems); + writeln(BankFile,BankInfo.NMatchItems); + writeln(BankFile,BankInfo.NEssayItems); + writeln(BankFile,BankInfo.NCodes); + writeln(BankFile,BankInfo.TestItems); + // now save codes + if BankInfo.NCodes > 0 then + begin + for i := 1 to BankInfo.NCodes do + begin + cellvalue := CodesInfo[i].codenumber; + writeln(BankFile,cellvalue); + cellvalue := CodesInfo[i].majorcodes ; + writeln(BankFile,cellvalue); + cellvalue := CodesInfo[i].minorcodes; + writeln(BankFile,cellvalue); + writeln(BankFile,CodesInfo[i].Description); + end; + end; + // now save MC items + if BankInfo.NMCItems > 0 then + begin + for i := 1 to BankInfo.NMCItems do + begin + nochoices := MCItemInfo[i].NoChoices ; + writeln(BankFile,MCItemInfo[i].ItemNumber); + writeln(BankFile,MCItemInfo[i].MajorCode); + writeln(BankFile,MCItemInfo[i].MinorCode); + writeln(BankFile,MCItemInfo[i].NoChoices); + writeln(BankFile,MCItemInfo[i].ItemStem); + if nochoices > 0 then writeln(BankFile,MCItemInfo[i].ChoiceOne); + if nochoices > 1 then writeln(BankFile,MCItemInfo[i].ChoiceTwo); + if nochoices > 2 then writeln(BankFile,MCItemInfo[i].ChoiceThree); + if nochoices > 3 then writeln(BankFile,MCItemInfo[i].ChoiceFour); + if nochoices > 4 then writeln(BankFile,MCItemInfo[i].ChoiceFive); + writeln(BankFile,MCItemInfo[i].CorrectChoice); + writeln(BankFile,MCItemInfo[i].PicName); + end; + end; + // now save T-F items + if BankInfo.NTFItems > 0 then + begin + for i := 1 to BankInfo.NTFItems do + begin + writeln(BankFile,TFItemInfo[i].ItemNumber); + writeln(BankFile,TFItemInfo[i].MajorCode); + writeln(BankFile,TFItemInfo[i].MinorCode); + writeln(BankFile,TFItemInfo[i].ItemStem); + writeln(BankFile,TFItemInfo[i].CorrectChoice); + writeln(BankFile,TFItemInfo[i].PicName); + end; + end; + // now save matching items + if BankInfo.NMatchItems > 0 then + begin + for i := 1 to BankInfo.NMatchItems do + begin + nochoices := MatchInfo[i].NLeft; + Writeln(BankFile,MatchInfo[i].ItemNumber); + writeln(BankFile,MatchInfo[i].MajorCode); + writeln(BankFile,MatchInfo[i].MinorCode); + writeln(BankFile,MatchInfo[i].NLeft); + writeln(BankFile,MatchInfo[i].NRight); + if nochoices > 0 then writeln(BankFile,MatchInfo[i].Left1); + if nochoices > 1 then writeln(BankFile,MatchInfo[i].Left2); + if nochoices > 2 then writeln(BankFile,MatchInfo[i].Left3); + if nochoices > 3 then writeln(BankFile,MatchInfo[i].Left4); + if nochoices > 4 then writeln(BankFile,MatchInfo[i].Left5); + nochoices := MatchInfo[i].NRight; + if nochoices > 0 then writeln(BankFile,MatchInfo[i].Right1); + if nochoices > 1 then writeln(BankFile,MatchInfo[i].Right2); + if nochoices > 2 then writeln(BankFile,MatchInfo[i].Right3); + if nochoices > 3 then writeln(BankFile,MatchInfo[i].Right4); + if nochoices > 4 then writeln(BankFile,MatchInfo[i].Right5); + writeln(BankFile,MatchInfo[i].CorrectChoice); + writeln(BankFile,MatchInfo[i].PicName); + end; + end; + // now save essay items + if BankInfo.NEssayItems > 0 then + begin + for i := 1 to BankInfo.NEssayItems do + begin + writeln(BankFile,EssayInfo[i].ItemNumber); + writeln(BankFile,EssayInfo[i].MajorCode); + writeln(BankFile,EssayInfo[i].MinorCode); + writeln(BankFile,EssayInfo[i].ItemStem); + writeln(BankFile,EssayInfo[i].Answer); + writeln(BankFile,EssayInfo[i].PicName); + end; + end; + // now save test specifications + nspecs := StrToInt(NSpecifiedEdit.Text); + if nspecs > 0 then + begin + TestSpecifiedEdit.Text := 'Y'; + for i := 1 to TestSpecsForm.testno do + begin + writeln(BankFile,TestContents[i].ItemNumber); + writeln(BankFile,TestContents[i].MajorCode); + writeln(BankFile,TestContents[i].MinorCode); + writeln(BankFile,TestContents[i].ItemType); + end; + end; + CloseFile(BankFile); + end; +end; + +procedure TItemBankFrm.ShowCodesClick(Sender: TObject); +Var + i : integer; + outline : string; + ncodes : integer; +begin +if NItemCodesText.Text <> '' then + begin + OutPutFrm.RichEdit.Lines.Add('Current Item Coding Scheme'); + OutPutFrm.RichEdit.Lines.Add(''); + ncodes := StrToInt(NItemCodesText.Text); + for i := 1 to ncodes do + begin + outline := format('Code number %d',[i]); + OutPutFrm.RichEdit.Lines.Add(outline); + outline := format('Major Code %d',[CodesInfo[i].majorcodes]); + OutPutFrm.RichEdit.Lines.Add(outline); + outline := format('Minor Code %d',[CodesInfo[i].minorcodes]); + OutPutFrm.RichEdit.Lines.Add(outline); + outline := format('Description %s',[CodesInfo[i].Description]); + OutPutFrm.RichEdit.Lines.Add(outline); + OutPutFrm.RichEdit.Lines.Add(''); + end; + OutPutFrm.ShowModal; + end; + +end; + +procedure TItemBankFrm.TestSpecsClick(Sender: TObject); +begin + TestSpecsForm.SpecFileEdit.Text := BankNameText.Text; + TestSpecsForm.MCNoEdit.Text := IntToStr(BankInfo.NMCItems); + TestSpecsForm.TFNoEdit.Text := IntToStr(BankInfo.NTFItems); + TestSpecsForm.EssayNoEdit.Text := IntToStr(BankInfo.NEssayItems); + TestSpecsForm.MatchNoEdit.Text := IntToStr(BankInfo.NMatchItems); + TestSpecsForm.ShowModal; +end; + +procedure TItemBankFrm.TFItemsClick(Sender: TObject); +begin + TFItemForm.ShowModal; +end; + +procedure TItemBankFrm.NewItemBankClick(Sender: TObject); +Var + response : string; +begin + response := InputBox('SAVE','Save current item bank (Y or N)?','N'); + if response = 'Y' then SaveBankMenuClick(self); + BankNameText.Text := ''; + OpenItemBankClick(self); +end; + +procedure TItemBankFrm.ExitThisClick(Sender: TObject); +Var + response : string; +begin + response := InputBox('SAVE','Save current item bank (Y or N)?','N'); + if response = 'Y' then SaveBankMenuClick(self); + ItemBankFrm.Hide; + Close; +end; + +procedure TItemBankFrm.FormCreate(Sender: TObject); +begin + DirectoryEdit1.Text := OptionsFrm.FilePathEdit.Text; + FileListBox1.Directory := DirectoryEdit1.Text; +end; + +procedure TItemBankFrm.FormShow(Sender: TObject); +begin + BankNameText.Text := ''; + NItemCodesText.Text := ''; + NMCItemsText.Text := ''; + NTFItemsText.Text := ''; + NMatchItemsText.Text := ''; + NEssayText.Text := ''; + BankInfo.BankName := ''; + BankInfo.NCodes := 0; + BankInfo.NEssayItems := 0; + BankInfo.NMatchItems := 0; + BankInfo.NTFItems := 0; + BankInfo.NMCItems := 0; + TestSpecifiedEdit.Text := 'N'; + NSpecifiedEdit.Text := ''; +end; + +procedure TItemBankFrm.ListItemsClick(Sender: TObject); +Var + i : integer; + outline : string; +begin + if BankInfo.TestItems > 0 then + begin + OutPutFrm.RichEdit.Clear; + for i := 1 to BankInfo.TestItems do + begin + outline := format('Item number: %d',[TestContents[i].ItemNumber]); + OutPutFrm.RichEdit.Lines.Add(outline); + outline := format('Major code: %d',[TestContents[i].MajorCode]); + OutPutFrm.RichEdit.Lines.Add(outline); + outline := format('Minor code: %d',[TestContents[i].MinorCode]); + OutPutFrm.RichEdit.Lines.Add(outline); + outline := format('Item type: %s',[TestContents[i].ItemType]); + OutPutFrm.RichEdit.Lines.Add(outline); + end; + end; + OutPutFrm.ShowModal; +end; + +procedure TItemBankFrm.MatchingItemsClick(Sender: TObject); +begin + MatchItemForm.ShowModal; +end; + +procedure TItemBankFrm.MCItemsClick(Sender: TObject); +begin + MCItemForm.ShowModal; +end; + +procedure TItemBankFrm.CreateCodesClick(Sender: TObject); +begin + CodesForm.ShowModal; +end; + +procedure TItemBankFrm.Button1Click(Sender: TObject); +begin + DirectoryEdit1.Text := OptionsFrm.FilePathEdit.Text; + FileListBox1.Directory := DirectoryEdit1.Text; +end; + +procedure TItemBankFrm.EssayItemsClick(Sender: TObject); +begin + EssayItemForm.ShowModal; +end; + +initialization + {$I itembankingunit.lrs} + +end. + diff --git a/applications/lazstats/source_orig/itemcodesunit.lfm b/applications/lazstats/source_orig/itemcodesunit.lfm new file mode 100644 index 000000000..7923173d0 --- /dev/null +++ b/applications/lazstats/source_orig/itemcodesunit.lfm @@ -0,0 +1,134 @@ +object CodesForm: TCodesForm + Left = 212 + Height = 286 + Top = 126 + Width = 709 + Caption = 'Code Creation Form' + ClientHeight = 286 + ClientWidth = 709 + OnShow = FormShow + LCLVersion = '0.9.30' + object Memo1: TMemo + Left = 24 + Height = 102 + Top = 4 + Width = 667 + Lines.Strings = ( + 'One of the first steps in creating an item bank is to develop a coding scheme for each item in the item bank of items. You' + 'can create up to 100 major and minor codes to describe each item in your bank. Typically, the first item major code is 1 and ' + 'the corresponding minor code is 0. You will typically have multiple minor coded items under each major code. For ' + 'example, a major code 1 and minor code 0 might be a major section in a statistics book such as Descriptive Analyses. Under' + 'the same major code you might have a minor code 1 to represent items such as the Mean or the Standard Deviation.' + 'On this form you will enter the major and minor codes and a description for each one.' + ) + TabOrder = 0 + end + object ItemNoLabel: TLabel + Left = 25 + Height = 16 + Top = 120 + Width = 79 + Caption = 'Code Number:' + ParentColor = False + end + object ItemNoEdit: TEdit + Left = 106 + Height = 23 + Top = 113 + Width = 37 + TabOrder = 1 + Text = '1' + end + object MajorLabel: TLabel + Left = 168 + Height = 16 + Top = 120 + Width = 66 + Caption = 'Major Code:' + ParentColor = False + end + object MajorEdit: TEdit + Left = 238 + Height = 23 + Top = 112 + Width = 35 + TabOrder = 2 + Text = '1' + end + object MinorLabel: TLabel + Left = 296 + Height = 16 + Top = 120 + Width = 67 + Caption = 'Minor Code:' + ParentColor = False + end + object MinorEdit: TEdit + Left = 368 + Height = 23 + Top = 114 + Width = 38 + TabOrder = 3 + Text = '0' + end + object DescLabel: TLabel + Left = 25 + Height = 16 + Top = 153 + Width = 112 + Caption = 'Category Description' + ParentColor = False + end + object DescriptionEdit: TEdit + Left = 144 + Height = 23 + Top = 147 + Width = 545 + TabOrder = 4 + end + object SaveCodeBtn: TButton + Left = 24 + Height = 33 + Top = 189 + Width = 137 + Caption = 'Save Info. for this code' + OnClick = SaveCodeBtnClick + TabOrder = 5 + end + object StartNewBtn: TButton + Left = 168 + Height = 32 + Top = 189 + Width = 146 + Caption = 'Start New Code' + OnClick = StartNewBtnClick + TabOrder = 6 + end + object DisplayBtn: TButton + Left = 329 + Height = 32 + Top = 240 + Width = 177 + Caption = 'Display All Saved Code Data' + OnClick = DisplayBtnClick + TabOrder = 7 + end + object ReturnBtn: TButton + Left = 592 + Height = 30 + Top = 240 + Width = 92 + Caption = 'Return' + OnClick = ReturnBtnClick + TabOrder = 8 + end + object EditOneBtn: TButton + Left = 329 + Height = 31 + Top = 190 + Width = 177 + Caption = 'Edit a Specific Code Entry' + OnClick = EditOneBtnClick + TabOrder = 9 + end +end diff --git a/applications/lazstats/source_orig/itemcodesunit.lrs b/applications/lazstats/source_orig/itemcodesunit.lrs new file mode 100644 index 000000000..fc8fe4055 --- /dev/null +++ b/applications/lazstats/source_orig/itemcodesunit.lrs @@ -0,0 +1,41 @@ +LazarusResources.Add('TCodesForm','FORMDATA',[ + 'TPF0'#10'TCodesForm'#9'CodesForm'#4'Left'#3#212#0#6'Height'#3#30#1#3'Top'#2 + +'~'#5'Width'#3#197#2#7'Caption'#6#18'Code Creation Form'#12'ClientHeight'#3 + +#30#1#11'ClientWidth'#3#197#2#6'OnShow'#7#8'FormShow'#10'LCLVersion'#6#6'0.9' + +'.30'#0#5'TMemo'#5'Memo1'#4'Left'#2#24#6'Height'#2'f'#3'Top'#2#4#5'Width'#3 + +#155#2#13'Lines.Strings'#1#6'{One of the first steps in creating an item ban' + +'k is to develop a coding scheme for each item in the item bank of items. Y' + +'ou'#6'~can create up to 100 major and minor codes to describe each item in ' + +'your bank. Typically, the first item major code is 1 and '#6'sthe correspo' + +'nding minor code is 0. You will typically have multiple minor coded items ' + +'under each major code. For '#6'{example, a major code 1 and minor code 0 m' + +'ight be a major section in a statistics book such as Descriptive Analyses. ' + +' Under'#6'pthe same major code you might have a minor code 1 to represent i' + +'tems such as the Mean or the Standard Deviation.'#6'VOn this form you will ' + +'enter the major and minor codes and a description for each one.'#0#8'TabOr' + +'der'#2#0#0#0#6'TLabel'#11'ItemNoLabel'#4'Left'#2#25#6'Height'#2#16#3'Top'#2 + +'x'#5'Width'#2'O'#7'Caption'#6#12'Code Number:'#11'ParentColor'#8#0#0#5'TEdi' + +'t'#10'ItemNoEdit'#4'Left'#2'j'#6'Height'#2#23#3'Top'#2'q'#5'Width'#2'%'#8'T' + +'abOrder'#2#1#4'Text'#6#1'1'#0#0#6'TLabel'#10'MajorLabel'#4'Left'#3#168#0#6 + +'Height'#2#16#3'Top'#2'x'#5'Width'#2'B'#7'Caption'#6#11'Major Code:'#11'Pare' + +'ntColor'#8#0#0#5'TEdit'#9'MajorEdit'#4'Left'#3#238#0#6'Height'#2#23#3'Top'#2 + +'p'#5'Width'#2'#'#8'TabOrder'#2#2#4'Text'#6#1'1'#0#0#6'TLabel'#10'MinorLabel' + +#4'Left'#3'('#1#6'Height'#2#16#3'Top'#2'x'#5'Width'#2'C'#7'Caption'#6#11'Min' + +'or Code:'#11'ParentColor'#8#0#0#5'TEdit'#9'MinorEdit'#4'Left'#3'p'#1#6'Heig' + +'ht'#2#23#3'Top'#2'r'#5'Width'#2'&'#8'TabOrder'#2#3#4'Text'#6#1'0'#0#0#6'TLa' + +'bel'#9'DescLabel'#4'Left'#2#25#6'Height'#2#16#3'Top'#3#153#0#5'Width'#2'p'#7 + +'Caption'#6#20'Category Description'#11'ParentColor'#8#0#0#5'TEdit'#15'Descr' + +'iptionEdit'#4'Left'#3#144#0#6'Height'#2#23#3'Top'#3#147#0#5'Width'#3'!'#2#8 + +'TabOrder'#2#4#0#0#7'TButton'#11'SaveCodeBtn'#4'Left'#2#24#6'Height'#2'!'#3 + +'Top'#3#189#0#5'Width'#3#137#0#7'Caption'#6#24'Save Info. for this code'#7'O' + +'nClick'#7#16'SaveCodeBtnClick'#8'TabOrder'#2#5#0#0#7'TButton'#11'StartNewBt' + +'n'#4'Left'#3#168#0#6'Height'#2' '#3'Top'#3#189#0#5'Width'#3#146#0#7'Caption' + +#6#14'Start New Code'#7'OnClick'#7#16'StartNewBtnClick'#8'TabOrder'#2#6#0#0#7 + +'TButton'#10'DisplayBtn'#4'Left'#3'I'#1#6'Height'#2' '#3'Top'#3#240#0#5'Widt' + +'h'#3#177#0#7'Caption'#6#27'Display All Saved Code Data'#7'OnClick'#7#15'Dis' + +'playBtnClick'#8'TabOrder'#2#7#0#0#7'TButton'#9'ReturnBtn'#4'Left'#3'P'#2#6 + +'Height'#2#30#3'Top'#3#240#0#5'Width'#2'\'#7'Caption'#6#6'Return'#7'OnClick' + +#7#14'ReturnBtnClick'#8'TabOrder'#2#8#0#0#7'TButton'#10'EditOneBtn'#4'Left'#3 + +'I'#1#6'Height'#2#31#3'Top'#3#190#0#5'Width'#3#177#0#7'Caption'#6#26'Edit a ' + +'Specific Code Entry'#7'OnClick'#7#15'EditOneBtnClick'#8'TabOrder'#2#9#0#0#0 +]); diff --git a/applications/lazstats/source_orig/itemcodesunit.pas b/applications/lazstats/source_orig/itemcodesunit.pas new file mode 100644 index 000000000..a0f2fd3db --- /dev/null +++ b/applications/lazstats/source_orig/itemcodesunit.pas @@ -0,0 +1,152 @@ +unit ItemCodesUnit; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, + StdCtrls, outputunit; + +type + + { TCodesForm } + + TCodesForm = class(TForm) + EditOneBtn: TButton; + ReturnBtn: TButton; + DisplayBtn: TButton; + StartNewBtn: TButton; + SaveCodeBtn: TButton; + DescLabel: TLabel; + DescriptionEdit: TEdit; + MinorEdit: TEdit; + MinorLabel: TLabel; + MajorEdit: TEdit; + ItemNoEdit: TEdit; + ItemNoLabel: TLabel; + MajorLabel: TLabel; + Memo1: TMemo; + procedure EditOneBtnClick(Sender: TObject); + procedure DisplayBtnClick(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure ReturnBtnClick(Sender: TObject); + procedure SaveCodeBtnClick(Sender: TObject); + procedure StartNewBtnClick(Sender: TObject); + private + { private declarations } + public + { public declarations } + end; + +var + CodesForm: TCodesForm; + +implementation +uses ItemBankingUnit; +{ TCodesForm } + +procedure TCodesForm.SaveCodeBtnClick(Sender: TObject); +var + currentno : integer; +begin + currentno := StrToInt(ItemNoEdit.Text); + if currentno > ItemBankFrm.BankInfo.NCodes then + ItemBankFrm.BankInfo.NCodes := currentno; + ItemBankFrm.NItemCodesText.Text := IntToStr(currentno); + ItemBankFrm.CodesInfo[currentno].codenumber := currentno; + ItemBankFrm.CodesInfo[currentno].majorcodes := StrToInt(MajorEdit.Text); + ItemBankFrm.CodesInfo[currentno].minorcodes := StrToInt(MinorEdit.Text); + ItemBankFrm.CodesInfo[currentno].Description := DescriptionEdit.Text; +end; + +procedure TCodesForm.DisplayBtnClick(Sender: TObject); +var + currentno : integer; + i : integer; + outline : string; +begin + currentno := ItemBankFrm.BankInfo.NCodes; + OutPutFrm.RichEdit.Lines.Add('Current Item Codes'); + OutPutFrm.RichEdit.Lines.Add(''); + + for i := 1 to currentno do + begin + outline := format('Item number %3d',[ItemBankFrm.CodesInfo[i].codenumber]); + OutPutFrm.RichEdit.Lines.Add(outline); + outline := format('Major Code %3d',[ItemBankFrm.CodesInfo[i].majorcodes]); + OutPutFrm.RichEdit.Lines.Add(outline); + outline := format('Minor Code %3d',[ItemBankFrm.CodesInfo[i].minorcodes]); + OutPutFrm.RichEdit.Lines.Add(outline); + outline := format('Description %s',[ItemBankFrm.CodesInfo[i].Description]); + OutPutFrm.RichEdit.Lines.Add(outline); + OutPutFrm.RichEdit.Lines.Add(''); + end; + OutPutFrm.ShowModal; +end; + +procedure TCodesForm.EditOneBtnClick(Sender: TObject); +Var + response : string; + codeno : integer; +begin + response := InputBox('Code Number:','Number:','1'); + codeno := StrToInt(response); + if codeno <= ItemBankFrm.BankInfo.NCodes then + begin + ItemNoEdit.Text := IntToStr(ItemBankFrm.CodesInfo[codeno].codenumber); + MajorEdit.Text := IntToStr(ItemBankFrm.CodesInfo[codeno].majorcodes); + MinorEdit.Text := IntToStr(ItemBankFrm.CodesInfo[codeno].minorcodes); + DescriptionEdit.Text := ItemBankFrm.CodesInfo[codeno].Description; + end; +end; + +procedure TCodesForm.FormShow(Sender: TObject); +Var ncodes : integer; +begin + if ItemBankFrm.NItemCodesText.Text <> '' then + begin + ncodes := StrToInt(ItemBankFrm.NItemCodesText.Text); + ItemNoEdit.Text := IntToStr(ItemBankFrm.CodesInfo[ncodes].codenumber); + MajorEdit.Text := IntToStr(ItemBankFrm.CodesInfo[ncodes].majorcodes) ; + MinorEdit.Text := IntToStr(ItemBankFrm.CodesInfo[ncodes].minorcodes); + DescriptionEdit.Text := ItemBankFrm.CodesInfo[ncodes].Description; + end else + begin + ItemNoEdit.Text := '1'; + MajorEdit.Text := '1'; + MinorEdit.Text := '0'; + DescriptionEdit.Text := ''; + end; +end; + +procedure TCodesForm.ReturnBtnClick(Sender: TObject); +begin + CodesForm.Hide; + Close; +end; + +procedure TCodesForm.StartNewBtnClick(Sender: TObject); +var + currentno : integer; + newnumber : integer; +begin + currentno := StrToInt(ItemNoEdit.Text); + newnumber := currentno + 1; + ItemNoEdit.Text := IntToStr(newnumber); + currentno := StrToInt(MinorEdit.Text); + newnumber := currentno + 1; + MinorEdit.Text := IntToStr(newnumber); + DescriptionEdit.Text := ''; + if newnumber > StrToInt(ItemBankFrm.NItemCodesText.Text) then + begin + ItemBankFrm.NItemCodesText.Text := IntToStr(newnumber); + ItemBankFrm.CodesInfo[newnumber].codenumber := newnumber; + end; +end; + +initialization + {$I itemcodesunit.lrs} + +end. + diff --git a/applications/lazstats/source_orig/jpegunit.lfm b/applications/lazstats/source_orig/jpegunit.lfm new file mode 100644 index 000000000..7542e8ae0 --- /dev/null +++ b/applications/lazstats/source_orig/jpegunit.lfm @@ -0,0 +1,66 @@ +object JPEGform: TJPEGform + Left = 139 + Height = 689 + Top = 45 + Width = 737 + Caption = 'JPEG Viewer' + ClientHeight = 689 + ClientWidth = 737 + LCLVersion = '0.9.30' + object Image1: TImage + Left = 9 + Height = 607 + Top = 9 + Width = 714 + Proportional = True + end + object LoadBtn: TButton + Left = 16 + Height = 27 + Top = 639 + Width = 107 + Caption = 'Load Image' + OnClick = LoadBtnClick + TabOrder = 0 + end + object ReturnBtn: TButton + Left = 624 + Height = 26 + Top = 639 + Width = 91 + Caption = 'Return' + ModalResult = 1 + TabOrder = 1 + end + object StretchBtn: TButton + Left = 169 + Height = 24 + Top = 641 + Width = 87 + Caption = 'Stretch' + OnClick = StretchBtnClick + TabOrder = 2 + end + object NormalBtn: TButton + Left = 312 + Height = 24 + Top = 642 + Width = 87 + Caption = 'Normal' + OnClick = NormalBtnClick + TabOrder = 3 + end + object PropBtn: TButton + Left = 457 + Height = 24 + Top = 641 + Width = 112 + Caption = 'Show Proportional' + OnClick = PropBtnClick + TabOrder = 4 + end + object OpenPictureDialog1: TOpenPictureDialog + left = 108 + top = 77 + end +end diff --git a/applications/lazstats/source_orig/jpegunit.lrs b/applications/lazstats/source_orig/jpegunit.lrs new file mode 100644 index 000000000..38dcf0005 --- /dev/null +++ b/applications/lazstats/source_orig/jpegunit.lrs @@ -0,0 +1,20 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('TJPEGform','FORMDATA',[ + 'TPF0'#9'TJPEGform'#8'JPEGform'#4'Left'#3#139#0#6'Height'#3#177#2#3'Top'#2'-' + +#5'Width'#3#225#2#7'Caption'#6#11'JPEG Viewer'#12'ClientHeight'#3#177#2#11'C' + +'lientWidth'#3#225#2#10'LCLVersion'#6#6'0.9.30'#0#6'TImage'#6'Image1'#4'Left' + +#2#9#6'Height'#3'_'#2#3'Top'#2#9#5'Width'#3#202#2#12'Proportional'#9#0#0#7'T' + +'Button'#7'LoadBtn'#4'Left'#2#16#6'Height'#2#27#3'Top'#3#127#2#5'Width'#2'k' + +#7'Caption'#6#10'Load Image'#7'OnClick'#7#12'LoadBtnClick'#8'TabOrder'#2#0#0 + +#0#7'TButton'#9'ReturnBtn'#4'Left'#3'p'#2#6'Height'#2#26#3'Top'#3#127#2#5'Wi' + +'dth'#2'['#7'Caption'#6#6'Return'#11'ModalResult'#2#1#8'TabOrder'#2#1#0#0#7 + +'TButton'#10'StretchBtn'#4'Left'#3#169#0#6'Height'#2#24#3'Top'#3#129#2#5'Wid' + +'th'#2'W'#7'Caption'#6#7'Stretch'#7'OnClick'#7#15'StretchBtnClick'#8'TabOrde' + +'r'#2#2#0#0#7'TButton'#9'NormalBtn'#4'Left'#3'8'#1#6'Height'#2#24#3'Top'#3 + +#130#2#5'Width'#2'W'#7'Caption'#6#6'Normal'#7'OnClick'#7#14'NormalBtnClick'#8 + +'TabOrder'#2#3#0#0#7'TButton'#7'PropBtn'#4'Left'#3#201#1#6'Height'#2#24#3'To' + +'p'#3#129#2#5'Width'#2'p'#7'Caption'#6#17'Show Proportional'#7'OnClick'#7#12 + +'PropBtnClick'#8'TabOrder'#2#4#0#0#18'TOpenPictureDialog'#18'OpenPictureDial' + +'og1'#4'left'#2'l'#3'top'#2'M'#0#0#0 +]); diff --git a/applications/lazstats/source_orig/jpegunit.pas b/applications/lazstats/source_orig/jpegunit.pas new file mode 100644 index 000000000..b66cc07cc --- /dev/null +++ b/applications/lazstats/source_orig/jpegunit.pas @@ -0,0 +1,83 @@ +unit JPEGUnit; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, + ExtCtrls, StdCtrls, ExtDlgs; + +type + + { TJPEGform } + + TJPEGform = class(TForm) + PropBtn: TButton; + StretchBtn: TButton; + NormalBtn: TButton; + OpenPictureDialog1: TOpenPictureDialog; + ReturnBtn: TButton; + LoadBtn: TButton; + Image1: TImage; + procedure LoadBtnClick(Sender: TObject); + procedure NormalBtnClick(Sender: TObject); + procedure PropBtnClick(Sender: TObject); + procedure StretchBtnClick(Sender: TObject); + private + { private declarations } + public + { public declarations } + end; + +var + JPEGform: TJPEGform; + +implementation + +{ TJPEGform } + +procedure TJPEGform.LoadBtnClick(Sender: TObject); +VAR + JPEG : TJPEGImage; +begin + OpenPictureDialog1.Options := OpenPictureDialog1.Options+[ofFileMustExist]; + if not OpenPictureDialog1.Execute then exit; + try + JPEG := TJPEGImage.Create; + try + JPEG.LoadFromFile(OpenPictureDialog1.FileName); + Image1.Picture.Assign(JPEG); + finally + JPEG.Free; + end; + JPEGForm.Caption := OpenPictureDialog1.FileName; + except + on E: Exception do begin + MessageDlg('Error','Error: '+E.Message,mtError,[mbOk],0); + end; + end; +end; + +procedure TJPEGform.NormalBtnClick(Sender: TObject); +begin + Image1.Proportional := false; + Image1.Stretch := false; +end; + +procedure TJPEGform.PropBtnClick(Sender: TObject); +begin + Image1.Proportional := true; +end; + +procedure TJPEGform.StretchBtnClick(Sender: TObject); +begin + Image1.Proportional := false; + Image1.Stretch := true; +end; + +initialization + {$I jpegunit.lrs} + +end. + diff --git a/applications/lazstats/source_orig/kaplanmeierunit.lfm b/applications/lazstats/source_orig/kaplanmeierunit.lfm new file mode 100644 index 000000000..61b3d4ab7 --- /dev/null +++ b/applications/lazstats/source_orig/kaplanmeierunit.lfm @@ -0,0 +1,433 @@ +object KaplanMeierFrm: TKaplanMeierFrm + Left = 306 + Height = 366 + Top = 147 + Width = 493 + Caption = 'Kaplan-Meier Survival Analysis' + ClientHeight = 366 + ClientWidth = 493 + OnShow = FormShow + LCLVersion = '0.9.28.2' + object Label1: TLabel + Left = 8 + Height = 14 + Top = 7 + Width = 90 + Caption = 'Available Variables' + ParentColor = False + end + object Label2: TLabel + Left = 217 + Height = 14 + Top = 24 + Width = 64 + Caption = 'Time Variable' + ParentColor = False + end + object Label3: TLabel + Left = 216 + Height = 14 + Top = 112 + Width = 133 + Caption = 'Event vs Censored Variable' + ParentColor = False + end + object Label4: TLabel + Left = 217 + Height = 14 + Top = 128 + Width = 122 + Caption = 'Event = 1, Censored = 2' + ParentColor = False + end + object Label5: TLabel + Left = 224 + Height = 14 + Top = 202 + Width = 133 + Caption = 'Group Variable (if 2 groups)' + ParentColor = False + end + object Label6: TLabel + Left = 217 + Height = 14 + Top = 220 + Width = 153 + Caption = '(Experimental = 1, Control = 2)' + ParentColor = False + end + object VarList: TListBox + Left = 6 + Height = 332 + Top = 23 + Width = 163 + ItemHeight = 0 + TabOrder = 0 + end + object TimeInBtn: TBitBtn + Left = 176 + Height = 27 + Top = 23 + Width = 32 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00216324B81D5E2006FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF002A702F38256929F7216324D9FFFFFF00FFFFFF00FFFFFF00FFFFFF0061BE + 6DFF5DB868FF58B162FF53A95CFF4DA156FF47994FFF419149FF3B8842FF3580 + 3BFF3F8845FF59A15EFF448B49FF216324CFFFFFFF00FFFFFF00FFFFFF0065C3 + 71FFA0D7A9FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF458C4AFF216324C4FFFFFF00FFFFFF0068C7 + 74FFA5DAAEFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF4A9150FF256929C9FFFFFF00FFFFFF0068C7 + 74FF68C774FF65C371FF61BE6DFF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF5AA362FF559D5CFF2F7835D1FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00419149F73B8842DBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0047994FBB41914906FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + NumGlyphs = 0 + OnClick = TimeInBtnClick + TabOrder = 1 + end + object TimeOutBtn: TBitBtn + Left = 177 + Height = 27 + Top = 56 + Width = 32 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF004DA1560647994FB8FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0053A95CD94DA156F747994F38FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF005DB868CF71BE7BFF7AC183FF5BAA64FF47994FFF419149FF3B8842FF3580 + 3BFF2F7835FF2A702FFF256929FF216324FF1D5E20FFFFFFFF00FFFFFF0065C3 + 71C47BC886FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF72BD78FF216324FFFFFFFF00FFFFFF0068C7 + 74C97FCC8AFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF78C07EFF256929FFFFFFFF00FFFFFF00FFFF + FF0068C774D180CD8BFF7CC987FF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF3B8842FF35803BFF2F7835FF2A702FFFFFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C774DB65C371F7FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C7740668C774BBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + NumGlyphs = 0 + OnClick = TimeOutBtnClick + TabOrder = 2 + end + object EventInBtn: TBitBtn + Left = 177 + Height = 27 + Top = 112 + Width = 32 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00216324B81D5E2006FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF002A702F38256929F7216324D9FFFFFF00FFFFFF00FFFFFF00FFFFFF0061BE + 6DFF5DB868FF58B162FF53A95CFF4DA156FF47994FFF419149FF3B8842FF3580 + 3BFF3F8845FF59A15EFF448B49FF216324CFFFFFFF00FFFFFF00FFFFFF0065C3 + 71FFA0D7A9FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF458C4AFF216324C4FFFFFF00FFFFFF0068C7 + 74FFA5DAAEFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF4A9150FF256929C9FFFFFF00FFFFFF0068C7 + 74FF68C774FF65C371FF61BE6DFF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF5AA362FF559D5CFF2F7835D1FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00419149F73B8842DBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0047994FBB41914906FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + NumGlyphs = 0 + OnClick = EventInBtnClick + TabOrder = 3 + end + object EventOutBtn: TBitBtn + Left = 177 + Height = 27 + Top = 144 + Width = 32 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF004DA1560647994FB8FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0053A95CD94DA156F747994F38FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF005DB868CF71BE7BFF7AC183FF5BAA64FF47994FFF419149FF3B8842FF3580 + 3BFF2F7835FF2A702FFF256929FF216324FF1D5E20FFFFFFFF00FFFFFF0065C3 + 71C47BC886FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF72BD78FF216324FFFFFFFF00FFFFFF0068C7 + 74C97FCC8AFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF78C07EFF256929FFFFFFFF00FFFFFF00FFFF + FF0068C774D180CD8BFF7CC987FF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF3B8842FF35803BFF2F7835FF2A702FFFFFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C774DB65C371F7FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C7740668C774BBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + NumGlyphs = 0 + OnClick = EventOutBtnClick + TabOrder = 4 + end + object GroupInBtn: TBitBtn + Left = 177 + Height = 27 + Top = 200 + Width = 32 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00216324B81D5E2006FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF002A702F38256929F7216324D9FFFFFF00FFFFFF00FFFFFF00FFFFFF0061BE + 6DFF5DB868FF58B162FF53A95CFF4DA156FF47994FFF419149FF3B8842FF3580 + 3BFF3F8845FF59A15EFF448B49FF216324CFFFFFFF00FFFFFF00FFFFFF0065C3 + 71FFA0D7A9FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF458C4AFF216324C4FFFFFF00FFFFFF0068C7 + 74FFA5DAAEFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF4A9150FF256929C9FFFFFF00FFFFFF0068C7 + 74FF68C774FF65C371FF61BE6DFF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF5AA362FF559D5CFF2F7835D1FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00419149F73B8842DBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0047994FBB41914906FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + NumGlyphs = 0 + OnClick = GroupInBtnClick + TabOrder = 5 + end + object GroupOutBtn: TBitBtn + Left = 177 + Height = 27 + Top = 232 + Width = 32 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF004DA1560647994FB8FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0053A95CD94DA156F747994F38FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF005DB868CF71BE7BFF7AC183FF5BAA64FF47994FFF419149FF3B8842FF3580 + 3BFF2F7835FF2A702FFF256929FF216324FF1D5E20FFFFFFFF00FFFFFF0065C3 + 71C47BC886FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF72BD78FF216324FFFFFFFF00FFFFFF0068C7 + 74C97FCC8AFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF78C07EFF256929FFFFFFFF00FFFFFF00FFFF + FF0068C774D180CD8BFF7CC987FF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF3B8842FF35803BFF2F7835FF2A702FFFFFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C774DB65C371F7FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C7740668C774BBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + NumGlyphs = 0 + OnClick = GroupOutBtnClick + TabOrder = 6 + end + object TimeEdit: TEdit + Left = 216 + Height = 21 + Top = 41 + Width = 143 + TabOrder = 7 + Text = 'TimeEdit' + end + object EventEdit: TEdit + Left = 217 + Height = 21 + Top = 144 + Width = 143 + TabOrder = 8 + Text = 'TimeEdit' + end + object GroupEdit: TEdit + Left = 217 + Height = 21 + Top = 238 + Width = 143 + TabOrder = 9 + Text = 'TimeEdit' + end + object GroupBox1: TGroupBox + Left = 175 + Height = 83 + Top = 273 + Width = 185 + Caption = 'Options:' + ClientHeight = 65 + ClientWidth = 181 + TabOrder = 10 + object PlotChk: TCheckBox + Left = 7 + Height = 17 + Top = 6 + Width = 172 + Caption = 'Graph Survival Probabilities (%)' + TabOrder = 0 + end + object PrintChk: TCheckBox + Left = 7 + Height = 17 + Top = 34 + Width = 144 + Caption = 'Print Computation Results' + TabOrder = 1 + end + end + object ResetBtn: TButton + Left = 392 + Height = 32 + Top = 72 + Width = 83 + Caption = 'Reset' + OnClick = ResetBtnClick + TabOrder = 11 + end + object CancelBtn: TButton + Left = 392 + Height = 32 + Top = 128 + Width = 83 + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 12 + end + object ComputeBtn: TButton + Left = 392 + Height = 32 + Top = 184 + Width = 83 + Caption = 'Compute' + OnClick = ComputeBtnClick + TabOrder = 13 + end + object ReturnBtn: TButton + Left = 392 + Height = 32 + Top = 240 + Width = 83 + Caption = 'Return' + ModalResult = 1 + TabOrder = 14 + end + object HelpBtn: TButton + Tag = 127 + Left = 392 + Height = 33 + Top = 16 + Width = 86 + Caption = 'Help' + OnClick = HelpBtnClick + TabOrder = 15 + end +end diff --git a/applications/lazstats/source_orig/kaplanmeierunit.lrs b/applications/lazstats/source_orig/kaplanmeierunit.lrs new file mode 100644 index 000000000..5351e5582 --- /dev/null +++ b/applications/lazstats/source_orig/kaplanmeierunit.lrs @@ -0,0 +1,352 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('TKaplanMeierFrm','FORMDATA',[ + 'TPF0'#15'TKaplanMeierFrm'#14'KaplanMeierFrm'#4'Left'#3'2'#1#6'Height'#3'n'#1 + +#3'Top'#3#147#0#5'Width'#3#237#1#7'Caption'#6#30'Kaplan-Meier Survival Analy' + +'sis'#12'ClientHeight'#3'n'#1#11'ClientWidth'#3#237#1#6'OnShow'#7#8'FormShow' + +#10'LCLVersion'#6#8'0.9.28.2'#0#6'TLabel'#6'Label1'#4'Left'#2#8#6'Height'#2 + +#14#3'Top'#2#7#5'Width'#2'Z'#7'Caption'#6#19'Available Variables'#11'ParentC' + +'olor'#8#0#0#6'TLabel'#6'Label2'#4'Left'#3#217#0#6'Height'#2#14#3'Top'#2#24#5 + +'Width'#2'@'#7'Caption'#6#13'Time Variable'#11'ParentColor'#8#0#0#6'TLabel'#6 + +'Label3'#4'Left'#3#216#0#6'Height'#2#14#3'Top'#2'p'#5'Width'#3#133#0#7'Capti' + +'on'#6#26'Event vs Censored Variable'#11'ParentColor'#8#0#0#6'TLabel'#6'Labe' + +'l4'#4'Left'#3#217#0#6'Height'#2#14#3'Top'#3#128#0#5'Width'#2'z'#7'Caption'#6 + +#23'Event = 1, Censored = 2'#11'ParentColor'#8#0#0#6'TLabel'#6'Label5'#4'Lef' + +'t'#3#224#0#6'Height'#2#14#3'Top'#3#202#0#5'Width'#3#133#0#7'Caption'#6#28'G' + +'roup Variable (if 2 groups)'#11'ParentColor'#8#0#0#6'TLabel'#6'Label6'#4'Le' + +'ft'#3#217#0#6'Height'#2#14#3'Top'#3#220#0#5'Width'#3#153#0#7'Caption'#6#31 + +'(Experimental = 1, Control = 2)'#11'ParentColor'#8#0#0#8'TListBox'#7'VarLis' + +'t'#4'Left'#2#6#6'Height'#3'L'#1#3'Top'#2#23#5'Width'#3#163#0#10'ItemHeight' + +#2#0#8'TabOrder'#2#0#0#0#7'TBitBtn'#9'TimeInBtn'#4'Left'#3#176#0#6'Height'#2 + +#27#3'Top'#2#23#5'Width'#2' '#10'Glyph.Data'#10':'#4#0#0'6'#4#0#0'BM6'#4#0#0 + +#0#0#0#0'6'#0#0#0'('#0#0#0#16#0#0#0#16#0#0#0#1#0' '#0#0#0#0#0#0#4#0#0'd'#0#0 + +#0'd'#0#0#0#0#0#0#0#0#0#0#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0'!c$'#184#29'^ '#6#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0'*p/8%i)'#247'!c$'#217#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0'a'#190'm'#255']'#184'h'#255'X'#177'b'#255'S'#169'\'#255'M'#161'V' + +#255'G'#153'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';'#255'?'#136'E'#255'Y' + +#161'^'#255'D'#139'I'#255'!c$'#207#255#255#255#0#255#255#255#0#255#255#255#0 + +'e'#195'q'#255#160#215#169#255#156#213#165#255#152#211#161#255#148#208#157 + +#255#144#206#152#255#139#203#147#255#135#201#142#255#130#198#137#255'~'#195 + +#132#255'z'#193#128#255'v'#190'|'#255'E'#140'J'#255'!c$'#196#255#255#255#0 + +#255#255#255#0'h'#199't'#255#165#218#174#255#162#216#171#255#158#214#167#255 + +#154#212#163#255#150#210#159#255#147#207#154#255#142#204#149#255#137#202#144 + +#255#133#199#139#255#129#197#135#255'}'#194#130#255'J'#145'P'#255'%i)'#201 + +#255#255#255#0#255#255#255#0'h'#199't'#255'h'#199't'#255'e'#195'q'#255'a'#190 + +'m'#255']'#184'h'#255'X'#177'b'#255'S'#169'\'#255'M'#161'V'#255'G'#153'O'#255 + +'A'#145'I'#255'Z'#163'b'#255'U'#157'\'#255'/x5'#209#255#255#255#0#255#255#255 + +#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0'A'#145'I'#247';'#136'B'#219#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0'G'#153'O'#187'A'#145'I'#6#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + ,#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#9'NumGlyphs'#2#0#7'OnClick'#7#14'TimeInBtnClick'#8'TabOrder'#2#1#0#0#7'TBit' + +'Btn'#10'TimeOutBtn'#4'Left'#3#177#0#6'Height'#2#27#3'Top'#2'8'#5'Width'#2' ' + +#10'Glyph.Data'#10':'#4#0#0'6'#4#0#0'BM6'#4#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#16 + +#0#0#0#16#0#0#0#1#0' '#0#0#0#0#0#0#4#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0'M'#161'V'#6'G'#153'O'#184#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0'S'#169'\'#217'M'#161'V'#247'G'#153'O8' + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0']'#184'h'#207'q'#190'{'#255'z'#193#131#255'['#170'd'#255 + +'G'#153'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';'#255'/x5'#255'*p/'#255'%' + +'i)'#255'!c$'#255#29'^ '#255#255#255#255#0#255#255#255#0'e'#195'q'#196'{'#200 + +#134#255#156#213#165#255#152#211#161#255#148#208#157#255#144#206#152#255#139 + +#203#147#255#135#201#142#255#130#198#137#255'~'#195#132#255'z'#193#128#255'v' + +#190'|'#255'r'#189'x'#255'!c$'#255#255#255#255#0#255#255#255#0'h'#199't'#201 + +#127#204#138#255#162#216#171#255#158#214#167#255#154#212#163#255#150#210#159 + +#255#147#207#154#255#142#204#149#255#137#202#144#255#133#199#139#255#129#197 + +#135#255'}'#194#130#255'x'#192'~'#255'%i)'#255#255#255#255#0#255#255#255#0 + +#255#255#255#0'h'#199't'#209#128#205#139#255'|'#201#135#255']'#184'h'#255'X' + +#177'b'#255'S'#169'\'#255'M'#161'V'#255'G'#153'O'#255'A'#145'I'#255';'#136'B' + +#255'5'#128';'#255'/x5'#255'*p/'#255#255#255#255#0#255#255#255#0#255#255#255 + +#0#255#255#255#0'h'#199't'#219'e'#195'q'#247#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0'h'#199't'#6'h'#199't'#187#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#9'NumGlyphs'#2#0#7'OnClick'#7#15 + +'TimeOutBtnClick'#8'TabOrder'#2#2#0#0#7'TBitBtn'#10'EventInBtn'#4'Left'#3#177 + +#0#6'Height'#2#27#3'Top'#2'p'#5'Width'#2' '#10'Glyph.Data'#10':'#4#0#0'6'#4#0 + +#0'BM6'#4#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#16#0#0#0#16#0#0#0#1#0' '#0#0#0#0#0#0 + +#4#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + ,#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0'!c$'#184#29'^ '#6#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0'*p/8%i)'#247'!c$'#217#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0'a'#190'm'#255']'#184'h'#255'X'#177'b'#255'S'#169'\' + +#255'M'#161'V'#255'G'#153'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';'#255'?' + +#136'E'#255'Y'#161'^'#255'D'#139'I'#255'!c$'#207#255#255#255#0#255#255#255#0 + +#255#255#255#0'e'#195'q'#255#160#215#169#255#156#213#165#255#152#211#161#255 + +#148#208#157#255#144#206#152#255#139#203#147#255#135#201#142#255#130#198#137 + +#255'~'#195#132#255'z'#193#128#255'v'#190'|'#255'E'#140'J'#255'!c$'#196#255 + +#255#255#0#255#255#255#0'h'#199't'#255#165#218#174#255#162#216#171#255#158 + +#214#167#255#154#212#163#255#150#210#159#255#147#207#154#255#142#204#149#255 + +#137#202#144#255#133#199#139#255#129#197#135#255'}'#194#130#255'J'#145'P'#255 + +'%i)'#201#255#255#255#0#255#255#255#0'h'#199't'#255'h'#199't'#255'e'#195'q' + +#255'a'#190'm'#255']'#184'h'#255'X'#177'b'#255'S'#169'\'#255'M'#161'V'#255'G' + +#153'O'#255'A'#145'I'#255'Z'#163'b'#255'U'#157'\'#255'/x5'#209#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0'A'#145'I'#247';'#136'B'#219#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0'G'#153'O'#187'A'#145'I'#6#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#9'NumGlyphs'#2#0#7'OnClick'#7#15'EventInBtnClick'#8'TabOrder' + +#2#3#0#0#7'TBitBtn'#11'EventOutBtn'#4'Left'#3#177#0#6'Height'#2#27#3'Top'#3 + +#144#0#5'Width'#2' '#10'Glyph.Data'#10':'#4#0#0'6'#4#0#0'BM6'#4#0#0#0#0#0#0 + +'6'#0#0#0'('#0#0#0#16#0#0#0#16#0#0#0#1#0' '#0#0#0#0#0#0#4#0#0'd'#0#0#0'd'#0#0 + +#0#0#0#0#0#0#0#0#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'M'#161'V'#6'G' + +#153'O'#184#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'S'#169'\'#217'M'#161 + +'V'#247'G'#153'O8'#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + ,#255#255#0#255#255#255#0#255#255#255#0']'#184'h'#207'q'#190'{'#255'z'#193#131 + +#255'['#170'd'#255'G'#153'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';'#255'/' + +'x5'#255'*p/'#255'%i)'#255'!c$'#255#29'^ '#255#255#255#255#0#255#255#255#0'e' + +#195'q'#196'{'#200#134#255#156#213#165#255#152#211#161#255#148#208#157#255 + +#144#206#152#255#139#203#147#255#135#201#142#255#130#198#137#255'~'#195#132 + +#255'z'#193#128#255'v'#190'|'#255'r'#189'x'#255'!c$'#255#255#255#255#0#255 + +#255#255#0'h'#199't'#201#127#204#138#255#162#216#171#255#158#214#167#255#154 + +#212#163#255#150#210#159#255#147#207#154#255#142#204#149#255#137#202#144#255 + +#133#199#139#255#129#197#135#255'}'#194#130#255'x'#192'~'#255'%i)'#255#255 + +#255#255#0#255#255#255#0#255#255#255#0'h'#199't'#209#128#205#139#255'|'#201 + +#135#255']'#184'h'#255'X'#177'b'#255'S'#169'\'#255'M'#161'V'#255'G'#153'O' + +#255'A'#145'I'#255';'#136'B'#255'5'#128';'#255'/x5'#255'*p/'#255#255#255#255 + +#0#255#255#255#0#255#255#255#0#255#255#255#0'h'#199't'#219'e'#195'q'#247#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0'h'#199't'#6'h'#199't'#187#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#9'Num' + +'Glyphs'#2#0#7'OnClick'#7#16'EventOutBtnClick'#8'TabOrder'#2#4#0#0#7'TBitBtn' + +#10'GroupInBtn'#4'Left'#3#177#0#6'Height'#2#27#3'Top'#3#200#0#5'Width'#2' ' + +#10'Glyph.Data'#10':'#4#0#0'6'#4#0#0'BM6'#4#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#16 + +#0#0#0#16#0#0#0#1#0' '#0#0#0#0#0#0#4#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0'!c$'#184#29'^ '#6#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'*p/8%i)'#247'!c$' + +#217#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'a'#190'm'#255']' + +#184'h'#255'X'#177'b'#255'S'#169'\'#255'M'#161'V'#255'G'#153'O'#255'A'#145'I' + +#255';'#136'B'#255'5'#128';'#255'?'#136'E'#255'Y'#161'^'#255'D'#139'I'#255'!' + +'c$'#207#255#255#255#0#255#255#255#0#255#255#255#0'e'#195'q'#255#160#215#169 + +#255#156#213#165#255#152#211#161#255#148#208#157#255#144#206#152#255#139#203 + +#147#255#135#201#142#255#130#198#137#255'~'#195#132#255'z'#193#128#255'v'#190 + +'|'#255'E'#140'J'#255'!c$'#196#255#255#255#0#255#255#255#0'h'#199't'#255#165 + +#218#174#255#162#216#171#255#158#214#167#255#154#212#163#255#150#210#159#255 + +#147#207#154#255#142#204#149#255#137#202#144#255#133#199#139#255#129#197#135 + +#255'}'#194#130#255'J'#145'P'#255'%i)'#201#255#255#255#0#255#255#255#0'h'#199 + +'t'#255'h'#199't'#255'e'#195'q'#255'a'#190'm'#255']'#184'h'#255'X'#177'b'#255 + +'S'#169'\'#255'M'#161'V'#255'G'#153'O'#255'A'#145'I'#255'Z'#163'b'#255'U'#157 + +'\'#255'/x5'#209#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + ,#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0'A'#145'I'#247';'#136'B'#219 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0'G'#153'O'#187'A'#145'I'#6 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#9'NumGlyphs'#2#0#7'OnClick'#7#15 + +'GroupInBtnClick'#8'TabOrder'#2#5#0#0#7'TBitBtn'#11'GroupOutBtn'#4'Left'#3 + +#177#0#6'Height'#2#27#3'Top'#3#232#0#5'Width'#2' '#10'Glyph.Data'#10':'#4#0#0 + +'6'#4#0#0'BM6'#4#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#16#0#0#0#16#0#0#0#1#0' '#0#0#0 + +#0#0#0#4#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0'M'#161'V'#6'G'#153'O'#184#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0'S'#169'\'#217'M'#161'V'#247'G'#153'O8'#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0']'#184'h' + +#207'q'#190'{'#255'z'#193#131#255'['#170'd'#255'G'#153'O'#255'A'#145'I'#255 + +';'#136'B'#255'5'#128';'#255'/x5'#255'*p/'#255'%i)'#255'!c$'#255#29'^ '#255 + +#255#255#255#0#255#255#255#0'e'#195'q'#196'{'#200#134#255#156#213#165#255#152 + +#211#161#255#148#208#157#255#144#206#152#255#139#203#147#255#135#201#142#255 + +#130#198#137#255'~'#195#132#255'z'#193#128#255'v'#190'|'#255'r'#189'x'#255'!' + +'c$'#255#255#255#255#0#255#255#255#0'h'#199't'#201#127#204#138#255#162#216 + +#171#255#158#214#167#255#154#212#163#255#150#210#159#255#147#207#154#255#142 + +#204#149#255#137#202#144#255#133#199#139#255#129#197#135#255'}'#194#130#255 + +'x'#192'~'#255'%i)'#255#255#255#255#0#255#255#255#0#255#255#255#0'h'#199't' + +#209#128#205#139#255'|'#201#135#255']'#184'h'#255'X'#177'b'#255'S'#169'\'#255 + +'M'#161'V'#255'G'#153'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';'#255'/x5' + +#255'*p/'#255#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'h'#199 + +'t'#219'e'#195'q'#247#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'h'#199't' + +#6'h'#199't'#187#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + ,#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#9'NumGlyphs'#2#0#7'OnClick'#7#16'GroupOutBtnClick'#8'Ta' + +'bOrder'#2#6#0#0#5'TEdit'#8'TimeEdit'#4'Left'#3#216#0#6'Height'#2#21#3'Top'#2 + +')'#5'Width'#3#143#0#8'TabOrder'#2#7#4'Text'#6#8'TimeEdit'#0#0#5'TEdit'#9'Ev' + +'entEdit'#4'Left'#3#217#0#6'Height'#2#21#3'Top'#3#144#0#5'Width'#3#143#0#8'T' + +'abOrder'#2#8#4'Text'#6#8'TimeEdit'#0#0#5'TEdit'#9'GroupEdit'#4'Left'#3#217#0 + +#6'Height'#2#21#3'Top'#3#238#0#5'Width'#3#143#0#8'TabOrder'#2#9#4'Text'#6#8 + +'TimeEdit'#0#0#9'TGroupBox'#9'GroupBox1'#4'Left'#3#175#0#6'Height'#2'S'#3'To' + +'p'#3#17#1#5'Width'#3#185#0#7'Caption'#6#8'Options:'#12'ClientHeight'#2'A'#11 + +'ClientWidth'#3#181#0#8'TabOrder'#2#10#0#9'TCheckBox'#7'PlotChk'#4'Left'#2#7 + +#6'Height'#2#17#3'Top'#2#6#5'Width'#3#172#0#7'Caption'#6' Graph Survival Pro' + +'babilities (%)'#8'TabOrder'#2#0#0#0#9'TCheckBox'#8'PrintChk'#4'Left'#2#7#6 + +'Height'#2#17#3'Top'#2'"'#5'Width'#3#144#0#7'Caption'#6#25'Print Computation' + +' Results'#8'TabOrder'#2#1#0#0#0#7'TButton'#8'ResetBtn'#4'Left'#3#136#1#6'He' + +'ight'#2' '#3'Top'#2'H'#5'Width'#2'S'#7'Caption'#6#5'Reset'#7'OnClick'#7#13 + +'ResetBtnClick'#8'TabOrder'#2#11#0#0#7'TButton'#9'CancelBtn'#4'Left'#3#136#1 + +#6'Height'#2' '#3'Top'#3#128#0#5'Width'#2'S'#7'Caption'#6#6'Cancel'#11'Modal' + +'Result'#2#2#8'TabOrder'#2#12#0#0#7'TButton'#10'ComputeBtn'#4'Left'#3#136#1#6 + +'Height'#2' '#3'Top'#3#184#0#5'Width'#2'S'#7'Caption'#6#7'Compute'#7'OnClick' + +#7#15'ComputeBtnClick'#8'TabOrder'#2#13#0#0#7'TButton'#9'ReturnBtn'#4'Left'#3 + +#136#1#6'Height'#2' '#3'Top'#3#240#0#5'Width'#2'S'#7'Caption'#6#6'Return'#11 + +'ModalResult'#2#1#8'TabOrder'#2#14#0#0#7'TButton'#7'HelpBtn'#3'Tag'#2#127#4 + +'Left'#3#136#1#6'Height'#2'!'#3'Top'#2#16#5'Width'#2'V'#7'Caption'#6#4'Help' + +#7'OnClick'#7#12'HelpBtnClick'#8'TabOrder'#2#15#0#0#0 +]); diff --git a/applications/lazstats/source_orig/kaplanmeierunit.pas b/applications/lazstats/source_orig/kaplanmeierunit.pas new file mode 100644 index 000000000..4276c8a05 --- /dev/null +++ b/applications/lazstats/source_orig/kaplanmeierunit.pas @@ -0,0 +1,1069 @@ +unit KaplanMeierUnit; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, + StdCtrls, Buttons, MainUnit, Globals, functionsLib, OutPutUnit, DataProcs, + DictionaryUnit, Math, Clipbrd, contexthelpunit; + +type + + { TKaplanMeierFrm } + + TKaplanMeierFrm = class(TForm) + HelpBtn: TButton; + ResetBtn: TButton; + CancelBtn: TButton; + ComputeBtn: TButton; + ReturnBtn: TButton; + PlotChk: TCheckBox; + PrintChk: TCheckBox; + GroupBox1: TGroupBox; + TimeInBtn: TBitBtn; + TimeOutBtn: TBitBtn; + EventInBtn: TBitBtn; + EventOutBtn: TBitBtn; + GroupInBtn: TBitBtn; + GroupOutBtn: TBitBtn; + TimeEdit: TEdit; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + Label4: TLabel; + Label5: TLabel; + Label6: TLabel; + EventEdit: TEdit; + GroupEdit: TEdit; + VarList: TListBox; + procedure ComputeBtnClick(Sender: TObject); + procedure EventInBtnClick(Sender: TObject); + procedure EventOutBtnClick(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure GroupInBtnClick(Sender: TObject); + procedure GroupOutBtnClick(Sender: TObject); + procedure HelpBtnClick(Sender: TObject); + procedure ResetBtnClick(Sender: TObject); + procedure TimeInBtnClick(Sender: TObject); + procedure TimeOutBtnClick(Sender: TObject); + private + { private declarations } + procedure plotxy(var Xpoints : IntDyneVec; + var Ypoints : DblDyneVec; + var Dropped : IntDyneVec; + var Dropped2 : IntDyneVec; + Xmax, Xmin, Ymax, Ymin : double; + N : integer; + XEdit : string; + YEdit : string; + curveno : integer); + public + { public declarations } + end; + +var + KaplanMeierFrm: TKaplanMeierFrm; + +implementation +uses BlankFrmUnit; + +{ TKaplanMeierFrm } + +procedure TKaplanMeierFrm.ResetBtnClick(Sender: TObject); +VAR i : integer; +begin + VarList.Clear; + for i := 1 to NoVariables do + VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]); + TimeEdit.Text := ''; + EventEdit.Text := ''; + GroupEdit.Text := ''; + PlotChk.Checked := false; + PrintChk.Checked := false; + TimeInBtn.Visible := true; + EventInBtn.Visible := true; + GroupInBtn.Visible := true; + TimeOutBtn.Visible := false; + EventOutBtn.Visible := false; + GroupOutBtn.Visible := false; +end; + +procedure TKaplanMeierFrm.TimeInBtnClick(Sender: TObject); +VAR i : integer; +begin + i := VarList.ItemIndex; + TimeEdit.Text := VarList.Items.Strings[i]; + VarList.Items.Delete(i); + TimeInBtn.Visible := false; + TimeOutBtn.Visible := true; +end; + +procedure TKaplanMeierFrm.TimeOutBtnClick(Sender: TObject); +begin + VarList.Items.Add(TimeEdit.Text); + TimeEdit.Text := ''; + TimeInBtn.Visible := true; + TimeOutBtn.Visible := false; +end; + +procedure TKaplanMeierFrm.FormShow(Sender: TObject); +begin + ResetBtnClick(self); +end; + +procedure TKaplanMeierFrm.GroupInBtnClick(Sender: TObject); +VAR i : integer; +begin + i := VarList.ItemIndex; + GroupEdit.Text := VarList.Items.Strings[i]; + VarList.Items.Delete(i); + GroupInBtn.Visible := false; + GroupOutBtn.Visible := true; +end; + +procedure TKaplanMeierFrm.GroupOutBtnClick(Sender: TObject); +begin + VarList.Items.Add(GroupEdit.Text); + GroupEdit.Text := ''; + GroupInBtn.Visible := true; + GroupOutBtn.Visible := false; +end; + +procedure TKaplanMeierFrm.HelpBtnClick(Sender: TObject); +begin + ContextHelpForm.HelpMessage((Sender as TButton).tag); +end; + +procedure TKaplanMeierFrm.EventInBtnClick(Sender: TObject); +VAR i : integer; +begin + i := VarList.ItemIndex; + EventEdit.Text := VarList.Items.Strings[i]; + VarList.Items.Delete(i); + EventInBtn.Visible := false; + EventOutBtn.Visible := true; +end; + +procedure TKaplanMeierFrm.ComputeBtnClick(Sender: TObject); +var + outline, astring : string; + PrintIt, Graph1, TwoGroups : boolean; + Size1, Size2, TotalSize, NoDeaths, ThisTime, FoundIn, GraphType : integer; + mintime, maxtime, tempint, nopoints, noprobs, tempvalue : integer; + NoCensored, nocats, i, j, k, icase, oldtime, pos, first, last : integer; + noinexp, noincntrl, count, TimeCol, DeathsCol, CensoredCol : integer; + GroupCol : integer; + minprob, maxprob, cumprop, proportion, term1, term2, term3 : double; + E1, E2, O1, O2, Chisquare, ProbChi, Risk, LogRisk, SELogRisk : double; + HiConf, LowConf, HiLogLevel, LowLogLevel, lastexp, lastctr : double; + TimePlot, Dropped, Dropped2, Time, AtRisk, Dead, SurvivalTimes : IntDyneVec; + ExpCnt, CntrlCnt, TotalatRisk, ExpatRisk, CntrlatRisk : IntDyneVec; + Deaths, Group, Censored : IntDyneVec; + ProbPlot, ProbPlot2, CondProb, ExpProp, CntrlProp : DblDyneVec; + CumPropExp, CumPropCntrl : DblDyneVec; + TimeLabel, GroupLabel, DeathsLabel : string; +begin + PrintIt := false; + // get options + if (PlotChk.Checked = true) then Graph1 := true + else Graph1 := false; + if (PrintChk.Checked) then PrintIt := true else PrintIt := false; + + // get variable columns and labels + TimeLabel := TimeEdit.Text; + GroupLabel := GroupEdit.Text; + DeathsLabel := EventEdit.Text; + TimeCol := 0; + DeathsCol := 0; + CensoredCol := 0; + GroupCol := 0; + for i := 1 to NoVariables do + begin + if (TimeLabel = OS3MainFrm.DataGrid.Cells[i,0]) then TimeCol := i; + if (DeathsLabel = OS3MainFrm.DataGrid.Cells[i,0]) then DeathsCol := i; + if (GroupLabel = OS3MainFrm.DataGrid.Cells[i,0]) then GroupCol := i; + end; + if ((TimeCol = 0) or (DeathsCol = 0)) then + begin + ShowMessage('ERROR! One or more variables not selected.'); + exit; + end; + if (GroupEdit.Text = '') then + begin + TwoGroups := false; + Size1 := NoCases; + Size2 := 0; + end + else + begin + Size1 := 0; + Size2 := 0; + TwoGroups := true; + for i := 1 to NoCases do + begin + if (StrToInt(OS3MainFrm.DataGrid.Cells[GroupCol,i]) = 1) then + Size1 := Size1 + 1 + else Size2 := Size2 + 1; + end; + end; + + // allocate space for the data + SetLength(SurvivalTimes,NoCases+2); + SetLength(ExpCnt,NoCases+2); + SetLength(CntrlCnt,NoCases+2); + SetLength(TotalatRisk,NoCases+2); + SetLength(ExpatRisk,NoCases+2); + SetLength(CntrlatRisk,NoCases+2); + SetLength(ExpProp,NoCases+2); + SetLength(CntrlProp,NoCases+2); + SetLength(Deaths,NoCases+2); + SetLength(Group,NoCases+2); + SetLength(Censored,NoCases+2); + SetLength(CumPropExp,NoCases+2); + SetLength(CumPropCntrl,NoCases+2); + + // initialize arrays + for i := 0 to NoCases+1 do + begin + SurvivalTimes[i] := 0; + ExpCnt[i] := 0; + CntrlCnt[i] := 0; + TotalatRisk[i] := 0; + ExpatRisk[i] := 0; + CntrlatRisk[i] := 0; + ExpProp[i] := 0.0; + CntrlProp[i] := 0.0; + Deaths[i] := 0; + Group[i] := 0; + Censored[i] := 0; + CumPropExp[i] := 0.0; + CumPropCntrl[i] := 0.0; + end; + mintime := 0; + maxtime := 0; + + // Get Data + if (not TwoGroups) then + begin + for i := 1 to NoCases do + begin + SurvivalTimes[i] := StrToInt(OS3MainFrm.DataGrid.Cells[TimeCol,i]); + if (SurvivalTimes[i] > maxtime) then maxtime := SurvivalTimes[i]; + tempvalue := StrToInt(OS3MainFrm.DataGrid.Cells[DeathsCol,i]); + if (tempvalue = 1) then Deaths[i] := 1 else Deaths[i] := 0; + if (tempvalue = 2) then Censored[i] := 1 else Censored[i] := 0; + end; + + // sort cases by time + for i := 0 to NoCases - 1 do + begin + for j := i + 1 to NoCases do + begin + if (SurvivalTimes[i] > SurvivalTimes[j]) then + begin + tempint := SurvivalTimes[i]; + SurvivalTimes[i] := SurvivalTimes[j]; + SurvivalTimes[j] := tempint; + tempint := Censored[i]; + Censored[i] := Censored[j]; + Censored[j] := tempint; + tempint := Deaths[i]; + Deaths[i] := Deaths[j]; + Deaths[j] := tempint; + end; + end; + end; + + // get number censored in each time slot + nopoints := maxtime + 1; + SetLength(Dropped,nopoints+2); + SetLength(Dropped2,nopoints+2); + for j := 0 to nopoints do + begin + Dropped[j] := 0; + Dropped2[j] := 0; + end; + ThisTime := SurvivalTimes[0]; + for i := 0 to NoCases do + begin + if (ThisTime = SurvivalTimes[i]) then + begin + if(Censored[i] > 0) then + begin + tempint := SurvivalTimes[i] - mintime; + Dropped[tempint] := Dropped[tempint] + Censored[i]; + end; + end + else // new time + begin + ThisTime := SurvivalTimes[i]; + if(Censored[i] > 0) then + begin + tempint := SurvivalTimes[i] - mintime; + Dropped[tempint] := Dropped[tempint] + Censored[i]; + end; + end; + end; + + // calculate expected proportions and adjust survival counts + cumprop := 1.0; + ExpCnt[0] := NoCases; + ExpProp[0] := 1.0; + CumPropExp[0] := 1.0; + + // collapse deaths and censored into first time occurance + icase := 0; + oldtime := SurvivalTimes[0]; + for i := 1 to NoCases do + begin + if (SurvivalTimes[i] <> oldtime) then + begin + oldtime := SurvivalTimes[i]; + icase := i; + end; + + // find no. of deaths at this time + NoDeaths := Deaths[i]; + for j := i+1 to NoCases do + begin + ThisTime := SurvivalTimes[j]; + if ((Deaths[j] > 0) and (oldtime = ThisTime)) then + begin + NoDeaths := NoDeaths + Deaths[j]; + Deaths[icase] := Deaths[icase] + Deaths[j]; + Deaths[j] := 0; + end; + end; + // find no. of censored at this time + NoCensored := Censored[i]; + for j := i+1 to NoCases do + begin + ThisTime := SurvivalTimes[j]; + if((Censored[j] > 0) and (oldtime = ThisTime)) then + begin + NoCensored := NoCensored + Censored[j]; + Censored[icase] := Censored[icase] + Censored[j]; + Censored[j] := 0; + end; + end; + end; +{ + // debug check + FrmOutPut.RichOutPut.Clear(); + for (int i := 0; i <= NoCases; i++) + begin + sprintf(outline,'case %d Day %d Deaths %d Censored %d', + i,SurvivalTimes[i], Deaths[i],Censored[i]); + FrmOutPut.RichOutPut.Lines.Add(outline); + end; + FrmOutPut.ShowModal(); +} + // get no. of categories + for i := 0 to NoCases do + if ((Deaths[i] > 0) or (Censored[i] > 0)) then nocats := nocats + 1; + SetLength(Time,nocats+2); + SetLength(AtRisk,nocats+2); + SetLength(Dead,nocats+2); + SetLength(CondProb,nocats+2); + for i := 0 to nocats do + begin + Time[i] := 0; + AtRisk[i] := 0; + Dead[i] := 0; + CondProb[i] := 0.0; + end; + pos := 0; + for i := 0 to NoCases do + begin + if ((Deaths[i] > 0) or (Censored[i] > 0)) then + begin + pos := pos + 1; + Time[pos] := SurvivalTimes[i]; + Dead[pos] := Deaths[i]; + Dropped[pos] := Censored[i]; + end; + end; + Time[0] := 0; + AtRisk[0] := NoCases; + Dead[0] := 0; + Dropped[0] := 0; + CondProb[0] := 0.0; + OutPutFrm.RichEdit.Clear; + OutPutFrm.RichEdit.Lines.Add(' Time Censored Dead At Risk Probability'); + for i := 1 to nocats do + begin + AtRisk[i] := AtRisk[i-1] - Dead[i-1] - Dropped[i-1]; + CondProb[i-1] := 1.0 - Dead[i-1] / AtRisk[i-1]; + end; + for i := 0 to nocats do + begin + outline := format(' %3d %3d %3d %3d %6.3f', + [Time[i],Dropped[i],Dead[i],AtRisk[i],CondProb[i]]); + OutPutFrm.RichEdit.Lines.Add(outline); + end; + OutPutFrm.ShowModal; + + // Get cumulative proportions + for i := 0 to nocats do + begin + if (AtRisk[i] > 0) then + begin + CumPropExp[i] := cumprop * CondProb[i]; + cumprop := CumPropExp[i]; + end; + end; + cumprop := 1.0; + OutPutFrm.RichEdit.Clear; + OutPutFrm.RichEdit.Lines.Add('Kaplan-Meier Survival Test'); + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add('No Control Group Method'); + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add('TIME NO.ALIVE CENSORED DEATHS COND. PROB. CUM.PROP.SURVIVING'); + for i := 0 to nocats do + begin + outline := format(' %4d %4d %4d %4d %7.4f %7.4f', + [Time[i], + AtRisk[i],Dropped[i],Deaths[i],CondProb[i],CumPropExp[i]]); + OutPutFrm.RichEdit.Lines.Add(outline); + end; + OutPutFrm.ShowModal; + if (Graph1) then // plot Y := cumulative proportion surviving, x := time + begin + // Get points to plot + nopoints := maxtime + 1; + SetLength(TimePlot,nocats+2); + SetLength(ProbPlot,nocats+2); + ProbPlot[0] := 1.0; + for j := 0 to nocats do + begin + TimePlot[j] := Time[j]; + ProbPlot[j] := CumPropExp[j]; + end; + BlankFrm.Show; + plotxy(TimePlot, ProbPlot, Dropped, Dropped2, + maxtime,0,1.0, 0.0, nocats,'TIME','PROBABILITY',1); + end; // end if graph1 + ProbPlot := nil; + TimePlot := nil; + CondProb := nil; + Dead := nil; + AtRisk := nil; + Time := nil; + end // end if not two groups +//============================================================================// + else // Experimental and control groups + begin + // obtain no. in experimental and control groups + ExpCnt[0] := Size1; + CntrlCnt[0] := Size2; + TotalSize := Size1 + Size2; + CumPropExp[0] := 1.0; + CumPropCntrl[0] := 1.0; + TotalatRisk[0] := TotalSize; + O1 := 0; + O2 := 0; + outline := format('Total Group 1 := %d, Total Group 2 := %d, Grand Total := %d', + [ExpCnt[0], CntrlCnt[0], TotalSize]); + ShowMessage(outline); + + // Now read values. Note storage starts in 1, not 0! + for i := 1 to NoCases do + begin + SurvivalTimes[i] := StrToInt(OS3MainFrm.DataGrid.Cells[TimeCol,i]); + if (SurvivalTimes[i] > maxtime) then maxtime := SurvivalTimes[i]; + tempvalue := StrToInt(OS3MainFrm.DataGrid.Cells[DeathsCol,i]); + if (tempvalue = 1) then Deaths[i] := 1 else Deaths[i] := 0; + if (tempvalue = 2) then Censored[i] := 1 else Censored[i] := 0; + Group[i] := StrToInt(OS3MainFrm.DataGrid.Cells[GroupCol,i]); + end; + + // sort cases by time + for i := 1 to NoCases - 1 do + begin + for j := i + 1 to NoCases do + begin + if (SurvivalTimes[i] > SurvivalTimes[j]) then + begin + tempint := SurvivalTimes[i]; + SurvivalTimes[i] := SurvivalTimes[j]; + SurvivalTimes[j] := tempint; + tempint := Censored[i]; + Censored[i] := Censored[j]; + Censored[j] := tempint; + tempint := Deaths[i]; + Deaths[i] := Deaths[j]; + Deaths[j] := tempint; + tempint := Group[i]; + Group[i] := Group[j]; + Group[j] := tempint; + end; + end; + end; + + // sort cases within each time slot by deaths first then censored + ThisTime := SurvivalTimes[1]; + first := 1; + last := 1; + for i := 1 to NoCases do + begin + if (ThisTime = SurvivalTimes[i]) then + begin + last := i; + continue; + end + else // sort the cases from first to last on event (descending) + begin + if (last > first) then // more than 1 to sort + begin + for j := first to last - 1 do + begin + for k := j + 1 to last do + begin + if (Deaths[j] < Deaths[k] ) then // swap + begin + tempint := Censored[j]; + Censored[j] := Censored[k]; + Censored[k] := tempint; + tempint := Deaths[j]; + Deaths[j] := Deaths[k]; + Deaths[k] := tempint; + tempint := Group[j]; + Group[j] := Group[k]; + Group[k] := tempint; + end; + end; // next k + end; // next j + end; // if last > first + end; // end else sort + first := last + 1; + ThisTime := SurvivalTimes[first]; + last := first; + end; // next i + + // get number censored in each time slot + nopoints := maxtime + 1; + SetLength(Dropped,nopoints+2); + SetLength(Dropped2,nopoints+2); + for j := 0 to nopoints do + begin + Dropped[j] := 0; + Dropped2[j] := 0; + end; + ThisTime := SurvivalTimes[1]; + for i := 1 to NoCases do + begin + if (ThisTime = SurvivalTimes[i]) then + begin + if(Censored[i] > 0) then + begin + tempint := SurvivalTimes[i] - mintime; + if (Group[i] = 1) then + Dropped[tempint] := Dropped[tempint] + Censored[i] + else Dropped2[tempint] := Dropped2[tempint] + Censored[i]; + end; + end + else // new time + begin + ThisTime := SurvivalTimes[i]; + if(Censored[i] > 0) then + begin + tempint := SurvivalTimes[i] - mintime; + if (Group[i] = 1) then + Dropped[tempint] := Dropped[tempint] + Censored[i] + else Dropped2[tempint] := Dropped2[tempint] + Censored[i]; + end; + end; + end; + + for i := 0 to NoCases do + begin + noinexp := 0; + noincntrl := 0; + if (Deaths[i] > 0) then + begin + // find no. of deaths at this time + NoDeaths := Deaths[i]; + ThisTime := SurvivalTimes[i]; + for j := i+1 to NoCases do + begin + if ((Deaths[j] > 0) and (SurvivalTimes[j] = ThisTime)) then + begin + NoDeaths := NoDeaths + Deaths[j]; + Deaths[i] := Deaths[i] + Deaths[j]; + Deaths[j] := 0; + end; + end; + if (TotalatRisk[i] > 0) then + begin + term1 := ExpCnt[i]; + term2 := TotalatRisk[i]; + term3 := NoDeaths; + ExpatRisk[i] := ceil((term1 / term2) * term3); +// ExpatRisk[i] := (ExpCnt[i]) / TotalatRisk[i]) * NoDeaths; + term1 := CntrlCnt[i]; + CntrlatRisk[i] := ceil((term1 / term2) * term3); +// CntrlatRisk[i] := (CntrlCnt[i] / TotalatRisk[i]) * NoDeaths; + end; + if (i < NoCases-1) then TotalatRisk[i+1] := TotalatRisk[i] - Deaths[i]; + // find no. in exp. or control groups and decrement their counts + for j := 1 to NoCases do + begin + if ( (ThisTime = SurvivalTimes[j]) and (Censored[j] = 0)) then + begin + if (Group[j] = 1) then + begin + noinexp := noinexp + 1; + O1 := O1 + 1; + end; + if (Group[j] = 2) then + begin + noincntrl := noincntrl + 1; + O2 := O2 + 1; + end; + end; + end; + if ( (i < NoCases) and (noinexp > 0) ) then + begin + term1 := ExpCnt[i]; + term2 := noinexp; + term3 := ExpCnt[i]; + ExpProp[i] := (term1 - term2) / term3; +// ExpProp[i] := (ExpCnt[i] - noinexp) / ExpCnt[i]; + if (i > 0) then CumPropExp[i] := CumPropExp[i-1] * ExpProp[i]; + ExpCnt[i+1] := ExpCnt[i] - noinexp; + CumPropExp[i+1] := CumPropExp[i]; + end; + if ( (i < NoCases) and (noinexp = 0) ) then + begin + ExpCnt[i+1] := ExpCnt[i]; + CumPropExp[i+1] := CumPropExp[i]; + end; + if ( (i < NoCases) and (noincntrl > 0) ) then + begin + term1 := CntrlCnt[i]; + term2 := noincntrl; + term3 := CntrlCnt[i]; + CntrlProp[i] := (term1 - term2) / term3; +// CntrlProp[i] := (CntrlCnt[i] - noincntrl) / CntrlCnt[i]; + if (i > 0) then CumPropCntrl[i] := CumPropCntrl[i-1] * CntrlProp[i]; + CntrlCnt[i+1] := CntrlCnt[i] - noincntrl; + CumPropCntrl[i+1] := CumPropCntrl[i]; + end; + if ( (i < NoCases) and (noincntrl = 0) ) then + begin + CntrlCnt[i+1] := CntrlCnt[i]; + CumPropCntrl[i+1] := CumPropCntrl[i]; + end; + end; // end if deaths[i] > 0 + + if ( (Censored[i] > 0) and (i < NoCases) ) then + begin + if (Group[i] = 1) then + begin + ExpCnt[i+1] := ExpCnt[i] - 1; + CntrlCnt[i+1] := CntrlCnt[i]; + ExpProp[i+1] := ExpProp[i]; + CumPropExp[i+1] := CumPropExp[i]; + CumPropCntrl[i+1] := CumPropCntrl[i]; + end; + if (Group[i] = 2) then + begin + CntrlCnt[i+1] := CntrlCnt[i] - 1; + ExpCnt[i+1] := ExpCnt[i]; + CntrlProp[i+1] := CntrlProp[i]; + CumPropCntrl[i+1] := CumPropCntrl[i]; + CumPropExp[i+1] := CumPropExp[i]; + end; + TotalatRisk[i+1] := TotalatRisk[i] - 1; + end; + if ( (Deaths[i] = 0) and (Censored[i] = 0) and (i < NoCases) ) then + begin + ExpCnt[i+1] := ExpCnt[i]; + CntrlCnt[i+1] := CntrlCnt[i]; + CumPropExp[i+1] := CumPropExp[i]; + CumPropCntrl[i+1] := CumPropCntrl[i]; + TotalatRisk[i+1] := TotalatRisk[i]; + end; + end; // next case i + + // Now calculate chisquare, relative risk (r), logr, and S.E. of log risk + E1 := 0.0; + for i := 0 to NoCases do E1 := E1 + ExpatRisk[i]; + E2 := (O1 + O2) - E1; + Chisquare := ((O1 - E1) * (O1 - E1)) / E1 + ((O2 - E2) * (O2 - E2)) / E2; + ProbChi := chisquaredprob(Chisquare,1); + Risk := (O1 / E1) / (O2 / E2); + LogRisk := ln(Risk); + SELogRisk := sqrt(1.0/E1 + 1.0/E2); + HiConf := LogRisk + (inversez(0.975) * SELogRisk); + LowConf := LogRisk - (inversez(0.975) * SELogRisk); + HiLogLevel := exp(HiConf); + LowLogLevel := exp(LowConf); + end; + + // Print Results + if (TwoGroups and PrintIt) then // both experimental and control groups + begin + OutPutFrm.RichEdit.Clear; + OutPutFrm.RichEdit.Lines.Add('Kaplan-Meier Survival Test'); + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add('Comparison of Two Groups Methd'); + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add('TIME GROUP CENSORED TOTAL AT EVENTS AT RISK IN EXPECTED NO. AT RISK IN EXPECTED NO.'); + OutPutFrm.RichEdit.Lines.Add(' RISK GROUP 1 EVENTS IN 1 GROUP 2 EVENTS IN 2'); + for i := 1 to NoCases+1 do + begin + outline := format('%4d %4d %4d %4d %4d %4d %7d %4d %7d', + [SurvivalTimes[i-1],Group[i-1],Censored[i-1],TotalatRisk[i-1], + Deaths[i-1],ExpCnt[i-1],ExpatRisk[i-1],CntrlCnt[i-1],CntrlatRisk[i-1]]); + OutPutFrm.RichEdit.Lines.Add(outline); + end; + + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add('TIME DEATHS GROUP AT RISK PROPORTION CUMULATIVE'); + OutPutFrm.RichEdit.Lines.Add(' SURVIVING PROP.SURVIVING'); + + for i := 1 to NoCases do + begin + if (Group[i] = 1) then + begin + count := ExpCnt[i]; + proportion := ExpProp[i]; + cumprop := CumPropExp[i]; + end + else + begin + count := CntrlCnt[i]; + proportion := CntrlProp[i]; + cumprop := CumPropCntrl[i]; + end; + outline := format('%4d %4d %4d %4d %7.4f %7.4f', + [SurvivalTimes[i],Deaths[i],Group[i],count,proportion,cumprop]); + OutPutFrm.RichEdit.Lines.Add(outline); + end; + OutPutFrm.RichEdit.Lines.Add(''); + outline := format('Total Expected Events for Experimental Group := %8.3f',[E1]); + OutPutFrm.RichEdit.Lines.Add(outline); + outline := format('Observed Events for Experimental Group := %8.3f',[O1]); + OutPutFrm.RichEdit.Lines.Add(outline); + outline := format('Total Expected Events for Control Group := %8.3f',[E2]); + OutPutFrm.RichEdit.Lines.Add(outline); + outline := format('Observed Events for Control Group := %8.3f',[O2]); + OutPutFrm.RichEdit.Lines.Add(outline); + outline := format('Chisquare = %8.3f with probability = %5.3f',[Chisquare,ProbChi]); + OutPutFrm.RichEdit.Lines.Add(outline); + outline := format('Risk := %8.3f, Log Risk := %8.3f, Std.Err. Log Risk := %8.3f', + [Risk, LogRisk, SELogRisk]); + OutPutFrm.RichEdit.Lines.Add(outline); + outline := format('95 Percent Confidence interval for Log Risk = (%5.3f,%5.3f)', + [LowConf,HiConf]); + OutPutFrm.RichEdit.Lines.Add(outline); + outline := format('95 Percent Confidence interval for Risk := (%5.3f,%5.3f)', + [LowLogLevel,HiLogLevel]); + OutPutFrm.RichEdit.Lines.Add(outline); + OutPutFrm.ShowModal; + + // Plot data output + OutPutFrm.RichEdit.Clear; + OutPutFrm.RichEdit.Lines.Add('EXPERIMENTAL GROUP CUMULATIVE PROBABILITY'); + OutPutFrm.RichEdit.Lines.Add('CASE TIME DEATHS CENSORED CUM.PROB.'); + for i := 1 to NoCases do + begin + if (Group[i] = 1) then + begin + outline := format('%3d %3d %3d %3d %5.3f',[i, + SurvivalTimes[i], Deaths[i], Censored[i], CumPropExp[i]]); + OutPutFrm.RichEdit.Lines.Add(outline); + end; + end; + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.ShowModal; + OutPutFrm.RichEdit.Clear; + OutPutFrm.RichEdit.Lines.Add('CONTROL GROUP CUMULATIVE PROBABILITY'); + OutPutFrm.RichEdit.Lines.Add('CASE TIME DEATHS CENSORED CUM.PROB.'); + for i := 1 to NoCases do + begin + if (Group[i] = 2) then + begin + outline := format('%3d %3d %3d %3d %5.3f',[i, + SurvivalTimes[i], Deaths[i], Censored[i], CumPropCntrl[i]]); + OutPutFrm.RichEdit.Lines.Add(outline); + end; + end; + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.ShowModal; + end; // if 2 groups and printit + + if (Graph1) then // plot cumulative proportion surviving (Y) against time (X) + begin + nopoints := maxtime + 1; + SetLength(TimePlot,nopoints+2); + SetLength(ProbPlot,nopoints+2); + SetLength(ProbPlot2,nopoints+2); + ProbPlot[0] := 1.0; + ProbPlot2[0] := 1.0; + lastexp := 1.0; + lastctr := 1.0; + for i := 0 to nopoints do + begin + TimePlot[i] := 0; + ProbPlot[i] := 1.0; + ProbPlot2[i] := 1.0; + end; + TimePlot[0] := 0; + mintime := 0; + for i := 1 to nopoints do + begin + TimePlot[i] := i; + for j := 1 to NoCases do + begin + if (SurvivalTimes[j] = i) then + begin + if (Group[j] = 1) then + begin + ProbPlot[i] := CumPropExp[j]; // ExpProp[j]; + lastexp := CumPropExp[j]; // ExpProp[j]; + end; + if (Group[j] = 2) then + begin + ProbPlot2[i] := CumPropCntrl[j]; //CntrlProp[j]; + lastctr := CumPropCntrl[j]; // CntrlProp[j]; + end; + end + else + begin + if (Group[j] = 1) then ProbPlot[i] := lastexp; + if (Group[j] = 2) then ProbPlot2[i] := lastctr; + end; + end; + end; + BlankFrm.Image1.Canvas.Clear; + BlankFrm.Show; + plotxy(TimePlot, ProbPlot, Dropped, Dropped2, + maxtime, 0, 1.0, 0.0, nopoints, 'TIME', 'PROBABILITY',1); + + plotxy(TimePlot, ProbPlot2, Dropped, Dropped2, + maxtime, 0, 1.0, 0.0, nopoints, 'TIME', 'PROBABILITY',2); + + ProbPlot2 := nil; + ProbPlot := nil; + TimePlot := nil; + end; // if graph plot := 1 + Dropped2 := nil; + Dropped := nil; + + // clean up memory + Dropped2 := nil; + Dropped := nil; + CumPropCntrl := nil; + CumPropExp := nil; + Censored := nil; + Group := nil; + Deaths := nil; + CntrlProp := nil; + ExpProp := nil; + CntrlatRisk := nil; + ExpatRisk := nil; + TotalatRisk := nil; + CntrlCnt := nil; + ExpCnt := nil; + SurvivalTimes := nil; +end; + +procedure TKaplanMeierFrm.EventOutBtnClick(Sender: TObject); +begin + VarList.Items.Add(EventEdit.Text); + EventEdit.Text := ''; + EventInBtn.Visible := true; + EventOutBtn.Visible := false; +end; + +procedure TKaplanMeierFrm.plotxy(var Xpoints: IntDyneVec; + var Ypoints: DblDyneVec; var Dropped: IntDyneVec; var Dropped2: IntDyneVec; + Xmax, Xmin, Ymax, Ymin: double; N: integer; XEdit: string; YEdit: string; + curveno: integer); +var + i, xpos, ypos, hleft, hright, vtop, vbottom, imagewide : integer; + vhi, hwide, offset, strhi, imagehi : integer; + noxvalues, digitwidth, Xvalue, xvalincr, oldxpos : integer; + maxval, minval, valincr, Yvalue, value, oldypos, term1, term2, term3 : double; + Title, outline : string; +label again, second; + +begin + if (curveno = 2) then goto second; + BlankFrm.Image1.Canvas.Font.Color := clBlack; + Title := 'SURVIVAL CURVE'; + BlankFrm.Caption := Title; + imagewide := BlankFrm.Image1.Width; + imagehi := BlankFrm.Image1.Height; + BlankFrm.Image1.Canvas.FloodFill(0,0,clWhite,fsBorder); + vtop := 20; + vbottom := ceil(imagehi) - 130; + vhi := vbottom - vtop; + hleft := 100; + hright := imagewide - 80; + hwide := hright - hleft; + BlankFrm.Image1.Canvas.Pen.Color := clBlack; + BlankFrm.Image1.Canvas.Brush.Color := clWhite; + + // Draw chart border +// ImageFrm.Image.Canvas.Rectangle(0,0,imagewide,imagehi); + + // draw horizontal axis + noxvalues := N; + xvalincr := 1; + digitwidth := BlankFrm.Image1.Canvas.TextWidth('9'); +again: + if ( (noxvalues * 4 * digitwidth) > hwide) then + begin + noxvalues := noxvalues div 2; + xvalincr := 2 * xvalincr; + goto again; + end; + BlankFrm.Image1.Canvas.Pen.Style := psSolid; + BlankFrm.Image1.Canvas.Pen.Color := clBlack; + BlankFrm.Image1.Canvas.MoveTo(hleft,vbottom); + BlankFrm.Image1.Canvas.LineTo(hright,vbottom); + for i := 1 to noxvalues do + begin + ypos := vbottom; + Xvalue := Xpoints[1] + xvalincr * (i - 1); // Xmin + xvalincr * (i - 1); + term1 := (Xvalue - Xmin) / (Xmax - Xmin); + term2 := hwide; + term3 := hleft; + xpos := floor((term1 * term2) + term3); + BlankFrm.Image1.Canvas.MoveTo(xpos,ypos); + ypos := ypos + 10; + BlankFrm.Image1.Canvas.LineTo(xpos,ypos); + outline := format('%d',[Xvalue]); + Title := outline; + offset := BlankFrm.Image1.Canvas.TextWidth(Title) div 2; + xpos := xpos - offset; + BlankFrm.Image1.Canvas.Pen.Color := clBlack; + BlankFrm.Image1.Canvas.TextOut(xpos,ypos,Title); + end; + xpos := hleft + (hwide div 2) - (BlankFrm.Image1.Canvas.TextWidth(XEdit) div 2); + ypos := vbottom + 22; + BlankFrm.Image1.Canvas.TextOut(xpos,ypos,XEdit); + + // Draw vertical axis + Title := YEdit; + xpos := hleft - BlankFrm.Image1.Canvas.TextWidth(Title) div 2; + ypos := vtop - BlankFrm.Image1.Canvas.TextHeight(Title); + BlankFrm.Image1.Canvas.TextOut(xpos,ypos,YEdit); + xpos := hleft; + ypos := vtop; + BlankFrm.Image1.Canvas.MoveTo(xpos,ypos); + ypos := vbottom; + BlankFrm.Image1.Canvas.LineTo(xpos,ypos); + valincr := (Ymax - Ymin) / 10.0; + for i := 1 to 11 do + begin + value := Ymax - ((i-1) * valincr); + outline := format('%8.2f',[value]); + Title := outline; + strhi := BlankFrm.Image1.Canvas.TextHeight(Title); + xpos := 10; + Yvalue := Ymax - (valincr * (i-1)); + ypos := ceil(vhi * ( (Ymax - Yvalue) / (Ymax - Ymin))); + ypos := ypos + vtop - strhi div 2; + BlankFrm.Image1.Canvas.TextOut(xpos,ypos,Title); + xpos := hleft; + ypos := ypos + strhi div 2; + BlankFrm.Image1.Canvas.MoveTo(xpos,ypos); + xpos := hleft - 10; + BlankFrm.Image1.Canvas.LineTo(xpos,ypos); + end; + + // get xpos and ypos for first point to second point +second: xpos := hleft; + ypos := vtop; + BlankFrm.Image1.Canvas.MoveTo(xpos,ypos); // Probability := 1 at time 0 + if (curveno = 1) then BlankFrm.Image1.Canvas.Pen.Color := clNavy + else BlankFrm.Image1.Canvas.Pen.Color := clRed; + ypos := ceil(vhi * ( (Ymax - Ypoints[0]) / (Ymax - Ymin))); + ypos := ypos + vtop; + xpos := ceil(hwide * ( (Xpoints[1] - Xmin) / (Xmax - Xmin))); + xpos := xpos + hleft; + BlankFrm.Image1.Canvas.LineTo(xpos,ypos); + + // draw points for x and y pairs + oldxpos := xpos; + oldypos := ypos; + for i := 1 to N - 1 do + begin + ypos := ceil(vhi * ( (Ymax - Ypoints[i]) / (Ymax - Ymin))); + ypos := ypos + vtop; + if (ypos <> oldypos) then // draw line down to new ypos using old xpos + begin + if (curveno = 1) then BlankFrm.Image1.Canvas.Pen.Style := psSolid + else BlankFrm.Image1.Canvas.Pen.Style := psDot; + BlankFrm.Image1.Canvas.LineTo(oldxpos,ypos); + end; + xpos := ceil(hwide * ( (Xpoints[i] - Xmin) / (Xmax - Xmin))); + xpos := xpos + hleft; + oldxpos := xpos; + oldypos := ypos; + BlankFrm.Image1.Canvas.Pen.Style := psSolid; + BlankFrm.Image1.Canvas.LineTo(xpos,ypos); + end; + + // show censored + BlankFrm.Image1.Canvas.Pen.Style := psSolid; + BlankFrm.Image1.Canvas.Pen.Color := clBlack; + for i := 1 to N do + begin + if ((Dropped[i] = 0) and (curveno = 1)) then continue; + if ((Dropped2[i] = 0) and (curveno = 2)) then continue; + if (curveno = 1) then + begin + BlankFrm.Image1.Canvas.Font.Color := clNavy; + ypos := vbottom + 35; + xpos := ceil(hwide * ((Xpoints[i] - Xmin) / (Xmax - Xmin))); + xpos := xpos + hleft; + outline := format('%d',[Dropped[i]]); + Title := outline; + BlankFrm.Image1.Canvas.TextOut(xpos,ypos,Title); + end + else + begin + BlankFrm.Image1.Canvas.Font.Color := clRed; + ypos := vbottom + 48; + xpos := ceil(hwide * ((Xpoints[i] - Xmin) / (Xmax - Xmin))); + xpos := xpos + hleft; + outline := format('%d',[Dropped2[i]]); + Title := outline; + BlankFrm.Image1.Canvas.TextOut(xpos,ypos,Title); + end; + end; + + BlankFrm.Image1.Canvas.Font.Color := clBlack; + ypos := vbottom + 60; + Title := 'NUMBER CENSORED'; + xpos := hleft + (hwide div 2) - (BlankFrm.Image1.Canvas.TextWidth(Title) div 2); + BlankFrm.Image1.Canvas.TextOut(xpos,ypos,Title); + + BlankFrm.Image1.Canvas.Font.Color := clNavy; + Title := 'EXPERIMENTAL'; + xpos := 5; + ypos := vbottom + 35; + BlankFrm.Image1.Canvas.TextOut(xpos,ypos,Title); + if (curveno = 2) then + begin + BlankFrm.Image1.Canvas.Font.Color := clRed; + Title := 'CONTROL'; + xpos := 5; + ypos := vbottom + 48; + BlankFrm.Image1.Canvas.TextOut(xpos,ypos,Title); + end; +end; + +initialization + {$I kaplanmeierunit.lrs} + +end. + diff --git a/applications/lazstats/source_orig/kappaunit.lfm b/applications/lazstats/source_orig/kappaunit.lfm new file mode 100644 index 000000000..8f6e580a8 --- /dev/null +++ b/applications/lazstats/source_orig/kappaunit.lfm @@ -0,0 +1,484 @@ +object WeightedKappaFrm: TWeightedKappaFrm + Left = 132 + Height = 410 + Top = 112 + Width = 631 + Caption = 'Kappa and Weighted Kappa' + ClientHeight = 410 + ClientWidth = 631 + OnShow = FormShow + LCLVersion = '0.9.28.2' + object Label1: TLabel + Left = 10 + Height = 14 + Top = 112 + Width = 44 + Caption = 'Variables' + ParentColor = False + end + object Label2: TLabel + Left = 216 + Height = 14 + Top = 130 + Width = 38 + Caption = 'Rater A' + ParentColor = False + end + object Label3: TLabel + Left = 216 + Height = 14 + Top = 209 + Width = 37 + Caption = 'Rater B' + ParentColor = False + end + object Label4: TLabel + Left = 216 + Height = 14 + Top = 280 + Width = 93 + Caption = 'Variable to Analyze' + ParentColor = False + end + object Label5: TLabel + Left = 376 + Height = 14 + Top = 112 + Width = 114 + Caption = 'Total Number of Cases:' + ParentColor = False + end + object InputGroup: TRadioGroup + Left = 9 + Height = 90 + Top = 8 + Width = 610 + AutoFill = True + Caption = 'Input Options:' + ChildSizing.LeftRightSpacing = 6 + ChildSizing.TopBottomSpacing = 6 + ChildSizing.EnlargeHorizontal = crsHomogenousChildResize + ChildSizing.EnlargeVertical = crsHomogenousChildResize + ChildSizing.ShrinkHorizontal = crsScaleChilds + ChildSizing.ShrinkVertical = crsScaleChilds + ChildSizing.Layout = cclLeftToRightThenTopToBottom + ChildSizing.ControlsPerLine = 1 + ClientHeight = 72 + ClientWidth = 606 + Items.Strings = ( + 'Count cases classified by row and column variables in the data grid' + 'Use frequencies in a variable for a given row variable value and column variable value.' + 'Use proportions in a variable for a given row variable value and column variable value.' + ) + OnClick = InputGroupClick + TabOrder = 0 + end + object VarList: TListBox + Left = 9 + Height = 212 + Top = 128 + Width = 160 + ItemHeight = 0 + TabOrder = 1 + end + object RowIn: TBitBtn + Left = 176 + Height = 32 + Top = 130 + Width = 27 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00216324B81D5E2006FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF002A702F38256929F7216324D9FFFFFF00FFFFFF00FFFFFF00FFFFFF0061BE + 6DFF5DB868FF58B162FF53A95CFF4DA156FF47994FFF419149FF3B8842FF3580 + 3BFF3F8845FF59A15EFF448B49FF216324CFFFFFFF00FFFFFF00FFFFFF0065C3 + 71FFA0D7A9FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF458C4AFF216324C4FFFFFF00FFFFFF0068C7 + 74FFA5DAAEFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF4A9150FF256929C9FFFFFF00FFFFFF0068C7 + 74FF68C774FF65C371FF61BE6DFF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF5AA362FF559D5CFF2F7835D1FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00419149F73B8842DBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0047994FBB41914906FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + OnClick = RowInClick + TabOrder = 2 + end + object RowOut: TBitBtn + Left = 176 + Height = 22 + Top = 168 + Width = 27 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF004DA1560647994FB8FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0053A95CD94DA156F747994F38FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF005DB868CF71BE7BFF7AC183FF5BAA64FF47994FFF419149FF3B8842FF3580 + 3BFF2F7835FF2A702FFF256929FF216324FF1D5E20FFFFFFFF00FFFFFF0065C3 + 71C47BC886FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF72BD78FF216324FFFFFFFF00FFFFFF0068C7 + 74C97FCC8AFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF78C07EFF256929FFFFFFFF00FFFFFF00FFFF + FF0068C774D180CD8BFF7CC987FF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF3B8842FF35803BFF2F7835FF2A702FFFFFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C774DB65C371F7FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C7740668C774BBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + OnClick = RowOutClick + TabOrder = 3 + end + object ColIn: TBitBtn + Left = 176 + Height = 22 + Top = 209 + Width = 27 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00216324B81D5E2006FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF002A702F38256929F7216324D9FFFFFF00FFFFFF00FFFFFF00FFFFFF0061BE + 6DFF5DB868FF58B162FF53A95CFF4DA156FF47994FFF419149FF3B8842FF3580 + 3BFF3F8845FF59A15EFF448B49FF216324CFFFFFFF00FFFFFF00FFFFFF0065C3 + 71FFA0D7A9FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF458C4AFF216324C4FFFFFF00FFFFFF0068C7 + 74FFA5DAAEFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF4A9150FF256929C9FFFFFF00FFFFFF0068C7 + 74FF68C774FF65C371FF61BE6DFF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF5AA362FF559D5CFF2F7835D1FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00419149F73B8842DBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0047994FBB41914906FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + OnClick = ColInClick + TabOrder = 4 + end + object ColOut: TBitBtn + Left = 176 + Height = 22 + Top = 232 + Width = 27 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF004DA1560647994FB8FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0053A95CD94DA156F747994F38FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF005DB868CF71BE7BFF7AC183FF5BAA64FF47994FFF419149FF3B8842FF3580 + 3BFF2F7835FF2A702FFF256929FF216324FF1D5E20FFFFFFFF00FFFFFF0065C3 + 71C47BC886FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF72BD78FF216324FFFFFFFF00FFFFFF0068C7 + 74C97FCC8AFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF78C07EFF256929FFFFFFFF00FFFFFF00FFFF + FF0068C774D180CD8BFF7CC987FF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF3B8842FF35803BFF2F7835FF2A702FFFFFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C774DB65C371F7FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C7740668C774BBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + OnClick = ColOutClick + TabOrder = 5 + end + object DepIn: TBitBtn + Left = 176 + Height = 22 + Top = 280 + Width = 27 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00216324B81D5E2006FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF002A702F38256929F7216324D9FFFFFF00FFFFFF00FFFFFF00FFFFFF0061BE + 6DFF5DB868FF58B162FF53A95CFF4DA156FF47994FFF419149FF3B8842FF3580 + 3BFF3F8845FF59A15EFF448B49FF216324CFFFFFFF00FFFFFF00FFFFFF0065C3 + 71FFA0D7A9FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF458C4AFF216324C4FFFFFF00FFFFFF0068C7 + 74FFA5DAAEFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF4A9150FF256929C9FFFFFF00FFFFFF0068C7 + 74FF68C774FF65C371FF61BE6DFF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF5AA362FF559D5CFF2F7835D1FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00419149F73B8842DBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0047994FBB41914906FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + OnClick = DepInClick + TabOrder = 6 + end + object DepOut: TBitBtn + Left = 176 + Height = 20 + Top = 308 + Width = 27 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF004DA1560647994FB8FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0053A95CD94DA156F747994F38FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF005DB868CF71BE7BFF7AC183FF5BAA64FF47994FFF419149FF3B8842FF3580 + 3BFF2F7835FF2A702FFF256929FF216324FF1D5E20FFFFFFFF00FFFFFF0065C3 + 71C47BC886FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF72BD78FF216324FFFFFFFF00FFFFFF0068C7 + 74C97FCC8AFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF78C07EFF256929FFFFFFFF00FFFFFF00FFFF + FF0068C774D180CD8BFF7CC987FF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF3B8842FF35803BFF2F7835FF2A702FFFFFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C774DB65C371F7FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C7740668C774BBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + OnClick = DepOutClick + TabOrder = 7 + end + object RaterAEdit: TEdit + Left = 216 + Height = 21 + Top = 144 + Width = 120 + TabOrder = 8 + Text = 'RaterAEdit' + end + object RaterBEdit: TEdit + Left = 216 + Height = 21 + Top = 224 + Width = 120 + TabOrder = 9 + Text = 'Edit1' + end + object DepEdit: TEdit + Left = 216 + Height = 21 + Top = 296 + Width = 120 + TabOrder = 10 + Text = 'Edit1' + end + object NCasesEdit: TEdit + Left = 496 + Height = 21 + Top = 105 + Width = 62 + TabOrder = 11 + Text = 'NCasesEdit' + end + object GroupBox1: TGroupBox + Left = 376 + Height = 197 + Top = 136 + Width = 242 + Caption = 'Options:' + ClientHeight = 179 + ClientWidth = 238 + TabOrder = 12 + object ObsChk: TCheckBox + Left = 9 + Height = 17 + Top = 2 + Width = 157 + Caption = 'Show Observed Frequencies' + TabOrder = 0 + end + object ExpChk: TCheckBox + Left = 9 + Height = 17 + Top = 25 + Width = 155 + Caption = 'Show Expected Frequencies' + TabOrder = 1 + end + object PropChk: TCheckBox + Left = 9 + Height = 17 + Top = 50 + Width = 187 + Caption = 'Show Row and Column Proportions' + TabOrder = 2 + end + object ChiChk: TCheckBox + Left = 9 + Height = 17 + Top = 77 + Width = 155 + Caption = 'Show Cell Chi Square Values' + TabOrder = 3 + end + object YatesChk: TCheckBox + Left = 9 + Height = 17 + Top = 104 + Width = 209 + Caption = 'Use Yates'' Correction for a 2 by 2 table' + TabOrder = 4 + end + object SaveChk: TCheckBox + Left = 9 + Height = 17 + Top = 130 + Width = 179 + Caption = 'Save as a File of Frequency Data' + TabOrder = 5 + end + end + object ResetBtn: TButton + Left = 136 + Height = 33 + Top = 360 + Width = 79 + Caption = 'Reset' + OnClick = ResetBtnClick + TabOrder = 13 + end + object Cancel: TButton + Left = 257 + Height = 33 + Top = 360 + Width = 79 + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 14 + end + object ComputeBtn: TButton + Left = 376 + Height = 33 + Top = 360 + Width = 79 + Caption = 'Compute' + OnClick = ComputeBtnClick + TabOrder = 15 + end + object ReturnBtn: TButton + Left = 496 + Height = 33 + Top = 360 + Width = 79 + Caption = 'Return' + ModalResult = 1 + TabOrder = 16 + end + object HelpBtn: TButton + Tag = 128 + Left = 10 + Height = 33 + Top = 360 + Width = 86 + Caption = 'Help' + OnClick = HelpBtnClick + TabOrder = 17 + end +end diff --git a/applications/lazstats/source_orig/kappaunit.lrs b/applications/lazstats/source_orig/kappaunit.lrs new file mode 100644 index 000000000..88fde99ed --- /dev/null +++ b/applications/lazstats/source_orig/kappaunit.lrs @@ -0,0 +1,367 @@ +LazarusResources.Add('TWeightedKappaFrm','FORMDATA',[ + 'TPF0'#17'TWeightedKappaFrm'#16'WeightedKappaFrm'#4'Left'#3#132#0#6'Height'#3 + +#154#1#3'Top'#2'p'#5'Width'#3'w'#2#7'Caption'#6#24'Kappa and Weighted Kappa' + +#12'ClientHeight'#3#154#1#11'ClientWidth'#3'w'#2#6'OnShow'#7#8'FormShow'#10 + +'LCLVersion'#6#8'0.9.28.2'#0#6'TLabel'#6'Label1'#4'Left'#2#10#6'Height'#2#14 + +#3'Top'#2'p'#5'Width'#2','#7'Caption'#6#9'Variables'#11'ParentColor'#8#0#0#6 + +'TLabel'#6'Label2'#4'Left'#3#216#0#6'Height'#2#14#3'Top'#3#130#0#5'Width'#2 + +'&'#7'Caption'#6#7'Rater A'#11'ParentColor'#8#0#0#6'TLabel'#6'Label3'#4'Left' + +#3#216#0#6'Height'#2#14#3'Top'#3#209#0#5'Width'#2'%'#7'Caption'#6#7'Rater B' + +#11'ParentColor'#8#0#0#6'TLabel'#6'Label4'#4'Left'#3#216#0#6'Height'#2#14#3 + +'Top'#3#24#1#5'Width'#2']'#7'Caption'#6#19'Variable to Analyze'#11'ParentCol' + +'or'#8#0#0#6'TLabel'#6'Label5'#4'Left'#3'x'#1#6'Height'#2#14#3'Top'#2'p'#5'W' + +'idth'#2'r'#7'Caption'#6#22'Total Number of Cases:'#11'ParentColor'#8#0#0#11 + +'TRadioGroup'#10'InputGroup'#4'Left'#2#9#6'Height'#2'Z'#3'Top'#2#8#5'Width'#3 + +'b'#2#8'AutoFill'#9#7'Caption'#6#14'Input Options:'#28'ChildSizing.LeftRight' + +'Spacing'#2#6#28'ChildSizing.TopBottomSpacing'#2#6#29'ChildSizing.EnlargeHor' + +'izontal'#7#24'crsHomogenousChildResize'#27'ChildSizing.EnlargeVertical'#7#24 + +'crsHomogenousChildResize'#28'ChildSizing.ShrinkHorizontal'#7#14'crsScaleChi' + +'lds'#26'ChildSizing.ShrinkVertical'#7#14'crsScaleChilds'#18'ChildSizing.Lay' + +'out'#7#29'cclLeftToRightThenTopToBottom'#27'ChildSizing.ControlsPerLine'#2#1 + +#12'ClientHeight'#2'H'#11'ClientWidth'#3'^'#2#13'Items.Strings'#1#6'CCount c' + +'ases classified by row and column variables in the data grid'#6'WUse freque' + +'ncies in a variable for a given row variable value and column variable valu' + +'e.'#6'WUse proportions in a variable for a given row variable value and col' + +'umn variable value.'#0#7'OnClick'#7#15'InputGroupClick'#8'TabOrder'#2#0#0#0 + +#8'TListBox'#7'VarList'#4'Left'#2#9#6'Height'#3#212#0#3'Top'#3#128#0#5'Width' + +#3#160#0#10'ItemHeight'#2#0#8'TabOrder'#2#1#0#0#7'TBitBtn'#5'RowIn'#4'Left'#3 + +#176#0#6'Height'#2' '#3'Top'#3#130#0#5'Width'#2#27#10'Glyph.Data'#10':'#4#0#0 + +'6'#4#0#0'BM6'#4#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#16#0#0#0#16#0#0#0#1#0' '#0#0#0 + +#0#0#0#4#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'!c$'#184#29'^ '#6#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0'*p/8%i)'#247'!c$'#217#255#255#255#0#255#255#255 + +#0#255#255#255#0#255#255#255#0'a'#190'm'#255']'#184'h'#255'X'#177'b'#255'S' + +#169'\'#255'M'#161'V'#255'G'#153'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';' + +#255'?'#136'E'#255'Y'#161'^'#255'D'#139'I'#255'!c$'#207#255#255#255#0#255#255 + +#255#0#255#255#255#0'e'#195'q'#255#160#215#169#255#156#213#165#255#152#211 + +#161#255#148#208#157#255#144#206#152#255#139#203#147#255#135#201#142#255#130 + +#198#137#255'~'#195#132#255'z'#193#128#255'v'#190'|'#255'E'#140'J'#255'!c$' + +#196#255#255#255#0#255#255#255#0'h'#199't'#255#165#218#174#255#162#216#171 + +#255#158#214#167#255#154#212#163#255#150#210#159#255#147#207#154#255#142#204 + +#149#255#137#202#144#255#133#199#139#255#129#197#135#255'}'#194#130#255'J' + +#145'P'#255'%i)'#201#255#255#255#0#255#255#255#0'h'#199't'#255'h'#199't'#255 + +'e'#195'q'#255'a'#190'm'#255']'#184'h'#255'X'#177'b'#255'S'#169'\'#255'M'#161 + +'V'#255'G'#153'O'#255'A'#145'I'#255'Z'#163'b'#255'U'#157'\'#255'/x5'#209#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0'A'#145'I'#247';'#136'B'#219#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0'G'#153'O'#187'A'#145'I'#6#255#255#255#0#255#255 + ,#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#7'OnClick'#7#10'RowInClick'#8'TabOrder'#2#2#0#0#7'TBitB' + +'tn'#6'RowOut'#4'Left'#3#176#0#6'Height'#2#22#3'Top'#3#168#0#5'Width'#2#27#10 + +'Glyph.Data'#10':'#4#0#0'6'#4#0#0'BM6'#4#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#16#0#0 + +#0#16#0#0#0#1#0' '#0#0#0#0#0#0#4#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0'M'#161'V'#6'G'#153'O'#184#255#255#255 + +#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0'S'#169'\'#217'M'#161'V'#247'G'#153'O8'#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0']'#184'h'#207'q'#190'{'#255'z'#193#131#255'['#170'd'#255'G' + +#153'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';'#255'/x5'#255'*p/'#255'%i)' + +#255'!c$'#255#29'^ '#255#255#255#255#0#255#255#255#0'e'#195'q'#196'{'#200#134 + +#255#156#213#165#255#152#211#161#255#148#208#157#255#144#206#152#255#139#203 + +#147#255#135#201#142#255#130#198#137#255'~'#195#132#255'z'#193#128#255'v'#190 + +'|'#255'r'#189'x'#255'!c$'#255#255#255#255#0#255#255#255#0'h'#199't'#201#127 + +#204#138#255#162#216#171#255#158#214#167#255#154#212#163#255#150#210#159#255 + +#147#207#154#255#142#204#149#255#137#202#144#255#133#199#139#255#129#197#135 + +#255'}'#194#130#255'x'#192'~'#255'%i)'#255#255#255#255#0#255#255#255#0#255 + +#255#255#0'h'#199't'#209#128#205#139#255'|'#201#135#255']'#184'h'#255'X'#177 + +'b'#255'S'#169'\'#255'M'#161'V'#255'G'#153'O'#255'A'#145'I'#255';'#136'B'#255 + +'5'#128';'#255'/x5'#255'*p/'#255#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0'h'#199't'#219'e'#195'q'#247#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0'h'#199't'#6'h'#199't'#187#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#7'OnClick'#7#11'RowOutClick'#8'Ta' + ,'bOrder'#2#3#0#0#7'TBitBtn'#5'ColIn'#4'Left'#3#176#0#6'Height'#2#22#3'Top'#3 + +#209#0#5'Width'#2#27#10'Glyph.Data'#10':'#4#0#0'6'#4#0#0'BM6'#4#0#0#0#0#0#0 + +'6'#0#0#0'('#0#0#0#16#0#0#0#16#0#0#0#1#0' '#0#0#0#0#0#0#4#0#0'd'#0#0#0'd'#0#0 + +#0#0#0#0#0#0#0#0#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0'!c$'#184#29'^ '#6#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +'*p/8%i)'#247'!c$'#217#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255 + +#0'a'#190'm'#255']'#184'h'#255'X'#177'b'#255'S'#169'\'#255'M'#161'V'#255'G' + +#153'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';'#255'?'#136'E'#255'Y'#161'^' + +#255'D'#139'I'#255'!c$'#207#255#255#255#0#255#255#255#0#255#255#255#0'e'#195 + +'q'#255#160#215#169#255#156#213#165#255#152#211#161#255#148#208#157#255#144 + +#206#152#255#139#203#147#255#135#201#142#255#130#198#137#255'~'#195#132#255 + +'z'#193#128#255'v'#190'|'#255'E'#140'J'#255'!c$'#196#255#255#255#0#255#255 + +#255#0'h'#199't'#255#165#218#174#255#162#216#171#255#158#214#167#255#154#212 + +#163#255#150#210#159#255#147#207#154#255#142#204#149#255#137#202#144#255#133 + +#199#139#255#129#197#135#255'}'#194#130#255'J'#145'P'#255'%i)'#201#255#255 + +#255#0#255#255#255#0'h'#199't'#255'h'#199't'#255'e'#195'q'#255'a'#190'm'#255 + +']'#184'h'#255'X'#177'b'#255'S'#169'\'#255'M'#161'V'#255'G'#153'O'#255'A'#145 + +'I'#255'Z'#163'b'#255'U'#157'\'#255'/x5'#209#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +'A'#145'I'#247';'#136'B'#219#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +'G'#153'O'#187'A'#145'I'#6#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#7'OnClick' + +#7#10'ColInClick'#8'TabOrder'#2#4#0#0#7'TBitBtn'#6'ColOut'#4'Left'#3#176#0#6 + +'Height'#2#22#3'Top'#3#232#0#5'Width'#2#27#10'Glyph.Data'#10':'#4#0#0'6'#4#0 + +#0'BM6'#4#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#16#0#0#0#16#0#0#0#1#0' '#0#0#0#0#0#0 + +#4#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + ,#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0'M'#161'V'#6'G'#153'O'#184#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0'S'#169'\'#217'M'#161'V'#247'G'#153'O8'#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0']'#184'h'#207 + +'q'#190'{'#255'z'#193#131#255'['#170'd'#255'G'#153'O'#255'A'#145'I'#255';' + +#136'B'#255'5'#128';'#255'/x5'#255'*p/'#255'%i)'#255'!c$'#255#29'^ '#255#255 + +#255#255#0#255#255#255#0'e'#195'q'#196'{'#200#134#255#156#213#165#255#152#211 + +#161#255#148#208#157#255#144#206#152#255#139#203#147#255#135#201#142#255#130 + +#198#137#255'~'#195#132#255'z'#193#128#255'v'#190'|'#255'r'#189'x'#255'!c$' + +#255#255#255#255#0#255#255#255#0'h'#199't'#201#127#204#138#255#162#216#171 + +#255#158#214#167#255#154#212#163#255#150#210#159#255#147#207#154#255#142#204 + +#149#255#137#202#144#255#133#199#139#255#129#197#135#255'}'#194#130#255'x' + +#192'~'#255'%i)'#255#255#255#255#0#255#255#255#0#255#255#255#0'h'#199't'#209 + +#128#205#139#255'|'#201#135#255']'#184'h'#255'X'#177'b'#255'S'#169'\'#255'M' + +#161'V'#255'G'#153'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';'#255'/x5'#255 + +'*p/'#255#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'h'#199't' + +#219'e'#195'q'#247#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'h'#199't' + +#6'h'#199't'#187#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#7'OnClick'#7#11'ColOutClick'#8'TabOrder'#2#5#0#0#7'TBit' + +'Btn'#5'DepIn'#4'Left'#3#176#0#6'Height'#2#22#3'Top'#3#24#1#5'Width'#2#27#10 + +'Glyph.Data'#10':'#4#0#0'6'#4#0#0'BM6'#4#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#16#0#0 + +#0#16#0#0#0#1#0' '#0#0#0#0#0#0#4#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +'!c$'#184#29'^ '#6#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'*p/8%i)'#247'!c$'#217 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'a'#190'm'#255']'#184 + +'h'#255'X'#177'b'#255'S'#169'\'#255'M'#161'V'#255'G'#153'O'#255'A'#145'I'#255 + +';'#136'B'#255'5'#128';'#255'?'#136'E'#255'Y'#161'^'#255'D'#139'I'#255'!c$' + +#207#255#255#255#0#255#255#255#0#255#255#255#0'e'#195'q'#255#160#215#169#255 + +#156#213#165#255#152#211#161#255#148#208#157#255#144#206#152#255#139#203#147 + ,#255#135#201#142#255#130#198#137#255'~'#195#132#255'z'#193#128#255'v'#190'|' + +#255'E'#140'J'#255'!c$'#196#255#255#255#0#255#255#255#0'h'#199't'#255#165#218 + +#174#255#162#216#171#255#158#214#167#255#154#212#163#255#150#210#159#255#147 + +#207#154#255#142#204#149#255#137#202#144#255#133#199#139#255#129#197#135#255 + +'}'#194#130#255'J'#145'P'#255'%i)'#201#255#255#255#0#255#255#255#0'h'#199't' + +#255'h'#199't'#255'e'#195'q'#255'a'#190'm'#255']'#184'h'#255'X'#177'b'#255'S' + +#169'\'#255'M'#161'V'#255'G'#153'O'#255'A'#145'I'#255'Z'#163'b'#255'U'#157'\' + +#255'/x5'#209#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0'A'#145'I'#247';'#136'B'#219#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0'G'#153'O'#187'A'#145'I'#6#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#7'OnClick'#7#10'DepInClick'#8'TabOrder'#2 + +#6#0#0#7'TBitBtn'#6'DepOut'#4'Left'#3#176#0#6'Height'#2#20#3'Top'#3'4'#1#5'W' + +'idth'#2#27#10'Glyph.Data'#10':'#4#0#0'6'#4#0#0'BM6'#4#0#0#0#0#0#0'6'#0#0#0 + +'('#0#0#0#16#0#0#0#16#0#0#0#1#0' '#0#0#0#0#0#0#4#0#0'd'#0#0#0'd'#0#0#0#0#0#0 + +#0#0#0#0#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'M'#161'V'#6'G'#153'O' + +#184#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'S'#169'\'#217'M'#161'V' + +#247'G'#153'O8'#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0']'#184'h'#207'q'#190'{'#255'z'#193#131#255 + +'['#170'd'#255'G'#153'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';'#255'/x5' + +#255'*p/'#255'%i)'#255'!c$'#255#29'^ '#255#255#255#255#0#255#255#255#0'e'#195 + +'q'#196'{'#200#134#255#156#213#165#255#152#211#161#255#148#208#157#255#144 + +#206#152#255#139#203#147#255#135#201#142#255#130#198#137#255'~'#195#132#255 + +'z'#193#128#255'v'#190'|'#255'r'#189'x'#255'!c$'#255#255#255#255#0#255#255 + +#255#0'h'#199't'#201#127#204#138#255#162#216#171#255#158#214#167#255#154#212 + +#163#255#150#210#159#255#147#207#154#255#142#204#149#255#137#202#144#255#133 + +#199#139#255#129#197#135#255'}'#194#130#255'x'#192'~'#255'%i)'#255#255#255 + +#255#0#255#255#255#0#255#255#255#0'h'#199't'#209#128#205#139#255'|'#201#135 + +#255']'#184'h'#255'X'#177'b'#255'S'#169'\'#255'M'#161'V'#255'G'#153'O'#255'A' + +#145'I'#255';'#136'B'#255'5'#128';'#255'/x5'#255'*p/'#255#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0'h'#199't'#219'e'#195'q'#247#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0'h'#199't'#6'h'#199't'#187#255#255#255 + +#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + ,#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#7'OnClick' + +#7#11'DepOutClick'#8'TabOrder'#2#7#0#0#5'TEdit'#10'RaterAEdit'#4'Left'#3#216 + +#0#6'Height'#2#21#3'Top'#3#144#0#5'Width'#2'x'#8'TabOrder'#2#8#4'Text'#6#10 + +'RaterAEdit'#0#0#5'TEdit'#10'RaterBEdit'#4'Left'#3#216#0#6'Height'#2#21#3'To' + +'p'#3#224#0#5'Width'#2'x'#8'TabOrder'#2#9#4'Text'#6#5'Edit1'#0#0#5'TEdit'#7 + +'DepEdit'#4'Left'#3#216#0#6'Height'#2#21#3'Top'#3'('#1#5'Width'#2'x'#8'TabOr' + +'der'#2#10#4'Text'#6#5'Edit1'#0#0#5'TEdit'#10'NCasesEdit'#4'Left'#3#240#1#6 + +'Height'#2#21#3'Top'#2'i'#5'Width'#2'>'#8'TabOrder'#2#11#4'Text'#6#10'NCases' + +'Edit'#0#0#9'TGroupBox'#9'GroupBox1'#4'Left'#3'x'#1#6'Height'#3#197#0#3'Top' + +#3#136#0#5'Width'#3#242#0#7'Caption'#6#8'Options:'#12'ClientHeight'#3#179#0 + +#11'ClientWidth'#3#238#0#8'TabOrder'#2#12#0#9'TCheckBox'#6'ObsChk'#4'Left'#2 + +#9#6'Height'#2#17#3'Top'#2#2#5'Width'#3#157#0#7'Caption'#6#25'Show Observed ' + +'Frequencies'#8'TabOrder'#2#0#0#0#9'TCheckBox'#6'ExpChk'#4'Left'#2#9#6'Heigh' + +'t'#2#17#3'Top'#2#25#5'Width'#3#155#0#7'Caption'#6#25'Show Expected Frequenc' + +'ies'#8'TabOrder'#2#1#0#0#9'TCheckBox'#7'PropChk'#4'Left'#2#9#6'Height'#2#17 + +#3'Top'#2'2'#5'Width'#3#187#0#7'Caption'#6#31'Show Row and Column Proportion' + +'s'#8'TabOrder'#2#2#0#0#9'TCheckBox'#6'ChiChk'#4'Left'#2#9#6'Height'#2#17#3 + +'Top'#2'M'#5'Width'#3#155#0#7'Caption'#6#27'Show Cell Chi Square Values'#8'T' + +'abOrder'#2#3#0#0#9'TCheckBox'#8'YatesChk'#4'Left'#2#9#6'Height'#2#17#3'Top' + +#2'h'#5'Width'#3#209#0#7'Caption'#6'(Use Yates'' Correction for a 2 by 2 tab' + +'le'#8'TabOrder'#2#4#0#0#9'TCheckBox'#7'SaveChk'#4'Left'#2#9#6'Height'#2#17#3 + +'Top'#3#130#0#5'Width'#3#179#0#7'Caption'#6' Save as a File of Frequency Dat' + +'a'#8'TabOrder'#2#5#0#0#0#7'TButton'#8'ResetBtn'#4'Left'#3#136#0#6'Height'#2 + +'!'#3'Top'#3'h'#1#5'Width'#2'O'#7'Caption'#6#5'Reset'#7'OnClick'#7#13'ResetB' + +'tnClick'#8'TabOrder'#2#13#0#0#7'TButton'#6'Cancel'#4'Left'#3#1#1#6'Height'#2 + +'!'#3'Top'#3'h'#1#5'Width'#2'O'#7'Caption'#6#6'Cancel'#11'ModalResult'#2#2#8 + +'TabOrder'#2#14#0#0#7'TButton'#10'ComputeBtn'#4'Left'#3'x'#1#6'Height'#2'!'#3 + +'Top'#3'h'#1#5'Width'#2'O'#7'Caption'#6#7'Compute'#7'OnClick'#7#15'ComputeBt' + +'nClick'#8'TabOrder'#2#15#0#0#7'TButton'#9'ReturnBtn'#4'Left'#3#240#1#6'Heig' + +'ht'#2'!'#3'Top'#3'h'#1#5'Width'#2'O'#7'Caption'#6#6'Return'#11'ModalResult' + +#2#1#8'TabOrder'#2#16#0#0#7'TButton'#7'HelpBtn'#3'Tag'#3#128#0#4'Left'#2#10#6 + +'Height'#2'!'#3'Top'#3'h'#1#5'Width'#2'V'#7'Caption'#6#4'Help'#7'OnClick'#7 + +#12'HelpBtnClick'#8'TabOrder'#2#17#0#0#0 +]); diff --git a/applications/lazstats/source_orig/kappaunit.pas b/applications/lazstats/source_orig/kappaunit.pas new file mode 100644 index 000000000..14f34a9a6 --- /dev/null +++ b/applications/lazstats/source_orig/kappaunit.pas @@ -0,0 +1,670 @@ +unit KappaUnit; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, + StdCtrls, ExtCtrls, Buttons, MainUnit, Globals, OutPutUnit, FunctionsLib, + Math, DictionaryUnit, DataProcs, MatrixLib, contexthelpunit; + +type + + { TWeightedKappaFrm } + + TWeightedKappaFrm = class(TForm) + HelpBtn: TButton; + ResetBtn: TButton; + Cancel: TButton; + ComputeBtn: TButton; + ReturnBtn: TButton; + ObsChk: TCheckBox; + ExpChk: TCheckBox; + PropChk: TCheckBox; + ChiChk: TCheckBox; + YatesChk: TCheckBox; + SaveChk: TCheckBox; + GroupBox1: TGroupBox; + NCasesEdit: TEdit; + Label5: TLabel; + RowIn: TBitBtn; + RowOut: TBitBtn; + ColIn: TBitBtn; + ColOut: TBitBtn; + DepIn: TBitBtn; + DepOut: TBitBtn; + RaterAEdit: TEdit; + RaterBEdit: TEdit; + DepEdit: TEdit; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + Label4: TLabel; + VarList: TListBox; + InputGroup: TRadioGroup; + procedure ColInClick(Sender: TObject); + procedure ColOutClick(Sender: TObject); + procedure ComputeBtnClick(Sender: TObject); + procedure DepInClick(Sender: TObject); + procedure DepOutClick(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure HelpBtnClick(Sender: TObject); + procedure InputGroupClick(Sender: TObject); + procedure ResetBtnClick(Sender: TObject); + procedure RowInClick(Sender: TObject); + procedure RowOutClick(Sender: TObject); + private + { private declarations } + public + { public declarations } + end; + +var + WeightedKappaFrm: TWeightedKappaFrm; + +implementation + +{ TWeightedKappaFrm } + +procedure TWeightedKappaFrm.ResetBtnClick(Sender: TObject); +VAR i : integer; +begin + VarList.Clear; + RaterAEdit.Text := ''; + RaterBEdit.Text := ''; + DepEdit.Text := ''; + DepEdit.Visible := false; + RowIn.Visible := true; + RowOut.Visible := false; + ColIn.Visible := true; + ColOut.Visible := false; + DepIn.Visible := false; + DepOut.Visible := false; + NCasesEdit.Text := ''; + NCasesEdit.Visible := false; + Label4.Visible := false; + Label5.Visible := false; + InputGroup.ItemIndex := 0; + for i := 1 to NoVariables do + VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]); +end; + +procedure TWeightedKappaFrm.RowInClick(Sender: TObject); +VAR index : integer; +begin + index := VarList.ItemIndex; + RaterAEdit.Text := VarList.Items.Strings[index]; + VarList.Items.Delete(index); + RowIn.Visible := false; + RowOut.Visible := true; +end; + +procedure TWeightedKappaFrm.RowOutClick(Sender: TObject); +begin + VarList.Items.Add(RaterAEdit.Text); + RaterAEdit.Text := ''; + RowIn.Visible := true; + RowOut.Visible := false; +end; + +procedure TWeightedKappaFrm.FormShow(Sender: TObject); +begin + ResetBtnClick(self); +end; + +procedure TWeightedKappaFrm.HelpBtnClick(Sender: TObject); +begin + ContextHelpForm.HelpMessage((Sender as TButton).tag); +end; + +procedure TWeightedKappaFrm.InputGroupClick(Sender: TObject); +VAR index : integer; +begin + index := InputGroup.ItemIndex; + if (index = 2) then // only proportions available - get N size + begin + Label4.Visible := true; + NCasesEdit.Visible := true; + NCasesEdit.SetFocus; + DepIn.Visible := true; + DepOut.Visible := false; + DepEdit.Visible := true; + Label5.Visible := true; + end; + if (index = 1) then // frequencies available for each row and column combo + begin + Label4.Visible := true; + NCasesEdit.Visible := false; + DepIn.Visible := true; + DepOut.Visible := false; + DepEdit.Visible := true; + Label5.Visible := false; + end; + if (index = 0) then // have to count cases in each row and col. combination + begin + NCasesEdit.Visible := false; + DepIn.Visible := false; + DepOut.Visible := false; + DepEdit.Visible := false; + Label4.Visible := false; + Label5.Visible := false; + end; +end; + +procedure TWeightedKappaFrm.ColInClick(Sender: TObject); +VAR index : integer; +begin + index := VarList.ItemIndex; + RaterBEdit.Text := VarList.Items.Strings[index]; + VarList.Items.Delete(index); + ColIn.Visible := false; + ColOut.Visible := true; +end; + +procedure TWeightedKappaFrm.ColOutClick(Sender: TObject); +begin + VarList.Items.Add(RaterBEdit.Text); + RaterBEdit.Text := ''; + ColIn.Visible := true; + ColOut.Visible := false; +end; + +procedure TWeightedKappaFrm.ComputeBtnClick(Sender: TObject); +VAR + i, j, k, RowNo, ColNo, DepNo, MinRow, MaxRow, MinCol, MaxCol : integer; + Row, Col, NoSelected, Ncases, Nrows, Ncols, FObs, df : integer; + RowLabels, ColLabels : StrDyneVec; + ColNoSelected : IntDyneVec; + cellstring : string; + outline : string; + Freq : IntDyneMat; + Prop, Expected, CellChi : DblDyneMat; + PObs, ChiSquare, ProbChi, liklihood, Fval, phi : double; + yates, aresult : boolean; + title : string; + filename : string; + Adjchisqr, Adjprobchi, probliklihood, pearsonr : double; + pobserved, SumX, SumY, VarX, VarY, obsdiag, expdiag, expnondiag : double; + pexpected, MantelHaenszel, MHprob, CoefCont, CramerV, Kappa : double; + Frq : integer; + weights, quadweights : DblDyneMat; +begin + SetLength(ColNoSelected,NoVariables); + yates := false; + RowNo := 0; + ColNo := 0; + DepNo := 0; + pobserved := 0.0; + pexpected := 0.0; + + for i := 1 to NoVariables do + begin + cellstring := OS3MainFrm.DataGrid.Cells[i,0]; + if (cellstring = RaterAEdit.Text) then RowNo := i; + if (cellstring = RaterBEdit.Text) then ColNo := i; + if (cellstring = DepEdit.Text) then DepNo := i; + end; + if ((InputGroup.ItemIndex > 0) and (DepNo = 0)) then + begin + ShowMessage('ERROR! You must select a dependent variable.'); + ColNoSelected := nil; + exit; + end; + if ((RowNo = 0) or (ColNo = 0)) then // || (DepNo == 0)) + begin + ShowMessage('ERROR! A required variable has not been selected.'); + ColNoSelected := nil; + exit; + end; + + aresult := ValidValue(RowNo,1); + if (aresult = false) then + begin + ColNoSelected := nil; + exit; + end; + aresult := ValidValue(ColNo,1); + if (aresult = false) then + begin + ColNoSelected := nil; + exit; + end; + + ColNoSelected[0] := RowNo; + ColNoSelected[1] := ColNo; + NoSelected := 2; + if (InputGroup.ItemIndex > 0) then // for reading proportions or frequencies + begin + NoSelected := 3; + ColNoSelected[2] := DepNo; + end; + if (InputGroup.ItemIndex = 1) then + begin + aresult := ValidValue(DepNo,1); + if (aresult = false) then + begin + ColNoSelected := nil; + exit; + end; + end; + if (InputGroup.ItemIndex = 2) then + begin + aresult := ValidValue(DepNo,0); + if (aresult = false) then + begin + ColNoSelected := nil; + exit; + end; + end; + + // get min and max of row and col numbers + MinRow := 1000; + MaxRow := 0; + MinCol := 1000; + MaxCol := 0; + for i := 1 to NoCases do + begin + if (NOT GoodRecord(i,NoSelected,ColNoSelected)) then continue; + Row := StrToInt(OS3MainFrm.DataGrid.Cells[RowNo,i]); + Col := StrToInt(OS3MainFrm.DataGrid.Cells[ColNo,i]); + if (Row > MaxRow) then MaxRow := Row; + if (Row < MinRow) then MinRow := Row; + if (Col > MaxCol) then MaxCol := Col; + if (Col < MinCol) then MinCol := Col; + end; + Nrows := MaxRow - MinRow + 1; + Ncols := MaxCol - MinCol + 1; + + // allocate and initialize + SetLength(Freq,Nrows+1,Ncols+1); + SetLength(Prop,Nrows+1,Ncols+1); + SetLength(Expected,Nrows,Ncols); + SetLength(CellChi,Nrows,Ncols); + SetLength(RowLabels,Nrows+1); + SetLength(ColLabels,Ncols+1); + for i := 1 to Nrows + 1 do + for j := 1 to Ncols + 1 do Freq[i-1,j-1] := 0; + for i := 1 to Nrows do + begin + outline := format('Row %d',[i]); + cellstring := outline; + RowLabels[i-1] := cellstring; + end; + RowLabels[Nrows] := 'Total'; + for j := 1 to Ncols do + begin + outline := format('COL. %d',[j]); + cellstring := outline; + ColLabels[j-1] := cellstring; + end; + ColLabels[Ncols] := 'Total'; + + // get cell data + Ncases := 0; + if (InputGroup.ItemIndex = 0) then + begin // count number of cases in each row and column combination + for i := 1 to NoCases do + begin + if (NOT GoodRecord(i,NoSelected,ColNoSelected)) then continue; + Ncases := Ncases + 1; + Row := StrToInt(OS3MainFrm.DataGrid.Cells[RowNo,i]); + Col := StrToInt(OS3MainFrm.DataGrid.Cells[ColNo,i]); + Row := Row - MinRow + 1; + Col := Col - MinCol + 1; + Freq[Row-1,Col-1] := Freq[Row-1,Col-1] + 1; + end; + end; + + if (InputGroup.ItemIndex = 1) then // read frequencies data from grid + begin + for i := 1 to NoCases do + begin + if (NOT GoodRecord(i,NoSelected,ColNoSelected)) then continue; + Row := StrToInt(OS3MainFrm.DataGrid.Cells[RowNo,i]); + Col := StrToInt(OS3MainFrm.DataGrid.Cells[ColNo,i]); + Row := Row - MinRow + 1; + Col := Col - MinCol + 1; + FObs := StrToInt(OS3MainFrm.DataGrid.Cells[DepNo,i]); + Freq[Row-1,Col-1] := Freq[Row-1,Col-1] + FObs; + Ncases := Ncases + FObs; + end; + end; + if (InputGroup.ItemIndex = 2) then // get no. of cases and proportions for each cell + begin + Ncases := StrToInt(NCasesEdit.Text); + for i := 1 to NoCases do + begin + if (NOT GoodRecord(i,NoSelected,ColNoSelected)) then continue; + Row := StrToInt(OS3MainFrm.DataGrid.Cells[RowNo,i]); + Col := StrToInt(OS3MainFrm.DataGrid.Cells[ColNo,i]); + Row := Row - MinRow + 1; + Col := Col - MinCol + 1; + PObs := StrToInt(OS3MainFrm.DataGrid.Cells[DepNo,i]); + Frq := round(PObs * Ncases); + Fval := PObs * Ncases; + if (Fval - Frq < 0.5) then Frq := round(Fval) + else Frq := ceil(Fval); + Freq[Row-1,Col-1] := Freq[Row-1,Col-1] + Frq; + end; + end; + Freq[Nrows,Ncols] := Ncases; + + // Now, calculate expected values + // Get row totals first + for i := 1 to Nrows do + begin + for j := 1 to Ncols do + begin + Freq[i-1,Ncols] := Freq[i-1,Ncols] + Freq[i-1,j-1]; + end; + end; + // Get col totals next + for j := 1 to Ncols do + begin + for i := 1 to Nrows do + begin + Freq[Nrows,j-1] := Freq[Nrows,j-1] + Freq[i-1,j-1]; + end; + end; + // Then get expected values and cell chi-squares + ChiSquare := 0.0; + Adjchisqr := 0.0; + if ((YatesChk.Checked) and (Nrows = 2) and (Ncols = 2)) then yates := true; + for i := 1 to Nrows do + begin + for j := 1 to Ncols do + begin + Expected[i-1,j-1] := Freq[Nrows,j-1] * Freq[i-1,Ncols] / Ncases; + if (Expected[i-1,j-1] > 0.0) then + CellChi[i-1,j-1] := sqr(Freq[i-1,j-1] - Expected[i-1,j-1]) + / Expected[i-1,j-1] + else + begin + ShowMessage('ERROR! Zero expected value found.'); + CellChi[i-1,j-1] := 0.0; + end; + ChiSquare := ChiSquare + CellChi[i-1,j-1]; + end; + end; + df := (Nrows - 1) * (Ncols - 1); + if (yates = true) then // 2 x 2 corrected chi-square + begin + Adjchisqr := abs((Freq[0,0] * Freq[1,1]) - (Freq[0,1] * Freq[1,0])); + Adjchisqr := sqr(Adjchisqr - Ncases / 2.0) * Ncases; // numerator + Adjchisqr := Adjchisqr / (Freq[0,2] * Freq[1,2] * Freq[2,0] * Freq[2,1]); + Adjprobchi := 1.0 - chisquaredprob(Adjchisqr,df); + end; + ProbChi := 1.0 - chisquaredprob(ChiSquare,df); // prob. larger chi + + //Print results to output form + OutPutFrm.RichEdit.Clear; + OutPutFrm.RichEdit.Lines.Add('Chi-square Analysis Results for ' + RaterAEdit.Text + ' and ' + RaterBEdit.Text); + outline := format('No. of Cases = %d',[Ncases]); + OutPutFrm.RichEdit.Lines.Add(outline); + OutPutFrm.RichEdit.Lines.Add(''); + + // print tables requested by use + if (ObsChk.Checked) then + begin + IntArrayPrint(Freq, Nrows+1, Ncols+1,'Frequencies', + RowLabels, ColLabels,'OBSERVED FREQUENCIES'); + end; + + if (ExpChk.Checked) then + begin + outline := 'EXPECTED FREQUENCIES'; + MAT_PRINT(Expected, Nrows, Ncols, outline, RowLabels, ColLabels, + NoCases); + end; + + if (PropChk.Checked) then + begin + outline := 'ROW PROPORTIONS'; + for i := 1 to Nrows + 1 do + begin + for j := 1 to Ncols do + begin + if (Freq[i-1,Ncols] > 0.0) then + Prop[i-1,j-1] := Freq[i-1,j-1] / Freq[i-1,Ncols] + else Prop[i-1,j-1] := 0.0; + end; + if (Freq[i-1,Ncols] > 0.0) then Prop[i-1,Ncols] := 1.0 + else Prop[i-1][Ncols] := 0.0; + end; + MAT_PRINT(Prop, Nrows+1, Ncols+1, outline, RowLabels, ColLabels, + NoCases); + outline := 'COLUMN PROPORTIONS'; + for j := 1 to Ncols + 1 do + begin + for i := 1 to Nrows do + begin + if (Freq[Nrows,j-1] > 0.0) then + Prop[i-1,j-1] := Freq[i-1,j-1] / Freq[Nrows,j-1] + else Prop[i-1,j-1] := 0.0; + end; + if (Freq[Nrows,j-1] > 0.0) then Prop[Nrows][j-1] := 1.0 + else Prop[Nrows,j-1] := 0.0; + end; + MAT_PRINT(Prop, Nrows+1, Ncols+1, outline, RowLabels, ColLabels, + NoCases); + outline := 'PROPORTIONS OF TOTAL N'; + for i := 1 to Nrows + 1 do + for j := 1 to Ncols + 1 do Prop[i-1,j-1] := Freq[i-1,j-1] / Ncases; + Prop[Nrows,Ncols] := 1.0; + MAT_PRINT(Prop, Nrows+1, Ncols+1, outline, RowLabels, ColLabels, + NoCases); + end; + + if (ChiChk.Checked) then + begin + outline := 'CHI-SQUARED VALUE FOR CELLS'; + MAT_PRINT(CellChi, Nrows, Ncols, outline, RowLabels, ColLabels, + NoCases); + end; + + OutPutFrm.RichEdit.Lines.Add(''); + outline := format('Chi-square = %8.3f with D.F. = %d. Prob. > value = %8.3f', + [ChiSquare,df,ProbChi]); + OutPutFrm.RichEdit.Lines.Add(outline); + OutPutFrm.RichEdit.Lines.Add(''); + if (yates = true) then + begin + outline := format('Chi-square using Yates correction = %8.3f and Prob > value = %8.3f', + [Adjchisqr,Adjprobchi]); + OutPutFrm.RichEdit.Lines.Add(outline); + end; + + liklihood := 0.0; + for i := 0 to Nrows - 1 do + for j := 0 to Ncols - 1 do + liklihood := Liklihood + Freq[i,j] * (ln(Expected[i,j] / Freq[i,j])); + liklihood := -2.0 * liklihood; + probliklihood := 1.0 - chisquaredprob(liklihood,df); + outline := format('Liklihood Ratio = %8.3f with prob. > value = %6.4f', + [liklihood,probliklihood]); + OutPutFrm.RichEdit.Lines.Add(outline); + OutPutFrm.RichEdit.Lines.Add(''); + + phi := sqrt(ChiSquare / Ncases); + outline := format('phi correlation = %6.4f',[phi]); + OutPutFrm.RichEdit.Lines.Add(outline); + OutPutFrm.RichEdit.Lines.Add(''); + + pearsonr := 0.0; + SumX := 0.0; + SumY := 0.0; + VarX := 0.0; + VarY := 0.0; + for i := 0 to Nrows - 1 do SumX := SumX + ( (i+1) * Freq[i,Ncols] ); + for j := 0 to Ncols - 1 do SumY := SumY + ( (j+1) * Freq[Nrows,j] ); + for i := 0 to Nrows - 1 do VarX := VarX + ( ((i+1)*(i+1)) * Freq[i,Ncols] ); + for j := 0 to Ncols - 1 do VarY := VarY + ( ((j+1)*(j+1)) * Freq[Nrows,j] ); + VarX := VarX - ((SumX * SumX) / Ncases); + VarY := VarY - ((SumY * SumY) / Ncases); + for i := 0 to Nrows - 1 do + for j := 0 to Ncols - 1 do + pearsonr := pearsonr + ((i+1)*(j+1) * Freq[i,j]); + pearsonr := pearsonr - (SumX * SumY / Ncases); + pearsonr := pearsonr / sqrt(VarX * VarY); + outline := format('Pearson Correlation r = %6.4f',[pearsonr]); + OutPutFrm.RichEdit.Lines.Add(outline); + OutPutFrm.RichEdit.Lines.Add(''); + + MantelHaenszel := (Ncases-1) * (pearsonr * pearsonr); + MHprob := 1.0 - chisquaredprob(MantelHaenszel,1); + outline := format('Mantel-Haenszel Test of Linear Association = %8.3f with probability > value = %6.4f', + [MantelHaenszel, MHprob]); + OutPutFrm.RichEdit.Lines.Add(outline); + OutPutFrm.RichEdit.Lines.Add(''); + + CoefCont := sqrt(ChiSquare / (ChiSquare + Ncases)); + outline := format('The coefficient of contingency = %8.3f',[CoefCont]); + OutPutFrm.RichEdit.Lines.Add(outline); + OutPutFrm.RichEdit.Lines.Add(''); + + if (Nrows < Ncols) then CramerV := sqrt(ChiSquare / (Ncases * ((Nrows-1)))) + else CramerV := sqrt(ChiSquare / (Ncases * ((Ncols-1)))); + outline := format('Cramers V = %8.3f',[CramerV]); + OutPutFrm.RichEdit.Lines.Add(outline); + + // kappa + if (Nrows = Ncols) then + begin + obsdiag := 0.0; + expdiag := 0.0; + for i := 0 to Nrows - 1 do + begin + obsdiag := obsdiag + Freq[i,i]; + expdiag := expdiag + Expected[i,i]; + end; + expnondiag := Ncases - expdiag; + Kappa := (obsdiag - expdiag) / expnondiag; + OutPutFrm.RichEdit.Lines.Add(''); + outline := format('Unweighted Kappa = %8.4f',[Kappa]); + OutPutFrm.RichEdit.Lines.Add(outline); + // get linear weights + SetLength(weights,Nrows,Ncols); + SetLength(quadweights,Nrows,Ncols); + for i := 0 to Nrows - 1 do + begin + for j := 0 to Ncols - 1 do + begin + weights[i,j] := 0.0; + quadweights[i,j] := 0.0; + end; + end; + for i := 0 to Nrows - 1 do + begin + for j := 0 to Ncols - 1 do + begin + weights[i,j] := 1.0 - (abs((i-j)) / (Nrows-1)); + quadweights[i,j] := 1.0 - ( abs((i-j)*(i-j)) / ((Nrows-1)*(Nrows-1)) ); + end; + end; + outline := 'Observed Linear Weights'; + MAT_PRINT(weights, Nrows, Ncols, outline, RowLabels, ColLabels, NoCases); + outline := 'Observed Quadratic Weights'; + MAT_PRINT(quadweights, Nrows, Ncols, outline, RowLabels, ColLabels, NoCases); + OutPutFrm.RichEdit.Lines.Add(''); + for i := 0 to Nrows - 1 do + begin + for j := 0 to Ncols - 1 do + begin + pobserved := pobserved + (Freq[i][j] / Ncases) * weights[i,j]; + pexpected := pexpected + (Expected[i,j] / Ncases) * weights[i,j]; + end; + end; + Kappa := (pobserved - pexpected) / (1.0 - pexpected); + outline := format('Linear Weighted Kappa = %8.4f',[Kappa]); + OutPutFrm.RichEdit.Lines.Add(outline); + pobserved := 0.0; + pexpected := 0.0; + for i := 0 to Nrows - 1 do + begin + for j := 0 to Ncols - 1 do + begin + pobserved := pobserved + (Freq[i,j] / Ncases) * quadweights[i,j]; + pexpected := pexpected + (Expected[i,j] / Ncases) * quadweights[i,j]; + end; + end; + Kappa := (pobserved - pexpected) / (1.0 - pexpected); + outline := format('Quadratic Weighted Kappa = %8.4f',[Kappa]); + OutPutFrm.RichEdit.Lines.Add(outline); + quadweights := nil; + weights := nil; + end; + + OutPutFrm.ShowModal; + OutPutFrm.RichEdit.Clear; + + // save frequency data file if elected + if ((SaveChk.Checked) and (InputGroup.ItemIndex = 0)) then + begin + ClearGrid; + for i := 1 to 3 do DictionaryFrm.NewVar(i); + DictionaryFrm.DictGrid.Cells[1,1] := 'ROW'; + DictionaryFrm.DictGrid.Cells[1,2] := 'COL'; + DictionaryFrm.DictGrid.Cells[1,3] := 'FREQ.'; + OS3MainFrm.DataGrid.Cells[1,0] := 'ROW'; + OS3MainFrm.DataGrid.Cells[2,0] := 'COL'; + OS3MainFrm.DataGrid.Cells[3,0] := 'Freq.'; + k := 1; + for i := 1 to Nrows do + begin + for j := 1 to Ncols do + begin + OS3MainFrm.DataGrid.RowCount := k + 1; + OS3MainFrm.DataGrid.Cells[1,k] := IntToStr(i); + OS3MainFrm.DataGrid.Cells[2,k] := IntToStr(j); + OS3MainFrm.DataGrid.Cells[3,k] := IntToStr(Freq[i-1,j-1]); + k := k + 1; + end; + end; + for i := 1 to k - 1 do + begin + title := 'CASE ' + IntToStr(i); + OS3MainFrm.DataGrid.Cells[0,i] := title; + end; + title := InputBox('FILE:','File Name:','Frequencies.LAZ'); + OS3MainFrm.FileNameEdit.Text := title; + OS3MainFrm.NoVarsEdit.Text := IntToStr(3); + OS3MainFrm.NoCasesEdit.Text := IntToStr(k-1); + NoVariables := 3; + NoCases := k-1; + SaveOS2File; + end; + + //clean up + ColLabels := nil; + RowLabels := nil; + CellChi := nil; + Expected := nil; + Prop := nil; + Freq := nil; + ColNoSelected := nil; +end; + +procedure TWeightedKappaFrm.DepInClick(Sender: TObject); +VAR index : integer; +begin + index := VarList.ItemIndex; + DepEdit.Text := VarList.Items.Strings[index]; + VarList.Items.Delete(index); + DepIn.Visible := false; + DepOut.Visible := true; +end; + +procedure TWeightedKappaFrm.DepOutClick(Sender: TObject); +begin + VarList.Items.Add(DepEdit.Text); + DepEdit.Text := ''; + DepIn.Visible := true; + DepOut.Visible := false; +end; + +initialization + {$I kappaunit.lrs} + +end. + diff --git a/applications/lazstats/source_orig/kendalltauunit.lfm b/applications/lazstats/source_orig/kendalltauunit.lfm new file mode 100644 index 000000000..189763d52 --- /dev/null +++ b/applications/lazstats/source_orig/kendalltauunit.lfm @@ -0,0 +1,398 @@ +object KendallTauFrm: TKendallTauFrm + Left = 132 + Height = 348 + Top = 97 + Width = 352 + Caption = 'Kendall Rank Correlation Tau and Partial Tau' + ClientHeight = 348 + ClientWidth = 352 + OnShow = FormShow + LCLVersion = '0.9.26.2' + object Label1: TLabel + Left = 5 + Height = 14 + Top = 5 + Width = 90 + Caption = 'Variables Available' + ParentColor = False + end + object Label2: TLabel + Left = 214 + Height = 14 + Top = 25 + Width = 48 + Caption = 'X Variable' + ParentColor = False + end + object Label3: TLabel + Left = 217 + Height = 14 + Top = 105 + Width = 48 + Caption = 'Y Variable' + ParentColor = False + end + object Label4: TLabel + Left = 216 + Height = 14 + Top = 184 + Width = 48 + Caption = 'Z Variable' + ParentColor = False + end + object VarList: TListBox + Left = 6 + Height = 254 + Top = 21 + Width = 160 + TabOrder = 0 + end + object XIn: TBitBtn + Left = 176 + Height = 28 + Top = 22 + Width = 32 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00216324B81D5E2006FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF002A702F38256929F7216324D9FFFFFF00FFFFFF00FFFFFF00FFFFFF0061BE + 6DFF5DB868FF58B162FF53A95CFF4DA156FF47994FFF419149FF3B8842FF3580 + 3BFF3F8845FF59A15EFF448B49FF216324CFFFFFFF00FFFFFF00FFFFFF0065C3 + 71FFA0D7A9FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF458C4AFF216324C4FFFFFF00FFFFFF0068C7 + 74FFA5DAAEFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF4A9150FF256929C9FFFFFF00FFFFFF0068C7 + 74FF68C774FF65C371FF61BE6DFF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF5AA362FF559D5CFF2F7835D1FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00419149F73B8842DBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0047994FBB41914906FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + NumGlyphs = 0 + OnClick = XInClick + TabOrder = 1 + end + object XOut: TBitBtn + Left = 176 + Height = 28 + Top = 56 + Width = 32 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF004DA1560647994FB8FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0053A95CD94DA156F747994F38FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF005DB868CF71BE7BFF7AC183FF5BAA64FF47994FFF419149FF3B8842FF3580 + 3BFF2F7835FF2A702FFF256929FF216324FF1D5E20FFFFFFFF00FFFFFF0065C3 + 71C47BC886FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF72BD78FF216324FFFFFFFF00FFFFFF0068C7 + 74C97FCC8AFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF78C07EFF256929FFFFFFFF00FFFFFF00FFFF + FF0068C774D180CD8BFF7CC987FF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF3B8842FF35803BFF2F7835FF2A702FFFFFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C774DB65C371F7FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C7740668C774BBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + NumGlyphs = 0 + OnClick = XOutClick + TabOrder = 2 + end + object YIn: TBitBtn + Left = 176 + Height = 28 + Top = 104 + Width = 32 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00216324B81D5E2006FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF002A702F38256929F7216324D9FFFFFF00FFFFFF00FFFFFF00FFFFFF0061BE + 6DFF5DB868FF58B162FF53A95CFF4DA156FF47994FFF419149FF3B8842FF3580 + 3BFF3F8845FF59A15EFF448B49FF216324CFFFFFFF00FFFFFF00FFFFFF0065C3 + 71FFA0D7A9FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF458C4AFF216324C4FFFFFF00FFFFFF0068C7 + 74FFA5DAAEFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF4A9150FF256929C9FFFFFF00FFFFFF0068C7 + 74FF68C774FF65C371FF61BE6DFF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF5AA362FF559D5CFF2F7835D1FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00419149F73B8842DBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0047994FBB41914906FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + NumGlyphs = 0 + OnClick = YInClick + TabOrder = 3 + end + object YOut: TBitBtn + Left = 175 + Height = 28 + Top = 136 + Width = 32 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF004DA1560647994FB8FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0053A95CD94DA156F747994F38FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF005DB868CF71BE7BFF7AC183FF5BAA64FF47994FFF419149FF3B8842FF3580 + 3BFF2F7835FF2A702FFF256929FF216324FF1D5E20FFFFFFFF00FFFFFF0065C3 + 71C47BC886FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF72BD78FF216324FFFFFFFF00FFFFFF0068C7 + 74C97FCC8AFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF78C07EFF256929FFFFFFFF00FFFFFF00FFFF + FF0068C774D180CD8BFF7CC987FF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF3B8842FF35803BFF2F7835FF2A702FFFFFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C774DB65C371F7FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C7740668C774BBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + NumGlyphs = 0 + OnClick = YOutClick + TabOrder = 4 + end + object ZIn: TBitBtn + Left = 176 + Height = 28 + Top = 184 + Width = 32 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00216324B81D5E2006FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF002A702F38256929F7216324D9FFFFFF00FFFFFF00FFFFFF00FFFFFF0061BE + 6DFF5DB868FF58B162FF53A95CFF4DA156FF47994FFF419149FF3B8842FF3580 + 3BFF3F8845FF59A15EFF448B49FF216324CFFFFFFF00FFFFFF00FFFFFF0065C3 + 71FFA0D7A9FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF458C4AFF216324C4FFFFFF00FFFFFF0068C7 + 74FFA5DAAEFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF4A9150FF256929C9FFFFFF00FFFFFF0068C7 + 74FF68C774FF65C371FF61BE6DFF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF5AA362FF559D5CFF2F7835D1FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00419149F73B8842DBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0047994FBB41914906FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + NumGlyphs = 0 + OnClick = ZInClick + TabOrder = 5 + end + object ZOut: TBitBtn + Left = 176 + Height = 28 + Top = 216 + Width = 32 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF004DA1560647994FB8FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0053A95CD94DA156F747994F38FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF005DB868CF71BE7BFF7AC183FF5BAA64FF47994FFF419149FF3B8842FF3580 + 3BFF2F7835FF2A702FFF256929FF216324FF1D5E20FFFFFFFF00FFFFFF0065C3 + 71C47BC886FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF72BD78FF216324FFFFFFFF00FFFFFF0068C7 + 74C97FCC8AFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF78C07EFF256929FFFFFFFF00FFFFFF00FFFF + FF0068C774D180CD8BFF7CC987FF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF3B8842FF35803BFF2F7835FF2A702FFFFFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C774DB65C371F7FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C7740668C774BBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + NumGlyphs = 0 + OnClick = ZOutClick + TabOrder = 6 + end + object XEdit: TEdit + Left = 213 + Height = 18 + Top = 39 + Width = 120 + TabOrder = 7 + Text = 'XEdit' + end + object YEdit: TEdit + Left = 217 + Height = 18 + Top = 120 + Width = 120 + TabOrder = 8 + Text = 'Edit1' + end + object ZEdit: TEdit + Left = 216 + Height = 18 + Top = 200 + Width = 120 + TabOrder = 9 + Text = 'Edit1' + end + object GroupBox1: TGroupBox + Left = 6 + Height = 46 + Top = 287 + Width = 161 + Caption = 'Options:' + ClientHeight = 28 + ClientWidth = 157 + TabOrder = 10 + object RanksChk: TCheckBox + Left = 8 + Height = 17 + Top = 3 + Width = 124 + Caption = 'Show Ranked Scores' + TabOrder = 0 + end + end + object ResetBtn: TButton + Left = 174 + Height = 26 + Top = 254 + Width = 65 + Caption = 'Reset' + OnClick = ResetBtnClick + TabOrder = 11 + end + object CancelBtn: TButton + Left = 268 + Height = 26 + Top = 254 + Width = 65 + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 12 + end + object ComputeBtn: TButton + Left = 176 + Height = 26 + Top = 307 + Width = 65 + Caption = 'Compute' + OnClick = ComputeBtnClick + TabOrder = 13 + end + object ReturnBtn: TButton + Left = 268 + Height = 26 + Top = 307 + Width = 65 + Caption = 'Return' + ModalResult = 1 + TabOrder = 14 + end +end diff --git a/applications/lazstats/source_orig/kendalltauunit.lrs b/applications/lazstats/source_orig/kendalltauunit.lrs new file mode 100644 index 000000000..56187060b --- /dev/null +++ b/applications/lazstats/source_orig/kendalltauunit.lrs @@ -0,0 +1,341 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('TKendallTauFrm','FORMDATA',[ + 'TPF0'#14'TKendallTauFrm'#13'KendallTauFrm'#4'Left'#3#132#0#6'Height'#3'\'#1#3 + +'Top'#2'a'#5'Width'#3'`'#1#7'Caption'#6',Kendall Rank Correlation Tau and Pa' + +'rtial Tau'#12'ClientHeight'#3'\'#1#11'ClientWidth'#3'`'#1#6'OnShow'#7#8'For' + +'mShow'#10'LCLVersion'#6#8'0.9.26.2'#0#6'TLabel'#6'Label1'#4'Left'#2#5#6'Hei' + +'ght'#2#14#3'Top'#2#5#5'Width'#2'Z'#7'Caption'#6#19'Variables Available'#11 + +'ParentColor'#8#0#0#6'TLabel'#6'Label2'#4'Left'#3#214#0#6'Height'#2#14#3'Top' + +#2#25#5'Width'#2'0'#7'Caption'#6#10'X Variable'#11'ParentColor'#8#0#0#6'TLab' + +'el'#6'Label3'#4'Left'#3#217#0#6'Height'#2#14#3'Top'#2'i'#5'Width'#2'0'#7'Ca' + +'ption'#6#10'Y Variable'#11'ParentColor'#8#0#0#6'TLabel'#6'Label4'#4'Left'#3 + +#216#0#6'Height'#2#14#3'Top'#3#184#0#5'Width'#2'0'#7'Caption'#6#10'Z Variabl' + +'e'#11'ParentColor'#8#0#0#8'TListBox'#7'VarList'#4'Left'#2#6#6'Height'#3#254 + +#0#3'Top'#2#21#5'Width'#3#160#0#8'TabOrder'#2#0#0#0#7'TBitBtn'#3'XIn'#4'Left' + +#3#176#0#6'Height'#2#28#3'Top'#2#22#5'Width'#2' '#10'Glyph.Data'#10':'#4#0#0 + +'6'#4#0#0'BM6'#4#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#16#0#0#0#16#0#0#0#1#0' '#0#0#0 + +#0#0#0#4#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'!c$'#184#29'^ '#6#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0'*p/8%i)'#247'!c$'#217#255#255#255#0#255#255#255 + +#0#255#255#255#0#255#255#255#0'a'#190'm'#255']'#184'h'#255'X'#177'b'#255'S' + +#169'\'#255'M'#161'V'#255'G'#153'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';' + +#255'?'#136'E'#255'Y'#161'^'#255'D'#139'I'#255'!c$'#207#255#255#255#0#255#255 + +#255#0#255#255#255#0'e'#195'q'#255#160#215#169#255#156#213#165#255#152#211 + +#161#255#148#208#157#255#144#206#152#255#139#203#147#255#135#201#142#255#130 + +#198#137#255'~'#195#132#255'z'#193#128#255'v'#190'|'#255'E'#140'J'#255'!c$' + +#196#255#255#255#0#255#255#255#0'h'#199't'#255#165#218#174#255#162#216#171 + +#255#158#214#167#255#154#212#163#255#150#210#159#255#147#207#154#255#142#204 + +#149#255#137#202#144#255#133#199#139#255#129#197#135#255'}'#194#130#255'J' + +#145'P'#255'%i)'#201#255#255#255#0#255#255#255#0'h'#199't'#255'h'#199't'#255 + +'e'#195'q'#255'a'#190'm'#255']'#184'h'#255'X'#177'b'#255'S'#169'\'#255'M'#161 + +'V'#255'G'#153'O'#255'A'#145'I'#255'Z'#163'b'#255'U'#157'\'#255'/x5'#209#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0'A'#145'I'#247';'#136'B'#219#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0'G'#153'O'#187'A'#145'I'#6#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#9'NumGlyphs'#2#0#7'OnClick'#7#8'XInClick'#8'TabOrder'#2 + +#1#0#0#7'TBitBtn'#4'XOut'#4'Left'#3#176#0#6'Height'#2#28#3'Top'#2'8'#5'Width' + ,#2' '#10'Glyph.Data'#10':'#4#0#0'6'#4#0#0'BM6'#4#0#0#0#0#0#0'6'#0#0#0'('#0#0 + +#0#16#0#0#0#16#0#0#0#1#0' '#0#0#0#0#0#0#4#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0 + +#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0'M'#161'V'#6'G'#153'O'#184#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0'S'#169'\'#217'M'#161'V'#247'G'#153'O8' + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0']'#184'h'#207'q'#190'{'#255'z'#193#131#255'['#170'd'#255 + +'G'#153'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';'#255'/x5'#255'*p/'#255'%' + +'i)'#255'!c$'#255#29'^ '#255#255#255#255#0#255#255#255#0'e'#195'q'#196'{'#200 + +#134#255#156#213#165#255#152#211#161#255#148#208#157#255#144#206#152#255#139 + +#203#147#255#135#201#142#255#130#198#137#255'~'#195#132#255'z'#193#128#255'v' + +#190'|'#255'r'#189'x'#255'!c$'#255#255#255#255#0#255#255#255#0'h'#199't'#201 + +''#204#138#255#162#216#171#255#158#214#167#255#154#212#163#255#150#210#159 + +#255#147#207#154#255#142#204#149#255#137#202#144#255#133#199#139#255#129#197 + +#135#255'}'#194#130#255'x'#192'~'#255'%i)'#255#255#255#255#0#255#255#255#0 + +#255#255#255#0'h'#199't'#209#128#205#139#255'|'#201#135#255']'#184'h'#255'X' + +#177'b'#255'S'#169'\'#255'M'#161'V'#255'G'#153'O'#255'A'#145'I'#255';'#136'B' + +#255'5'#128';'#255'/x5'#255'*p/'#255#255#255#255#0#255#255#255#0#255#255#255 + +#0#255#255#255#0'h'#199't'#219'e'#195'q'#247#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0'h'#199't'#6'h'#199't'#187#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#9'NumGlyphs'#2#0#7'OnClick'#7#9'X' + +'OutClick'#8'TabOrder'#2#2#0#0#7'TBitBtn'#3'YIn'#4'Left'#3#176#0#6'Height'#2 + +#28#3'Top'#2'h'#5'Width'#2' '#10'Glyph.Data'#10':'#4#0#0'6'#4#0#0'BM6'#4#0#0 + +#0#0#0#0'6'#0#0#0'('#0#0#0#16#0#0#0#16#0#0#0#1#0' '#0#0#0#0#0#0#4#0#0'd'#0#0 + +#0'd'#0#0#0#0#0#0#0#0#0#0#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + ,#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0'!c$'#184#29'^ '#6#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0'*p/8%i)'#247'!c$'#217#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0'a'#190'm'#255']'#184'h'#255'X'#177'b'#255'S'#169'\'#255'M'#161'V' + +#255'G'#153'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';'#255'?'#136'E'#255'Y' + +#161'^'#255'D'#139'I'#255'!c$'#207#255#255#255#0#255#255#255#0#255#255#255#0 + +'e'#195'q'#255#160#215#169#255#156#213#165#255#152#211#161#255#148#208#157 + +#255#144#206#152#255#139#203#147#255#135#201#142#255#130#198#137#255'~'#195 + +#132#255'z'#193#128#255'v'#190'|'#255'E'#140'J'#255'!c$'#196#255#255#255#0 + +#255#255#255#0'h'#199't'#255#165#218#174#255#162#216#171#255#158#214#167#255 + +#154#212#163#255#150#210#159#255#147#207#154#255#142#204#149#255#137#202#144 + +#255#133#199#139#255#129#197#135#255'}'#194#130#255'J'#145'P'#255'%i)'#201 + +#255#255#255#0#255#255#255#0'h'#199't'#255'h'#199't'#255'e'#195'q'#255'a'#190 + +'m'#255']'#184'h'#255'X'#177'b'#255'S'#169'\'#255'M'#161'V'#255'G'#153'O'#255 + +'A'#145'I'#255'Z'#163'b'#255'U'#157'\'#255'/x5'#209#255#255#255#0#255#255#255 + +#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0'A'#145'I'#247';'#136'B'#219#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0'G'#153'O'#187'A'#145'I'#6#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#9'NumGlyphs'#2#0#7'OnClick'#7#8'YInClick'#8'TabOrder'#2#3#0#0#7'TBitBtn'#4 + +'YOut'#4'Left'#3#175#0#6'Height'#2#28#3'Top'#3#136#0#5'Width'#2' '#10'Glyph.' + +'Data'#10':'#4#0#0'6'#4#0#0'BM6'#4#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#16#0#0#0#16 + +#0#0#0#1#0' '#0#0#0#0#0#0#4#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#255#255#255 + +#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0'M'#161'V'#6'G'#153'O'#184#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0'S'#169'\'#217'M'#161'V'#247'G'#153'O8'#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0']'#184'h'#207'q'#190'{'#255'z'#193#131#255'['#170'd'#255'G'#153'O'#255 + +'A'#145'I'#255';'#136'B'#255'5'#128';'#255'/x5'#255'*p/'#255'%i)'#255'!c$' + +#255#29'^ '#255#255#255#255#0#255#255#255#0'e'#195'q'#196'{'#200#134#255#156 + +#213#165#255#152#211#161#255#148#208#157#255#144#206#152#255#139#203#147#255 + +#135#201#142#255#130#198#137#255'~'#195#132#255'z'#193#128#255'v'#190'|'#255 + ,'r'#189'x'#255'!c$'#255#255#255#255#0#255#255#255#0'h'#199't'#201''#204#138 + +#255#162#216#171#255#158#214#167#255#154#212#163#255#150#210#159#255#147#207 + +#154#255#142#204#149#255#137#202#144#255#133#199#139#255#129#197#135#255'}' + +#194#130#255'x'#192'~'#255'%i)'#255#255#255#255#0#255#255#255#0#255#255#255#0 + +'h'#199't'#209#128#205#139#255'|'#201#135#255']'#184'h'#255'X'#177'b'#255'S' + +#169'\'#255'M'#161'V'#255'G'#153'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';' + +#255'/x5'#255'*p/'#255#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255 + +#0'h'#199't'#219'e'#195'q'#247#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +'h'#199't'#6'h'#199't'#187#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#9'NumGlyphs'#2#0#7'OnClick'#7#9'YOutClick'#8'Ta' + +'bOrder'#2#4#0#0#7'TBitBtn'#3'ZIn'#4'Left'#3#176#0#6'Height'#2#28#3'Top'#3 + +#184#0#5'Width'#2' '#10'Glyph.Data'#10':'#4#0#0'6'#4#0#0'BM6'#4#0#0#0#0#0#0 + +'6'#0#0#0'('#0#0#0#16#0#0#0#16#0#0#0#1#0' '#0#0#0#0#0#0#4#0#0'd'#0#0#0'd'#0#0 + +#0#0#0#0#0#0#0#0#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0'!c$'#184#29'^ '#6#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +'*p/8%i)'#247'!c$'#217#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255 + +#0'a'#190'm'#255']'#184'h'#255'X'#177'b'#255'S'#169'\'#255'M'#161'V'#255'G' + +#153'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';'#255'?'#136'E'#255'Y'#161'^' + +#255'D'#139'I'#255'!c$'#207#255#255#255#0#255#255#255#0#255#255#255#0'e'#195 + +'q'#255#160#215#169#255#156#213#165#255#152#211#161#255#148#208#157#255#144 + +#206#152#255#139#203#147#255#135#201#142#255#130#198#137#255'~'#195#132#255 + +'z'#193#128#255'v'#190'|'#255'E'#140'J'#255'!c$'#196#255#255#255#0#255#255 + +#255#0'h'#199't'#255#165#218#174#255#162#216#171#255#158#214#167#255#154#212 + +#163#255#150#210#159#255#147#207#154#255#142#204#149#255#137#202#144#255#133 + +#199#139#255#129#197#135#255'}'#194#130#255'J'#145'P'#255'%i)'#201#255#255 + +#255#0#255#255#255#0'h'#199't'#255'h'#199't'#255'e'#195'q'#255'a'#190'm'#255 + +']'#184'h'#255'X'#177'b'#255'S'#169'\'#255'M'#161'V'#255'G'#153'O'#255'A'#145 + +'I'#255'Z'#163'b'#255'U'#157'\'#255'/x5'#209#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +'A'#145'I'#247';'#136'B'#219#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +'G'#153'O'#187'A'#145'I'#6#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + ,#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#9'NumGlyp' + +'hs'#2#0#7'OnClick'#7#8'ZInClick'#8'TabOrder'#2#5#0#0#7'TBitBtn'#4'ZOut'#4'L' + +'eft'#3#176#0#6'Height'#2#28#3'Top'#3#216#0#5'Width'#2' '#10'Glyph.Data'#10 + +':'#4#0#0'6'#4#0#0'BM6'#4#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#16#0#0#0#16#0#0#0#1#0 + +' '#0#0#0#0#0#0#4#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0'M'#161'V'#6'G'#153'O'#184#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0'S'#169'\'#217'M'#161'V'#247'G'#153'O8'#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +']'#184'h'#207'q'#190'{'#255'z'#193#131#255'['#170'd'#255'G'#153'O'#255'A' + +#145'I'#255';'#136'B'#255'5'#128';'#255'/x5'#255'*p/'#255'%i)'#255'!c$'#255 + +#29'^ '#255#255#255#255#0#255#255#255#0'e'#195'q'#196'{'#200#134#255#156#213 + +#165#255#152#211#161#255#148#208#157#255#144#206#152#255#139#203#147#255#135 + +#201#142#255#130#198#137#255'~'#195#132#255'z'#193#128#255'v'#190'|'#255'r' + +#189'x'#255'!c$'#255#255#255#255#0#255#255#255#0'h'#199't'#201''#204#138#255 + +#162#216#171#255#158#214#167#255#154#212#163#255#150#210#159#255#147#207#154 + +#255#142#204#149#255#137#202#144#255#133#199#139#255#129#197#135#255'}'#194 + +#130#255'x'#192'~'#255'%i)'#255#255#255#255#0#255#255#255#0#255#255#255#0'h' + +#199't'#209#128#205#139#255'|'#201#135#255']'#184'h'#255'X'#177'b'#255'S'#169 + +'\'#255'M'#161'V'#255'G'#153'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';'#255 + +'/x5'#255'*p/'#255#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'h' + +#199't'#219'e'#195'q'#247#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'h'#199 + +'t'#6'h'#199't'#187#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#9'NumGlyphs'#2#0#7'OnClick'#7#9'ZOutClick'#8'TabOrd' + ,'er'#2#6#0#0#5'TEdit'#5'XEdit'#4'Left'#3#213#0#6'Height'#2#18#3'Top'#2''''#5 + +'Width'#2'x'#8'TabOrder'#2#7#4'Text'#6#5'XEdit'#0#0#5'TEdit'#5'YEdit'#4'Left' + +#3#217#0#6'Height'#2#18#3'Top'#2'x'#5'Width'#2'x'#8'TabOrder'#2#8#4'Text'#6#5 + +'Edit1'#0#0#5'TEdit'#5'ZEdit'#4'Left'#3#216#0#6'Height'#2#18#3'Top'#3#200#0#5 + +'Width'#2'x'#8'TabOrder'#2#9#4'Text'#6#5'Edit1'#0#0#9'TGroupBox'#9'GroupBox1' + +#4'Left'#2#6#6'Height'#2'.'#3'Top'#3#31#1#5'Width'#3#161#0#7'Caption'#6#8'Op' + +'tions:'#12'ClientHeight'#2#28#11'ClientWidth'#3#157#0#8'TabOrder'#2#10#0#9 + +'TCheckBox'#8'RanksChk'#4'Left'#2#8#6'Height'#2#17#3'Top'#2#3#5'Width'#2'|'#7 + +'Caption'#6#18'Show Ranked Scores'#8'TabOrder'#2#0#0#0#0#7'TButton'#8'ResetB' + +'tn'#4'Left'#3#174#0#6'Height'#2#26#3'Top'#3#254#0#5'Width'#2'A'#7'Caption'#6 + +#5'Reset'#7'OnClick'#7#13'ResetBtnClick'#8'TabOrder'#2#11#0#0#7'TButton'#9'C' + +'ancelBtn'#4'Left'#3#12#1#6'Height'#2#26#3'Top'#3#254#0#5'Width'#2'A'#7'Capt' + +'ion'#6#6'Cancel'#11'ModalResult'#2#2#8'TabOrder'#2#12#0#0#7'TButton'#10'Com' + +'puteBtn'#4'Left'#3#176#0#6'Height'#2#26#3'Top'#3'3'#1#5'Width'#2'A'#7'Capti' + +'on'#6#7'Compute'#7'OnClick'#7#15'ComputeBtnClick'#8'TabOrder'#2#13#0#0#7'TB' + +'utton'#9'ReturnBtn'#4'Left'#3#12#1#6'Height'#2#26#3'Top'#3'3'#1#5'Width'#2 + +'A'#7'Caption'#6#6'Return'#11'ModalResult'#2#1#8'TabOrder'#2#14#0#0#0 +]); diff --git a/applications/lazstats/source_orig/kendalltauunit.pas b/applications/lazstats/source_orig/kendalltauunit.pas new file mode 100644 index 000000000..0f33d0464 --- /dev/null +++ b/applications/lazstats/source_orig/kendalltauunit.pas @@ -0,0 +1,554 @@ +unit KendallTauUnit; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, + StdCtrls, Buttons, MainUnit, OutPutUnit, FunctionsLib, Globals, + DataProcs, Math, MatrixLib; + +type + + { TKendallTauFrm } + + TKendallTauFrm = class(TForm) + ResetBtn: TButton; + CancelBtn: TButton; + ComputeBtn: TButton; + ReturnBtn: TButton; + RanksChk: TCheckBox; + GroupBox1: TGroupBox; + XEdit: TEdit; + YEdit: TEdit; + ZEdit: TEdit; + Label2: TLabel; + Label3: TLabel; + Label4: TLabel; + XIn: TBitBtn; + XOut: TBitBtn; + YIn: TBitBtn; + YOut: TBitBtn; + ZIn: TBitBtn; + ZOut: TBitBtn; + Label1: TLabel; + VarList: TListBox; + procedure ComputeBtnClick(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure ResetBtnClick(Sender: TObject); + procedure XInClick(Sender: TObject); + procedure XOutClick(Sender: TObject); + procedure YInClick(Sender: TObject); + procedure YOutClick(Sender: TObject); + procedure ZInClick(Sender: TObject); + procedure ZOutClick(Sender: TObject); + private + { private declarations } + public + { public declarations } + end; + +var + KendallTauFrm: TKendallTauFrm; + +implementation + +{ TKendallTauFrm } + +procedure TKendallTauFrm.ResetBtnClick(Sender: TObject); +VAR i : integer; +begin + XEdit.Text := ''; + YEdit.Text := ''; + ZEdit.Text := ''; + Xin.Visible := true; + Xout.Visible := false; + Yin.Visible := true; + Yout.Visible := false; + Zin.Visible := true; + Zout.Visible := false; + RanksChk.Checked := false; + VarList.Items.Clear; + for i := 1 to NoVariables do + VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]); +end; + +procedure TKendallTauFrm.XInClick(Sender: TObject); +VAR index : integer; +begin + index := VarList.ItemIndex; + XEdit.Text := VarList.Items.Strings[index]; + VarList.Items.Delete(index); + Xin.Visible := false; + Xout.Visible := true; +end; + +procedure TKendallTauFrm.XOutClick(Sender: TObject); +begin + VarList.Items.Add(XEdit.Text); + XEdit.Text := ''; + Xin.Visible := true; + Xout.Visible := false; +end; + +procedure TKendallTauFrm.YInClick(Sender: TObject); +VAR index : integer; +begin + index := VarList.ItemIndex; + YEdit.Text := VarList.Items.Strings[index]; + VarList.Items.Delete(index); + Yin.Visible := false; + Yout.Visible := true; +end; + +procedure TKendallTauFrm.YOutClick(Sender: TObject); +begin + VarList.Items.Add(YEdit.Text); + YEdit.Text := ''; + Yin.Visible := true; + Yout.Visible := false; +end; + +procedure TKendallTauFrm.ZInClick(Sender: TObject); +VAR index : integer; +begin + index := VarList.ItemIndex; + ZEdit.Text := VarList.Items.Strings[index]; + VarList.Items.Delete(index); + Zin.Visible := false; + Zout.Visible := true; +end; + +procedure TKendallTauFrm.ZOutClick(Sender: TObject); +begin + VarList.Items.Add(YEdit.Text); + ZEdit.Text := ''; + Zin.Visible := true; + Zout.Visible := false; +end; + +procedure TKendallTauFrm.FormShow(Sender: TObject); +begin + ResetBtnClick(self); +end; + +procedure TKendallTauFrm.ComputeBtnClick(Sender: TObject); +label Check1, Check2, Check3; +var + i, j, k, itemp, NoTies, NoTieGroups, NoSelected : integer; + col1, col2, col3, NCases : integer; + index : IntDyneMat; + Probability, Temp, TieSum, Avg, t, SumT, r : double; + z, denominator, df, stddev : double; + Ranks, X : DblDyneMat; + cellstring, outline : string; + ColNoSelected : IntdyneVec; + ColLabels : StrDyneVec; + RowLabels : StrDyneVec; + TauXY, TauXZ, TauYZ : double; + TiesX, TiesY, TiesZ : integer; + Tx, Ty, Tz : double; + Term1, Term2 : double; + PartialTau : double; + title : string; +begin + // Allocate memory + SetLength(index,NoCases,3); + SetLength(Ranks,NoCases,3); + SetLength(X,NoCases,3); + SetLength(ColLabels,3); + SetLength(RowLabels,NoCases); + SetLength(ColNoSelected,NoVariables); + Tx := 0.0; + Ty := 0.0; + Tz := 0.0; + + // Get column numbers and labels of variables selected + NoSelected := 0; + for j := 1 to NoVariables do + begin + cellstring := OS3MainFrm.DataGrid.Cells[j,0]; + if cellstring = Xedit.Text then + begin + ColNoSelected[0] := j; + ColLabels[0] := cellstring; + NoSelected := NoSelected + 1; + end; + if cellstring = Yedit.Text then + begin + ColNoSelected[1] := j; + ColLabels[1] := cellstring; + NoSelected := NoSelected + 1; + end; + if cellstring = Zedit.Text then + begin + ColNoSelected[2] := j; + ColLabels[2] := cellstring; + NoSelected := NoSelected + 1; + end; + end; + + // Get scores + NCases := 0; + for i := 1 to NoCases do + begin + if ( not GoodRecord(i,NoSelected,ColNoSelected)) then continue; + NCases := NCases + 1; + col1 := ColNoSelected[0]; + col2 := ColNoSelected[1]; + if NoSelected = 3 then col3 := ColNoSelected[2]; + X[NCases-1,0] := StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[col1,i])); + Ranks[NCases-1,0] := X[NCases-1,0]; + X[NCases-1,1] := StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[col2,i])); + Ranks[NCases-1,1] := X[NCases-1,1]; + if NoSelected = 3 then + begin + X[NCases-1,2] := StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[col3,i])); + Ranks[NCases-1,2] := X[NCases-1,2]; + end; + index[NCases-1,0] := NCases; + index[NCases-1,1] := NCases; + if NoSelected = 3 then index[NCases-1,2] := NCases; + end; + + for i := 0 to NCases - 1 do RowLabels[i] := IntToStr(i+1); + // Rank the first variable (X) + for i := 0 to NCases - 2 do + begin + for j := i + 1 to NCases-1 do + begin + if (Ranks[i,0] > Ranks[j,0]) then // swap + begin + Temp := Ranks[i,0]; + Ranks[i,0] := Ranks[j,0]; + Ranks[j,0] := Temp; + itemp := index[i,0]; + index[i,0] := index[j,0]; + index[j,0] := itemp; + end; + end; + end; + + // Assign ranks + for i := 0 to NCases-1 do Ranks[i,0] := i+1; + + // Check for ties in each + i := 1; + while (i < NCases) do + begin + j := i+1; + TieSum := 0.0; + NoTies := 0; + while (j <= NCases) do + begin + if (X[j-1,0] > X[i-1,0]) then goto Check1; + if (X[j-1,0] = X[i-1,0]) then + begin + TieSum := TieSum + Ranks[j-1,0]; + NoTies := NoTies + 1; + end; + j := j + 1; + end; +Check1: + if (NoTies > 0) then // at least one tie found + begin + TieSum := TieSum + Ranks[i-1,0]; + NoTies := NoTies + 1; + Avg := TieSum / NoTies; + for j := i to i + NoTies - 1 do Ranks[j-1,0] := Avg; + i := i + (NoTies-1); + Tx := Tx + NoTies *(NoTies-1); + end; + i := i + 1; + end; + Tx := Tx / 2.0; + + // Repeat sort for second variable Y + for i := 0 to NCases - 2 do + begin + for j := i + 1 to NCases-1 do + begin + if (Ranks[i,1] > Ranks[j,1]) then // swap + begin + Temp := Ranks[i,1]; + Ranks[i,1] := Ranks[j,1]; + Ranks[j,1] := Temp; + itemp := index[i,1]; + index[i,1] := index[j,1]; + index[j,1] := itemp; + end; + end; + end; + + // Assign ranks + for i := 0 to NCases-1 do Ranks[i,1] := i+1; + + // Check for ties in each + i := 1; + while (i < NCases) do + begin + j := i+1; + TieSum := 0.0; + NoTies := 0; + while (j <= NoCases) do + begin + if (X[j-1,1] > X[i-1,1]) then goto Check2; + if (X[j-1,1] = X[i-1,1]) then + begin + TieSum := TieSum + Ranks[j-1,1]; + NoTies := NoTies + 1; + end; + j := j + 1; + end; +Check2: + if (NoTies > 0) then // at least one tie found + begin + TieSum := TieSum + Ranks[i-1,1]; + NoTies := NoTies + 1; + Avg := TieSum / NoTies; + for j := i to i + NoTies - 1 do Ranks[j-1,1] := Avg; + i := i + (NoTies-1); + Ty := Ty + NoTies * (NoTies - 1); + end; + i := i + 1; + end; + Ty := Ty / 2.0; + + // Repeat for z variable + if NoSelected > 2 then // z was entered + begin + for i := 0 to NCases - 2 do + begin + for j := i + 1 to NCases-1 do + begin + if (Ranks[i,2] > Ranks[j,2]) then // swap + begin + Temp := Ranks[i,2]; + Ranks[i,2] := Ranks[j,2]; + Ranks[j,2] := Temp; + itemp := index[i,2]; + index[i,2] := index[j,2]; + index[j,2] := itemp; + end; + end; + end; + + // Assign ranks + for i := 0 to NCases-1 do Ranks[i,2] := i+1; + + // Check for ties in each + i := 1; + while (i < NCases) do + begin + j := i+1; + TieSum := 0.0; + NoTies := 0; + while (j <= NoCases) do + begin + if (X[j-1,2] > X[i-1,2]) then goto Check3; + if (X[j-1,2] = X[i-1,2]) then + begin + TieSum := TieSum + Ranks[j-1,2]; + NoTies := NoTies + 1; + end; + j := j + 1; + end; +Check3: + if (NoTies > 0) then // at least one tie found + begin + TieSum := TieSum + Ranks[i-1,2]; + NoTies := NoTies + 1; + Avg := TieSum / NoTies; + for j := i to i + NoTies - 1 do Ranks[j-1,2] := Avg; + i := i + (NoTies-1); + Tz := Tz + NoTies * (NoTies - 1); + end; + i := i + 1; + end; + Tz := Tz / 2.0; + end; + + // Rearrange ranks into original score order + for k := 1 to 3 do + begin + for i := 1 to NCases - 1 do + begin + for j := i + 1 to NCases do + begin + if (index[i-1,k-1] > index[j-1,k-1]) then // swap + begin + itemp := index[i-1,k-1]; + index[i-1,k-1] := index[j-1,k-1]; + index[j-1,k-1] := itemp; + Temp := Ranks[i-1,k-1]; + Ranks[i-1,k-1] := Ranks[j-1,k-1]; + Ranks[j-1,k-1] := Temp; + end; + end; + end; + end; + + // print data matrix if option is elected + if RanksChk.Checked then + begin + title := 'Ranks'; + if NoSelected = 2 then + MAT_PRINT(Ranks,NCases,2,title,RowLabels,ColLabels,NCases) + else + MAT_PRINT(Ranks,NCases,3,title,RowLabels,ColLabels,NCases); + OutPutFrm.ShowModal; + OutPutFrm.RichEdit.Clear; + end; + + // compute Tau for X and Y + // sort on X and obtain SumT for Y ranks + SumT := 0.0; + for i := 0 to NCases - 2 do + begin + for j := i + 1 to NCases-1 do + begin + if (Ranks[i,0] > Ranks[j,0]) then // swap + begin + Temp := Ranks[i,0]; + Ranks[i,0] := Ranks[j,0]; + Ranks[j,0] := Temp; + Temp := Ranks[i,1]; + Ranks[i,1] := Ranks[j,1]; + Ranks[j,1] := Temp; + if NoSelected = 3 then + begin + Temp := Ranks[i,2]; + Ranks[i,2] := Ranks[j,2]; + Ranks[j,2] := Temp; + end; + itemp := index[i,0]; + index[i,0] := index[j,0]; + index[j,0] := itemp; + end; + end; + end; + for i := 0 to NCases - 2 do + for j := i + 1 to NCases - 1 do + if Ranks[i,1] < Ranks[j,1] then SumT := SumT + 1.0 + else if Ranks[i,1] > Ranks[j,1] then SumT := SumT - 1.0; + Term1 := sqrt((NCases * (NCases-1)) / 2.0 - Tx); + Term2 := sqrt((NCases * (Ncases-1)) / 2.0 - Ty); + denominator := Term1 * Term2; + TauXY := SumT / denominator; + + if NoSelected > 2 then // get tau values for partial + begin + // Get TauXZ + SumT := 0.0; + for i := 0 to NCases - 2 do + for j := i + 1 to NCases - 1 do + if Ranks[i,2] < Ranks[j,2] then SumT := SumT + 1.0 + else if Ranks[i,2] > Ranks[j,2] then SumT := SumT - 1.0; + Term1 := sqrt((NCases * (NCases-1)) / 2.0 - Tx); + Term2 := sqrt((NCases * (Ncases-1)) / 2.0 - Tz); + denominator := Term1 * Term2; + TauXZ := SumT / denominator; + + // get back to original order then sort on Y + for i := 0 to NCases - 2 do + begin + for j := i + 1 to NCases - 1 do + begin + if index[i,0] > index[j,0] then // swap + begin + Temp := Ranks[i,0]; + Ranks[i,0] := Ranks[j,0]; + Ranks[j,0] := temp; + Temp := Ranks[i,1]; + Ranks[i,1] := Ranks[j,1]; + Ranks[j,1] := Temp; + Temp := Ranks[i,2]; + Ranks[i,2] := Ranks[j,2]; + Ranks[j,2] := Temp; + itemp := index[i,0]; + index[i,0] := index[j,0]; + index[j,0] := itemp; + end; + end; + end; + + // Get TauYZ + for i := 0 to NCases - 2 do // sort on Y variable + begin + for j := i + 1 to NCases-1 do + begin + if (Ranks[i,1] > Ranks[j,1]) then // swap + begin + Temp := Ranks[i,1]; + Ranks[i,1] := Ranks[j,1]; + Ranks[j,1] := Temp; + Temp := Ranks[i,2]; + Ranks[i,2] := Ranks[j,2]; + Ranks[j,2] := Temp; + itemp := index[i,1]; + index[i,1] := index[j,1]; + index[j,1] := itemp; + end; + end; + end; + + SumT := 0.0; + for i := 0 to NCases - 2 do + for j := i + 1 to NCases - 1 do + if Ranks[i,2] < Ranks[j,2] then SumT := SumT + 1.0 + else if Ranks[i,2] > Ranks[j,2] then SumT := SumT - 1.0; + Term1 := sqrt((NCases * (NCases-1)) / 2.0 - Ty); + Term2 := sqrt((NCases * (Ncases-1)) / 2.0 - Tz); + denominator := Term1 * Term2; + TauYZ := SumT / denominator; + PartialTau := (TauXY - TauXZ * TauYZ) / + (sqrt(1.0 - sqr(TauXZ)) * sqrt(1.0 - sqr(TauYZ))); + end; + + // do significance tests + stddev := sqrt( (2.0 * ( 2.0 * NCases + 5)) / (9.0 * NCases * (NCases - 1.0))); + OutPutFrm.RichEdit.Clear; + OutPutFrm.RichEdit.Lines.Add('Kendall Tau for File: ' + OS3MainFrm.FileNameEdit.Text); + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add('Kendall Tau for variables ' + ColLabels[0] + ' and ' + ColLabels[1]); + z := abs(TauXY / stddev); + probability := 1.0 - probz(z); + outline := format('Tau = %8.4f z = %8.3f probability > |z| = %4.3f',[TauXY,z,probability]); + OutPutFrm.RichEdit.Lines.Add(outline); + if NoSelected > 2 then + begin + OutPutFrm.RichEdit.Lines.Add(''); + z := abs(TauXZ / stddev); + probability := 1.0 - probz(z); + OutPutFrm.RichEdit.Lines.Add('Kendall Tau for variables ' + ColLabels[0] + ' and ' + ColLabels[2]); + outline := format('Tau = %8.4f z = %8.3f probability > |z| = %4.3f',[TauXZ,z,probability]); + OutPutFrm.RichEdit.Lines.Add(outline); + z := abs(TauYZ / stddev); + probability := 1.0 - probz(z); + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add('Kendall Tau for variables ' + ColLabels[1] + ' and ' + ColLabels[2]); + outline := format('Tau = %8.4f z = %8.3f probability > |z| = %4.3f',[TauYZ,z,probability]); + OutPutFrm.RichEdit.Lines.Add(outline); + OutPutFrm.RichEdit.Lines.Add(''); + outline := format('Partial Tau = %8.4f',[PartialTau]); + OutPutFrm.RichEdit.Lines.Add(outline); + end; + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add('NOTE: Probabilities are for large N (>10)'); + OutPutFrm.ShowModal; + OutPutFrm.RichEdit.Clear; + + ColNoSelected := nil; + RowLabels := nil; + ColLabels := nil; + X := nil; + Ranks := nil; + index := nil; +end; + +initialization + {$I kendalltauunit.lrs} + +end. + diff --git a/applications/lazstats/source_orig/kmeansunit.lfm b/applications/lazstats/source_orig/kmeansunit.lfm new file mode 100644 index 000000000..d3b49a77f --- /dev/null +++ b/applications/lazstats/source_orig/kmeansunit.lfm @@ -0,0 +1,253 @@ +object kmeansfrm: Tkmeansfrm + Left = 157 + Height = 398 + Top = 115 + Width = 443 + Caption = 'k Means Clustering ' + ClientHeight = 398 + ClientWidth = 443 + OnShow = FormShow + LCLVersion = '0.9.28.2' + object Label1: TLabel + Left = 9 + Height = 14 + Top = 8 + Width = 112 + Caption = 'No. of Desired Clusters' + ParentColor = False + end + object Label2: TLabel + Left = 9 + Height = 14 + Top = 40 + Width = 81 + Caption = 'No. of Iterations' + ParentColor = False + end + object Label3: TLabel + Left = 9 + Height = 14 + Top = 112 + Width = 90 + Caption = 'Available Variables' + ParentColor = False + end + object Label4: TLabel + Left = 249 + Height = 14 + Top = 112 + Width = 88 + Caption = 'Selected Variables' + ParentColor = False + end + object NoClustersEdit: TEdit + Left = 130 + Height = 21 + Top = 1 + Width = 54 + TabOrder = 0 + Text = 'NoClustersEdit' + end + object ItersEdit: TEdit + Left = 129 + Height = 21 + Top = 33 + Width = 55 + TabOrder = 1 + Text = 'ItersEdit' + end + object GroupBox1: TGroupBox + Left = 262 + Height = 101 + Top = 1 + Width = 160 + Caption = 'Analysis Optons' + ClientHeight = 83 + ClientWidth = 156 + TabOrder = 2 + object StdChkBox: TCheckBox + Left = 7 + Height = 17 + Top = 5 + Width = 123 + Caption = 'Standardize Variables' + TabOrder = 0 + end + object RepChkBox: TCheckBox + Left = 25 + Height = 17 + Top = 31 + Width = 114 + Caption = 'Replace Grid Values' + TabOrder = 1 + end + object DescChkBox: TCheckBox + Left = 10 + Height = 17 + Top = 57 + Width = 119 + Caption = 'Descriptive Statistics' + TabOrder = 2 + end + end + object VarList: TListBox + Left = 7 + Height = 208 + Top = 128 + Width = 176 + ItemHeight = 0 + MultiSelect = True + TabOrder = 3 + end + object VarInBtn: TBitBtn + Left = 192 + Height = 34 + Top = 128 + Width = 45 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00216324B81D5E2006FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF002A702F38256929F7216324D9FFFFFF00FFFFFF00FFFFFF00FFFFFF0061BE + 6DFF5DB868FF58B162FF53A95CFF4DA156FF47994FFF419149FF3B8842FF3580 + 3BFF3F8845FF59A15EFF448B49FF216324CFFFFFFF00FFFFFF00FFFFFF0065C3 + 71FFA0D7A9FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF458C4AFF216324C4FFFFFF00FFFFFF0068C7 + 74FFA5DAAEFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF4A9150FF256929C9FFFFFF00FFFFFF0068C7 + 74FF68C774FF65C371FF61BE6DFF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF5AA362FF559D5CFF2F7835D1FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00419149F73B8842DBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0047994FBB41914906FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + OnClick = VarInBtnClick + TabOrder = 4 + end + object VarOutBtn: TBitBtn + Left = 192 + Height = 34 + Top = 168 + Width = 45 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF004DA1560647994FB8FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0053A95CD94DA156F747994F38FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF005DB868CF71BE7BFF7AC183FF5BAA64FF47994FFF419149FF3B8842FF3580 + 3BFF2F7835FF2A702FFF256929FF216324FF1D5E20FFFFFFFF00FFFFFF0065C3 + 71C47BC886FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF72BD78FF216324FFFFFFFF00FFFFFF0068C7 + 74C97FCC8AFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF78C07EFF256929FFFFFFFF00FFFFFF00FFFF + FF0068C774D180CD8BFF7CC987FF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF3B8842FF35803BFF2F7835FF2A702FFFFFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C774DB65C371F7FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C7740668C774BBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + OnClick = VarOutBtnClick + TabOrder = 5 + end + object AllBtn: TBitBtn + Left = 192 + Height = 34 + Top = 224 + Width = 45 + Caption = 'ALL' + OnClick = AllBtnClick + TabOrder = 6 + end + object ListBox1: TListBox + Left = 248 + Height = 208 + Top = 128 + Width = 174 + ItemHeight = 0 + TabOrder = 7 + end + object ResetBtn: TButton + Left = 96 + Height = 28 + Top = 352 + Width = 75 + Caption = 'Reset' + OnClick = ResetBtnClick + TabOrder = 8 + end + object CancelBtn: TButton + Left = 184 + Height = 28 + Top = 352 + Width = 75 + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 9 + end + object ComputeBtn: TButton + Left = 264 + Height = 28 + Top = 352 + Width = 75 + Caption = 'Compute' + OnClick = ComputeBtnClick + TabOrder = 10 + end + object ReturnBtn: TButton + Left = 347 + Height = 28 + Top = 352 + Width = 75 + Caption = 'Return' + ModalResult = 1 + TabOrder = 11 + end + object HelpBtn: TButton + Tag = 129 + Left = 9 + Height = 28 + Top = 352 + Width = 81 + Caption = 'Help' + OnClick = HelpBtnClick + TabOrder = 12 + end +end diff --git a/applications/lazstats/source_orig/kmeansunit.lrs b/applications/lazstats/source_orig/kmeansunit.lrs new file mode 100644 index 000000000..6b1e4344b --- /dev/null +++ b/applications/lazstats/source_orig/kmeansunit.lrs @@ -0,0 +1,144 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('Tkmeansfrm','FORMDATA',[ + 'TPF0'#10'Tkmeansfrm'#9'kmeansfrm'#4'Left'#3#157#0#6'Height'#3#142#1#3'Top'#2 + +'s'#5'Width'#3#187#1#7'Caption'#6#19'k Means Clustering '#12'ClientHeight'#3 + +#142#1#11'ClientWidth'#3#187#1#6'OnShow'#7#8'FormShow'#10'LCLVersion'#6#8'0.' + +'9.28.2'#0#6'TLabel'#6'Label1'#4'Left'#2#9#6'Height'#2#14#3'Top'#2#8#5'Width' + +#2'p'#7'Caption'#6#23'No. of Desired Clusters'#11'ParentColor'#8#0#0#6'TLabe' + +'l'#6'Label2'#4'Left'#2#9#6'Height'#2#14#3'Top'#2'('#5'Width'#2'Q'#7'Caption' + +#6#17'No. of Iterations'#11'ParentColor'#8#0#0#6'TLabel'#6'Label3'#4'Left'#2 + +#9#6'Height'#2#14#3'Top'#2'p'#5'Width'#2'Z'#7'Caption'#6#19'Available Variab' + +'les'#11'ParentColor'#8#0#0#6'TLabel'#6'Label4'#4'Left'#3#249#0#6'Height'#2 + +#14#3'Top'#2'p'#5'Width'#2'X'#7'Caption'#6#18'Selected Variables'#11'ParentC' + +'olor'#8#0#0#5'TEdit'#14'NoClustersEdit'#4'Left'#3#130#0#6'Height'#2#21#3'To' + +'p'#2#1#5'Width'#2'6'#8'TabOrder'#2#0#4'Text'#6#14'NoClustersEdit'#0#0#5'TEd' + +'it'#9'ItersEdit'#4'Left'#3#129#0#6'Height'#2#21#3'Top'#2'!'#5'Width'#2'7'#8 + +'TabOrder'#2#1#4'Text'#6#9'ItersEdit'#0#0#9'TGroupBox'#9'GroupBox1'#4'Left'#3 + +#6#1#6'Height'#2'e'#3'Top'#2#1#5'Width'#3#160#0#7'Caption'#6#15'Analysis Opt' + +'ons'#12'ClientHeight'#2'S'#11'ClientWidth'#3#156#0#8'TabOrder'#2#2#0#9'TChe' + +'ckBox'#9'StdChkBox'#4'Left'#2#7#6'Height'#2#17#3'Top'#2#5#5'Width'#2'{'#7'C' + +'aption'#6#21'Standardize Variables'#8'TabOrder'#2#0#0#0#9'TCheckBox'#9'RepC' + +'hkBox'#4'Left'#2#25#6'Height'#2#17#3'Top'#2#31#5'Width'#2'r'#7'Caption'#6#19 + +'Replace Grid Values'#8'TabOrder'#2#1#0#0#9'TCheckBox'#10'DescChkBox'#4'Left' + +#2#10#6'Height'#2#17#3'Top'#2'9'#5'Width'#2'w'#7'Caption'#6#22'Descriptive S' + +'tatistics'#8'TabOrder'#2#2#0#0#0#8'TListBox'#7'VarList'#4'Left'#2#7#6'Heigh' + +'t'#3#208#0#3'Top'#3#128#0#5'Width'#3#176#0#10'ItemHeight'#2#0#11'MultiSelec' + +'t'#9#8'TabOrder'#2#3#0#0#7'TBitBtn'#8'VarInBtn'#4'Left'#3#192#0#6'Height'#2 + +'"'#3'Top'#3#128#0#5'Width'#2'-'#10'Glyph.Data'#10':'#4#0#0'6'#4#0#0'BM6'#4#0 + +#0#0#0#0#0'6'#0#0#0'('#0#0#0#16#0#0#0#16#0#0#0#1#0' '#0#0#0#0#0#0#4#0#0'd'#0 + +#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0'!c$'#184#29'^ '#6#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0'*p/8%i)'#247'!c$'#217#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0'a'#190'm'#255']'#184'h'#255'X'#177'b'#255'S'#169'\'#255'M'#161 + +'V'#255'G'#153'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';'#255'?'#136'E'#255 + +'Y'#161'^'#255'D'#139'I'#255'!c$'#207#255#255#255#0#255#255#255#0#255#255#255 + +#0'e'#195'q'#255#160#215#169#255#156#213#165#255#152#211#161#255#148#208#157 + +#255#144#206#152#255#139#203#147#255#135#201#142#255#130#198#137#255'~'#195 + +#132#255'z'#193#128#255'v'#190'|'#255'E'#140'J'#255'!c$'#196#255#255#255#0 + +#255#255#255#0'h'#199't'#255#165#218#174#255#162#216#171#255#158#214#167#255 + +#154#212#163#255#150#210#159#255#147#207#154#255#142#204#149#255#137#202#144 + +#255#133#199#139#255#129#197#135#255'}'#194#130#255'J'#145'P'#255'%i)'#201 + +#255#255#255#0#255#255#255#0'h'#199't'#255'h'#199't'#255'e'#195'q'#255'a'#190 + +'m'#255']'#184'h'#255'X'#177'b'#255'S'#169'\'#255'M'#161'V'#255'G'#153'O'#255 + +'A'#145'I'#255'Z'#163'b'#255'U'#157'\'#255'/x5'#209#255#255#255#0#255#255#255 + +#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0'A'#145'I'#247';'#136'B'#219#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0'G'#153'O'#187'A'#145'I'#6#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + ,#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#7'OnClick'#7#13'VarInBtnClick'#8'TabOrder'#2#4#0#0#7'TBitBtn'#9'VarOutBtn'#4 + +'Left'#3#192#0#6'Height'#2'"'#3'Top'#3#168#0#5'Width'#2'-'#10'Glyph.Data'#10 + +':'#4#0#0'6'#4#0#0'BM6'#4#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#16#0#0#0#16#0#0#0#1#0 + +' '#0#0#0#0#0#0#4#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0'M'#161'V'#6'G'#153'O'#184#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0'S'#169'\'#217'M'#161'V'#247'G'#153'O8'#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +']'#184'h'#207'q'#190'{'#255'z'#193#131#255'['#170'd'#255'G'#153'O'#255'A' + +#145'I'#255';'#136'B'#255'5'#128';'#255'/x5'#255'*p/'#255'%i)'#255'!c$'#255 + +#29'^ '#255#255#255#255#0#255#255#255#0'e'#195'q'#196'{'#200#134#255#156#213 + +#165#255#152#211#161#255#148#208#157#255#144#206#152#255#139#203#147#255#135 + +#201#142#255#130#198#137#255'~'#195#132#255'z'#193#128#255'v'#190'|'#255'r' + +#189'x'#255'!c$'#255#255#255#255#0#255#255#255#0'h'#199't'#201#127#204#138 + +#255#162#216#171#255#158#214#167#255#154#212#163#255#150#210#159#255#147#207 + +#154#255#142#204#149#255#137#202#144#255#133#199#139#255#129#197#135#255'}' + +#194#130#255'x'#192'~'#255'%i)'#255#255#255#255#0#255#255#255#0#255#255#255#0 + +'h'#199't'#209#128#205#139#255'|'#201#135#255']'#184'h'#255'X'#177'b'#255'S' + +#169'\'#255'M'#161'V'#255'G'#153'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';' + +#255'/x5'#255'*p/'#255#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255 + +#0'h'#199't'#219'e'#195'q'#247#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +'h'#199't'#6'h'#199't'#187#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#7'OnClick'#7#14'VarOutBtnClick'#8'TabOrder'#2#5 + +#0#0#7'TBitBtn'#6'AllBtn'#4'Left'#3#192#0#6'Height'#2'"'#3'Top'#3#224#0#5'Wi' + +'dth'#2'-'#7'Caption'#6#3'ALL'#7'OnClick'#7#11'AllBtnClick'#8'TabOrder'#2#6#0 + ,#0#8'TListBox'#8'ListBox1'#4'Left'#3#248#0#6'Height'#3#208#0#3'Top'#3#128#0#5 + +'Width'#3#174#0#10'ItemHeight'#2#0#8'TabOrder'#2#7#0#0#7'TButton'#8'ResetBtn' + +#4'Left'#2'`'#6'Height'#2#28#3'Top'#3'`'#1#5'Width'#2'K'#7'Caption'#6#5'Rese' + +'t'#7'OnClick'#7#13'ResetBtnClick'#8'TabOrder'#2#8#0#0#7'TButton'#9'CancelBt' + +'n'#4'Left'#3#184#0#6'Height'#2#28#3'Top'#3'`'#1#5'Width'#2'K'#7'Caption'#6#6 + +'Cancel'#11'ModalResult'#2#2#8'TabOrder'#2#9#0#0#7'TButton'#10'ComputeBtn'#4 + +'Left'#3#8#1#6'Height'#2#28#3'Top'#3'`'#1#5'Width'#2'K'#7'Caption'#6#7'Compu' + +'te'#7'OnClick'#7#15'ComputeBtnClick'#8'TabOrder'#2#10#0#0#7'TButton'#9'Retu' + +'rnBtn'#4'Left'#3'['#1#6'Height'#2#28#3'Top'#3'`'#1#5'Width'#2'K'#7'Caption' + +#6#6'Return'#11'ModalResult'#2#1#8'TabOrder'#2#11#0#0#7'TButton'#7'HelpBtn'#3 + +'Tag'#3#129#0#4'Left'#2#9#6'Height'#2#28#3'Top'#3'`'#1#5'Width'#2'Q'#7'Capti' + +'on'#6#4'Help'#7'OnClick'#7#12'HelpBtnClick'#8'TabOrder'#2#12#0#0#0 +]); diff --git a/applications/lazstats/source_orig/kmeansunit.pas b/applications/lazstats/source_orig/kmeansunit.pas new file mode 100644 index 000000000..e9f5a97bc --- /dev/null +++ b/applications/lazstats/source_orig/kmeansunit.pas @@ -0,0 +1,867 @@ +unit kmeansunit; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, + StdCtrls, Buttons, MainUnit, functionslib, Globals, matrixlib, dataprocs, + outputunit, contexthelpunit; + +type + + { Tkmeansfrm } + + Tkmeansfrm = class(TForm) + DescChkBox: TCheckBox; + HelpBtn: TButton; + VarInBtn: TBitBtn; + VarOutBtn: TBitBtn; + AllBtn: TBitBtn; + ResetBtn: TButton; + CancelBtn: TButton; + ComputeBtn: TButton; + ReturnBtn: TButton; + StdChkBox: TCheckBox; + RepChkBox: TCheckBox; + GroupBox1: TGroupBox; + ItersEdit: TEdit; + Label2: TLabel; + Label3: TLabel; + Label4: TLabel; + ListBox1: TListBox; + VarList: TListBox; + NoClustersEdit: TEdit; + Label1: TLabel; + procedure AllBtnClick(Sender: TObject); + procedure ComputeBtnClick(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure HelpBtnClick(Sender: TObject); + procedure ResetBtnClick(Sender: TObject); + procedure VarInBtnClick(Sender: TObject); + procedure VarOutBtnClick(Sender: TObject); + private + { private declarations } + procedure KMNS(VAR A : DblDyneMat; M, N : integer; + VAR C : DblDyneMat; K : integer; VAR IC1 : IntDyneVec; + VAR IC2 : IntDyneVec; VAR NC : IntDyneVec; + VAR AN1 : DblDyneVec; VAR AN2 : DblDyneVec; + VAR NCP : IntDyneVec; VAR D : DblDyneVec; + VAR ITRAN : IntDyneVec; VAR LIVE : IntDyneVec; + ITER : integer; VAR WSS : DblDyneVec; IFAULT : integer); + procedure OPTRA(VAR A : DblDyneMat; M, N : integer; + VAR C : DblDyneMat; K : integer; + VAR IC1 : IntDyneVec; VAR IC2 : IntDyneVec; + VAR NC : IntDyneVec; VAR AN1 : DblDyneVec; + VAR AN2 : DblDyneVec; VAR NCP : IntDyneVec; + VAR D : DblDyneVec; VAR ITRAN : IntDyneVec; + VAR LIVE : IntDyneVec; INDX : integer); + procedure QTRAN(VAR A : DblDyneMat; M, N : integer; + VAR C : DblDyneMat; K : integer; + VAR IC1 : IntDyneVec; VAR IC2 : IntDyneVec; + VAR NC : IntDyneVec; VAR AN1 : DblDyneVec; + VAR AN2 : DblDyneVec; VAR NCP : IntDyneVec; + VAR D : DblDyneVec; VAR ITRAN : IntDyneVec; + INDX : integer); + + public + { public declarations } + end; + +var + kmeansfrm: Tkmeansfrm; + +implementation + +{ Tkmeansfrm } + +procedure Tkmeansfrm.ResetBtnClick(Sender: TObject); +VAR cellstring : string; + i : integer; +begin + VarList.Clear; + ListBox1.Clear; + for i := 1 to NoVariables do + begin + cellstring := OS3MainFrm.DataGrid.Cells[i,0]; + VarList.Items.Add(cellstring); + end; + RepChkBox.Checked := false; + StdChkBox.Checked := true; + VarOutBtn.Enabled := false; + DescChkBox.Checked := false; + NoClustersEdit.Text := ''; + ItersEdit.Text := '100'; +end; + +procedure Tkmeansfrm.VarInBtnClick(Sender: TObject); +VAR + index, count, i : integer; + cellstring : string; +begin + count := 0; + index := ListBox1.Items.Count; + for i := 0 to index - 1 do + begin + if (VarList.Selected[i]) then + begin + cellstring := VarList.Items.strings[i]; + ListBox1.Items.Add(cellstring); + count := count + 1; + end; + end; + + while (count > 0) do + begin + for i := 0 to VarList.Items.Count - 1 do + begin + if (VarList.Selected[i]) then + begin + VarList.Items.Delete(i); + count := count - 1; + end; + end; + end; + VarOutBtn.Enabled := true; +end; + +procedure Tkmeansfrm.VarOutBtnClick(Sender: TObject); +VAR index : integer; + cellstring : string; +begin + index := ListBox1.ItemIndex; + cellstring := ListBox1.Items.Strings[index]; + VarList.Items.Add(cellstring); + ListBox1.Items.Delete(index); +end; + +procedure Tkmeansfrm.FormShow(Sender: TObject); +begin + ResetBtnClick(self); +end; + +procedure Tkmeansfrm.HelpBtnClick(Sender: TObject); +begin + ContextHelpForm.HelpMessage((Sender as TButton).tag); +end; + +procedure Tkmeansfrm.AllBtnClick(Sender: TObject); +VAR + index, noitems : integer; + cellstring : string; +begin + noitems := VarList.Items.Count; + for index := 0 to noitems - 1 do + begin + cellstring := VarList.Items.Strings[index]; + ListBox1.Items.Add(cellstring); + end; + VarList.Clear; + VarOutBtn.Enabled := true; +end; + +procedure Tkmeansfrm.ComputeBtnClick(Sender: TObject); +VAR + i, j, L, Ncols, N, M, K,IFAULT, ITER, result, intvalue, col : integer; + center, itemp : integer; + IC1, IC2, NC, NCP, ITRAN, LIVE, ColSelected : IntDyneVec; + A, C : DblDyneMat; + D, AN1, AN2, WSS, DT : DblDyneVec; + cellstring, strvalue : string; + outline : string; + strval : string; + varlabels, rowlabels : StrDyneVec; + dblvalue, Mean, stddev : double; +label cleanup; + +begin + Ncols := ListBox1.Items.Count; + if (Ncols <= 0) then + begin + ShowMessage('ERROR! No variables selected to cluster.'); + exit; + end; + + N := Ncols; + M := NoCases; + K := StrToInt(NoClustersEdit.Text); + IFAULT := 0; + ITER := StrToInt(ItersEdit.Text); + + SetLength(varlabels,Ncols); + SetLength(rowlabels,NoCases); + SetLength(ColSelected,Ncols); + SetLength(A,M+1,N+1); + SetLength(C,K+1,N+1); + SetLength(D,M+1); + SetLength(AN1,K+1); + SetLength(AN2,K+1); + SetLength(WSS,K+1); + SetLength(DT,3); + SetLength(IC1,M+1); + SetLength(IC2,M+1); + SetLength(NC,K+1); + SetLength(NCP,K+1); + SetLength(ITRAN,K+1); + SetLength(LIVE,K+1); + + if (K <= 0) then + begin + ShowMessage('ERROR! You must enter the desired number of clusters.'); + goto cleanup; + end; + + // initialize arrays + for i := 1 to K do + begin + AN1[i] := 0.0; + AN2[i] := 0.0; + WSS[i] := 0.0; + NC[i] := 0; + NCP[i] := 0; + ITRAN[i] := 0; + LIVE[i] := 0; + for j := 1 to N do C[i,j] := 0.0; + end; + for i := 1 to M do + begin + IC1[i] := 0; + IC2[i] := 0; + D[i] := 0.0; + end; + + //Get labels and columns of selected variables + for i := 0 to Ncols - 1 do + begin + cellstring := ListBox1.Items.Strings[i]; + for j := 0 to NoVariables - 1 do + begin + if (cellstring = OS3MainFrm.DataGrid.Cells[j+1,0]) then + begin + varlabels[i] := cellstring; + ColSelected[i] := j+1; + end; + end; + end; + + // Get labels of rows + for i := 0 to NoCases - 1 do rowlabels[i] := OS3MainFrm.DataGrid.Cells[0,i+1]; + + // read the data + for i := 1 to M do + begin + if (NOT GoodRecord(i,N,ColSelected)) then continue; + for j := 1 to N do + begin + col := ColSelected[j-1]; + A[i,j] := StrToFloat(OS3MainFrm.DataGrid.Cells[col,i]); + end; + end; + + OutPutFrm.RichEdit.Clear; + OutPutFrm.RichEdit.Lines.Add('K-Means Clustering. Adapted from AS 136 APPL. STATIST. (1979) VOL.28, NO.1'); + OutPutFrm.RichEdit.Lines.Add(''); + outline := format('File := %s',[OS3MainFrm.FileNameEdit.Text]); + OutPutFrm.RichEdit.Lines.Add(outline); + outline := format('No. Cases := %d, No. Variables := %d, No. Clusters := %d',[M,N,K]); + OutPutFrm.RichEdit.Lines.Add(outline); + OutPutFrm.RichEdit.Lines.Add(''); + + // transform to z scores if needed + if (StdChkBox.Checked = true) then + begin + for j := 1 to N do + begin + Mean := 0.0; + stddev := 0.0; + for i := 1 to M do + begin + Mean := Mean + A[i,j]; + stddev := stddev + (A[i,j] * A[i,j]); + end; + stddev := stddev - Mean * Mean / M; + stddev := stddev / (M - 1); + Mean := Mean / M; + if (DescChkBox.Checked) then + begin + outline := format('Mean := %8.3f, Std.Dev. := %8.3f for %s',[Mean,stddev,varlabels[j-1]]); + OutPutFrm.RichEdit.Lines.Add(outline); + end; + for i := 1 to M do + begin + A[i,j] := (A[i,j] - Mean) / stddev; + if (RepChkBox.Checked = true) then + begin + col := ColSelected[j-1]; + outline := format('%8.5f',[A[i,j]]); + OS3MainFrm.DataGrid.Cells[col,i] := outline; + end; + end; + end; + end; + + // Now enter initial points + for L := 1 to K do + begin + center := 1 + (L-1) * (M div K); // initial cluster center + for j := 1 to N do C[L,j] := A[center,j]; + end; + + // do analysis + KMNS(A,M,N,C,K,IC1,IC2,NC,AN1,AN2,NCP,D,ITRAN,LIVE,ITER,WSS,IFAULT); + + // show results + + // sort subjects by cluster + for i := 1 to M do IC2[i] := i; // store ids in here + for i := 1 to M - 1 do + begin + for j := i+1 to M do + begin + if (IC1[i] > IC1[j]) then // swap these clusters and ids + begin + itemp := IC1[i]; + IC1[i] := IC1[j]; + IC1[j] := itemp; + itemp := IC2[i]; + IC2[i] := IC2[j]; + IC2[j] := itemp; + end; + end; + end; + + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add('NUMBER OF SUBJECTS IN EACH CLUSTER'); + for i := 1 to K do + begin + outline := format('Cluster := %d with %d cases.',[i,NC[i]]); + OutPutFrm.RichEdit.Lines.Add(outline); + end; + + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add('PLACEMENT OF SUBJECTS IN CLUSTERS'); + OutPutFrm.RichEdit.Lines.Add('CLUSTER SUBJECT'); + for i := 1 to M do + begin + outline := format(' %3d %3d',[IC1[i],IC2[i]]); + OutPutFrm.RichEdit.Lines.Add(outline); + end; + + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add('AVERAGE VARIABLE VALUES BY CLUSTER'); + outline := ' VARIABLES'; + OutPutFrm.RichEdit.Lines.Add(outline); + outline := 'CLUSTER'; + for j := 1 to N do + begin + strval := format(' %3d ',[j]); + outline := outline + strval; + end; + OutPutFrm.RichEdit.Lines.Add(outline); + OutPutFrm.RichEdit.Lines.Add(' '); + for i := 1 to K do + begin + outline := format(' %3d ',[i]); + for j := 1 to N do + begin + strval := format('%5.2f ',[C[i,j]]); + outline := outline + strval; + end; + OutPutFrm.RichEdit.Lines.Add(outline); + end; + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add('WITHIN CLUSTER SUMS OF SQUARES'); + for i := 1 to K do + begin + outline := format('Cluster %d := %6.3f',[i,WSS[i]]); + OutPutFrm.RichEdit.Lines.Add(outline); + end; + + OutPutFrm.ShowModal; + + // cleanup +cleanup: + LIVE := nil; + ITRAN := nil; + NCP := nil; + NC := nil; + IC2 := nil; + IC1 := nil; + DT := nil; + WSS := nil; + AN2 := nil; + AN1 := nil; + D := nil; + C := nil; + A := nil; + ColSelected := nil; + rowlabels := nil; + varlabels := nil; +end; + +procedure Tkmeansfrm.KMNS(VAR A : DblDyneMat; M, N : integer; + VAR C : DblDyneMat; K : integer; VAR IC1 : IntDyneVec; + VAR IC2 : IntDyneVec; VAR NC : IntDyneVec; + VAR AN1 : DblDyneVec; VAR AN2 : DblDyneVec; + VAR NCP : IntDyneVec; VAR D : DblDyneVec; + VAR ITRAN : IntDyneVec; VAR LIVE : IntDyneVec; + ITER : integer; VAR WSS : DblDyneVec; IFAULT : integer); +VAR + DT : array[0..2] of double; + BIG : double; + ZERO : double; + ONE : double; + DA, DB, DC, TEMP, AA : double; + L, II, INDX, I, J, IL, IJ : integer; +label cont50, cont40, cont150; + +begin + // SUBROUTINE KMNS(A, M, N, C, K, IC1, IC2, NC, AN1, AN2, NCP, D, + // * ITRAN, LIVE, ITER, WSS, IFAULT) + // + // ALGORITHM AS 136 APPL. STATIST. (1979) VOL.28, NO.1 + // Divide M points in N-dimensional space into K clusters so that + // the within cluster sum of squares is minimized. + // + // INTEGER IC1(M), IC2(M), NC(K), NCP(K), ITRAN(K), LIVE(K) + // REAL A(M,N), D(M), C(K,N), AN1(K), AN2(K), WSS(K), DT(2) + // REAL ZERO, ONE + // + // Define BIG to be a very large positive number + // + // DATA BIG /1.E30/, ZERO /0.0/, ONE /1.0/ + // + BIG := 1.0e30; + ZERO := 0.0; + ONE := 1.0; + IFAULT := 3; + if ((K <= 1) or (K >= M)) then + begin + ShowMessage('The no. of clusters must be less than the no. of variables.'); + exit; + end; + + // For each point I, find its two closest centres, IC1(I) and + // IC2(I). Assign it to IC1(I). + // + for I := 1 to M do + begin + IC1[I] := 1; + IC2[I] := 2; + for IL := 1 to 2 do + begin + DT[IL] := ZERO; + for J := 1 to N do + begin + DA := A[I,J] - C[IL,J]; + DT[IL] := DT[IL] + (DA * DA); //(squared difference for this comparison) + end; // 10 CONTINUE + end; // 10 CONTINUE + if (DT[1] > DT[2]) then // THEN swap + begin + IC1[I] := 2; + IC2[I] := 1; + TEMP := DT[1]; + DT[1] := DT[2]; + DT[2] := TEMP; + end; // END IF + for L := 3 to K do // (remaining clusters) + begin + DB := ZERO; + for J := 1 to N do // (variables) + begin + DC := A[I,J] - C[L,J]; + DB := DB + DC * DC; + if (DB >= DT[2]) then goto cont50; + end; + if (DB < DT[1]) then goto cont40; + DT[2] := DB; + IC2[I] := L; + goto cont50; +cont40: DT[2] := DT[1]; + IC2[I] := IC1[I]; + DT[1] := DB; + IC1[I] := L; +cont50: end; + end; // 50 CONTINUE (next case) + + // Update cluster centres to be the average of points contained + // within them. + // + for L := 1 to K do // (clusters) + begin + NC[L] := 0; + for J := 1 to N do C[L,J] := ZERO; //(initialize clusters) + end; + for I := 1 to M do // (subjects) + begin + L := IC1[I]; // which cluster the Ith case is in + NC[L] := NC[L] + 1; // no. in the cluster L + for J := 1 to N do C[L,J] := C[L,J] + A[I,J]; // sum of var. values in the cluster L + end; + + // Check to see if there is any empty cluster at this stage + // + for L := 1 to K do + begin + if (NC[L] = 0) then + begin + IFAULT := 1; + exit; + end; + AA := NC[L]; + for J := 1 to N do C[L,J] := C[L,J] / AA; // average the values in the cluster + + // Initialize AN1, AN2, ITRAN & NCP + // AN1(L) := NC(L) / (NC(L) - 1) + // AN2(L) := NC(L) / (NC(L) + 1) + // ITRAN(L) := 1 if cluster L is updated in the quick-transfer stage, + // := 0 otherwise + // In the optimal-transfer stage, NCP(L) stores the step at which + // cluster L is last updated. + // In the quick-transfer stage, NCP(L) stores the step at which + // cluster L is last updated plus M. + // + AN2[L] := AA / (AA + ONE); + AN1[L] := BIG; + if (AA > ONE) then AN1[L] := AA / (AA - ONE); + ITRAN[L] := 1; + NCP[L] := -1; + end; + INDX := 0; + for IJ := 1 to ITER do + begin + // + // In this stage, there is only one pass through the data. Each + // point is re-allocated, if necessary, to the cluster that will + // induce the maximum reduction in within-cluster sum of squares. + // + OPTRA(A, M, N, C, K, IC1, IC2, NC, AN1, AN2, NCP, D, ITRAN, LIVE, INDX); + // + // Stop if no transfer took place in the last M optimal transfer + // steps. + // + if (INDX = M) then goto cont150; + // + // Each point is tested in turn to see if it should be re-allocated + // to the cluster to which it is most likely to be transferred, + // IC2(I), from its present cluster, IC1(I). Loop through the + // data until no further change is to take place. + // + QTRAN(A, M, N, C, K, IC1, IC2, NC, AN1, AN2, NCP, D, ITRAN, INDX); + // + // If there are only two clusters, there is no need to re-enter the + // optimal transfer stage. + // + if (K = 2) then goto cont150; + // + // NCP has to be set to 0 before entering OPTRA. + // + for L := 1 to K do NCP[L] := 0; + end; + // + // Since the specified number of iterations has been exceeded, set + // IFAULT := 2. This may indicate unforeseen looping. + // + IFAULT := 2; + // + // Compute within-cluster sum of squares for each cluster. + // +cont150: + for L := 1 to K do + begin + WSS[L] := ZERO; + for J := 1 to N do C[L,J] := ZERO; + end; + for I := 1 to M do + begin + II := IC1[I]; + for J := 1 to N do C[II,J] := C[II,J] + A[I,J]; + end; + for J := 1 to N do + begin + for L := 1 to K do C[L,J] := C[L,J] / (NC[L]); + for I := 1 to M do + begin + II := IC1[I]; + DA := A[I,J] - C[II,J]; + WSS[II] := WSS[II] + DA * DA; + end; + end; // 190 CONTINUE +end; + + +procedure Tkmeansfrm.OPTRA(VAR A : DblDyneMat; M, N : integer; + VAR C : DblDyneMat; K : integer; + VAR IC1 : IntDyneVec; VAR IC2 : IntDyneVec; + VAR NC : IntDyneVec; VAR AN1 : DblDyneVec; + VAR AN2 : DblDyneVec; VAR NCP : IntDyneVec; + VAR D : DblDyneVec; VAR ITRAN : IntDyneVec; + VAR LIVE : IntDyneVec; INDX : integer); +VAR + ZERO, ONE, BIG,DE, DF, DD, DC, DB, DA, R2, RR, AL1, AL2, ALT, ALW : double; + I, J, L, L1, L2, LL : integer; +label cont30, cont60, cont70, cont90; + +begin + // SUBROUTINE OPTRA(A, M, N, C, K, IC1, IC2, NC, AN1, AN2, NCP, D, + // * ITRAN, LIVE, INDX) + // + // ALGORITHM AS 136.1 APPL. STATIST. (1979) VOL.28, NO.1 + // + // This is the optimal transfer stage. + // + // Each point is re-allocated, if necessary, to the cluster that + // will induce a maximum reduction in the within-cluster sum of + // squares. + // + // INTEGER IC1(M), IC2(M), NC(K), NCP(K), ITRAN(K), LIVE(K) + // REAL A(M,N), D(M), C(K,N), AN1(K), AN2(K), ZERO, ONE + // + // Define BIG to be a very large positive number. + // + // DATA BIG /1.0E30/, ZERO /0.0/, ONE/1.0/ + // + // If cluster L is updated in the last quick-transfer stage, it + // belongs to the live set throughout this stage. Otherwise, at + // each step, it is not in the live set if it has not been updated + // in the last M optimal transfer steps. + // + + ZERO := 0.0; + ONE := 1.0; + BIG := 1.0e30; + + for L := 1 to K do + begin + if (ITRAN[L] = 1) then LIVE[L] := M + 1; + end; // 10 CONTINUE + + for I := 1 to M do + begin + INDX := INDX + 1; + L1 := IC1[I]; + L2 := IC2[I]; + LL := L2; + // + // If point I is the only member of cluster L1, no transfer. + // + if (NC[L1] = 1) then goto cont90; // GO TO 90 + // + // If L1 has not yet been updated in this stage, no need to + // re-compute D(I). + // + if (NCP[L1] = 0) then goto cont30; // GO TO 30 + DE := ZERO; + for J := 1 to N do + begin + DF := A[I,J] - C[L1,J]; + DE := DE + DF * DF; + end; + D[I] := DE * AN1[L1]; + // + // Find the cluster with minimum R2. + // +cont30: + DA := ZERO; + for J := 1 to N do + begin + DB := A[I,J] - C[L2,J]; + DA := DA + DB * DB; + end; + R2 := DA * AN2[L2]; + for L := 1 to K do + begin + // + // If I >:= LIVE(L1), then L1 is not in the live set. If this is + // true, we only need to consider clusters that are in the live set + // for possible transfer of point I. Otherwise, we need to consider + // all possible clusters. + // + if ((I >= LIVE[L1]) and (I >= LIVE[L]) or (L = L1) or (L = LL)) then goto cont60; + RR := R2 / AN2[L]; + DC := ZERO; + for J := 1 to N do + begin + DD := A[I,J] - C[L,J]; + DC := DC + DD * DD; + if (DC >= RR) then goto cont60; + end; + R2 := DC * AN2[L]; + L2 := L; +cont60: + end; // 60 CONTINUE + if (R2 < D[I]) then goto cont70; + // + // If no transfer is necessary, L2 is the new IC2(I). + // + IC2[I] := L2; + goto cont90; // GO TO 90 + // + // Update cluster centres, LIVE, NCP, AN1 & AN2 for clusters L1 and + // L2, and update IC1(I) & IC2(I). + // +cont70: + INDX := 0; + LIVE[L1] := M + I; + LIVE[L2] := M + I; + NCP[L1] := I; + NCP[L2] := I; + AL1 := NC[L1]; + ALW := AL1 - ONE; + AL2 := NC[L2]; + ALT := AL2 + ONE; + for J := 1 to N do + begin + C[L1,J] := (C[L1,J] * AL1 - A[I,J]) / ALW; + C[L2,J] := (C[L2,J] * AL2 + A[I,J]) / ALT; + end; + NC[L1] := NC[L1] - 1; + NC[L2] := NC[L2] + 1; + AN2[L1] := ALW / AL1; + AN1[L1] := BIG; + if (ALW > ONE) then AN1[L1] := ALW / (ALW - ONE); + AN1[L2] := ALT / AL2; + AN2[L2] := ALT / (ALT + ONE); + IC1[I] := L2; + IC2[I] := L1; +cont90: + // 90 CONTINUE + if (INDX = M) then exit; + end; // 100 CONTINUE + for L := 1 to K do + begin + // + // ITRAN(L) := 0 before entering QTRAN. Also, LIVE(L) has to be + // decreased by M before re-entering OPTRA. + // + ITRAN[L] := 0; + LIVE[L] := LIVE[L] - M; + end; // 110 CONTINUE +end; + +procedure Tkmeansfrm.QTRAN(VAR A : DblDyneMat; M, N : integer; + VAR C : DblDyneMat; K : integer; + VAR IC1 : IntDyneVec; VAR IC2 : IntDyneVec; + VAR NC : IntDyneVec; VAR AN1 : DblDyneVec; + VAR AN2 : DblDyneVec; VAR NCP : IntDyneVec; + VAR D : DblDyneVec; VAR ITRAN : IntDyneVec; + INDX : integer); +VAR + BIG, ZERO, ONE, DA, DB, DE, DD, R2, AL1, ALW, AL2, ALT : double; + I, J, L, ICOUN, ISTEP, L1, L2 : integer; +label cont10, cont30, cont60; + +begin + // SUBROUTINE QTRAN(A, M, N, C, K, IC1, IC2, NC, AN1, AN2, NCP, D, + // * ITRAN, INDX) + // + // ALGORITHM AS 136.2 APPL. STATIST. (1979) VOL.28, NO.1 + // + // This is the quick transfer stage. + // IC1(I) is the cluster which point I belongs to. + // IC2(I) is the cluster which point I is most likely to be + // transferred to. + // For each point I, IC1(I) & IC2(I) are switched, if necessary, to + // reduce within-cluster sum of squares. The cluster centres are + // updated after each step. + // + // INTEGER IC1(M), IC2(M), NC(K), NCP(K), ITRAN(K) + // REAL A(M,N), D(M), C(K,N), AN1(K), AN2(K), ZERO, ONE + // + // Define BIG to be a very large positive number + // + // DATA BIG /1.0E30/, ZERO /0.0/, ONE /1.0/ + // + // In the optimal transfer stage, NCP(L) indicates the step at which + // cluster L is last updated. In the quick transfer stage, NCP(L) + // is equal to the step at which cluster L is last updated plus M. + // + BIG := 1.0e30; + ZERO := 0.0; + ONE := 1.0; + ICOUN := 0; + ISTEP := 0; +cont10: + for I := 1 to M do + begin + ICOUN := ICOUN + 1; + ISTEP := ISTEP + 1; + L1 := IC1[I]; + L2 := IC2[I]; + // + // If point I is the only member of cluster L1, no transfer. + // + if (NC[L1] = 1) then goto cont60; + // + // If ISTEP > NCP(L1), no need to re-compute distance from point I to + // cluster L1. Note that if cluster L1 is last updated exactly M + // steps ago, we still need to compute the distance from point I to + // cluster L1. + // + if (ISTEP > NCP[L1]) then goto cont30; + DA := ZERO; + for J := 1 to N do + begin + DB := A[I,J] - C[L1,J]; + DA := DA + DB * DB; + end; + D[I] := DA * AN1[L1]; + // + // If ISTEP >:= both NCP(L1) & NCP(L2) there will be no transfer of + // point I at this step. + // +cont30: + if ((ISTEP >= NCP[L1]) and (ISTEP >= NCP[L2])) then goto cont60; + R2 := D[I] / AN2[L2]; + DD := ZERO; + for J := 1 to N do + begin + DE := A[I,J] - C[L2,J]; + DD := DD + DE * DE; + if (DD >= R2) then goto cont60; + end; // 40 CONTINUE + // + // Update cluster centres, NCP, NC, ITRAN, AN1 & AN2 for clusters + // L1 & L2. Also update IC1(I) & IC2(I). Note that if any + // updating occurs in this stage, INDX is set back to 0. + // + ICOUN := 0; + INDX := 0; + ITRAN[L1] := 1; + ITRAN[L2] := 1; + NCP[L1] := ISTEP + M; + NCP[L2] := ISTEP + M; + AL1 := NC[L1]; + ALW := AL1 - ONE; + AL2 := NC[L2]; + ALT := AL2 + ONE; + for J := 1 to N do + begin + C[L1,J] := (C[L1,J] * AL1 - A[I,J]) / ALW; + C[L2,J] := (C[L2,J] * AL2 + A[I,J]) / ALT; + end; // 50 CONTINUE + NC[L1] := NC[L1] - 1; + NC[L2] := NC[L2] + 1; + AN2[L1] := ALW / AL1; + AN1[L1] := BIG; + if (ALW > ONE) then AN1[L1] := ALW / (ALW - ONE); + AN1[L2] := ALT / AL2; + AN2[L2] := ALT / (ALT + ONE); + IC1[I] := L2; + IC2[I] := L1; + // + // If no re-allocation took place in the last M steps, return. + // +cont60: + if (ICOUN = M) then exit; + end; // 70 CONTINUE + goto cont10; +end; + +initialization + {$I kmeansunit.lrs} + +end. + diff --git a/applications/lazstats/source_orig/kr21unit.lfm b/applications/lazstats/source_orig/kr21unit.lfm new file mode 100644 index 000000000..973090c2e --- /dev/null +++ b/applications/lazstats/source_orig/kr21unit.lfm @@ -0,0 +1,111 @@ +object KR21Frm: TKR21Frm + Left = 151 + Height = 227 + Top = 98 + Width = 204 + Caption = 'Kuder-Richarson #21' + ClientHeight = 227 + ClientWidth = 204 + OnShow = FormShow + LCLVersion = '0.9.26.2' + object Label1: TLabel + Left = 7 + Height = 14 + Top = 16 + Width = 120 + Caption = 'Maximum Score Possible:' + ParentColor = False + end + object Label2: TLabel + Left = 7 + Height = 14 + Top = 46 + Width = 118 + Caption = 'Mean of he Test Scores:' + ParentColor = False + end + object Label3: TLabel + Left = 7 + Height = 14 + Top = 80 + Width = 123 + Caption = 'Std. Dev. of Test Scores:' + ParentColor = False + end + object Label4: TLabel + Left = 6 + Height = 14 + Top = 112 + Width = 130 + Caption = 'KR#21 Reliability Estimate:' + ParentColor = False + end + object NoItemsEdit: TEdit + Left = 143 + Height = 22 + Top = 8 + Width = 49 + TabOrder = 0 + Text = 'NoItemsEdit' + end + object MeanEdit: TEdit + Left = 143 + Height = 22 + Top = 38 + Width = 49 + TabOrder = 1 + Text = 'Edit1' + end + object StdDevEdit: TEdit + Left = 143 + Height = 22 + Top = 72 + Width = 49 + TabOrder = 2 + Text = 'Edit1' + end + object RelEdit: TEdit + Left = 143 + Height = 22 + Top = 104 + Width = 49 + TabOrder = 3 + Text = 'Edit1' + end + object ResetBtn: TButton + Left = 6 + Height = 32 + Top = 137 + Width = 69 + Caption = 'Reset' + OnClick = ResetBtnClick + TabOrder = 4 + end + object CancelBtn: TButton + Left = 123 + Height = 32 + Top = 137 + Width = 69 + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 5 + end + object ComputeBtn: TButton + Left = 8 + Height = 32 + Top = 184 + Width = 69 + Caption = 'Compute' + OnClick = ComputeBtnClick + TabOrder = 6 + end + object ReturnBtn: TButton + Left = 123 + Height = 32 + Top = 184 + Width = 69 + Caption = 'Return' + ModalResult = 1 + TabOrder = 7 + end +end diff --git a/applications/lazstats/source_orig/kr21unit.lrs b/applications/lazstats/source_orig/kr21unit.lrs new file mode 100644 index 000000000..4bb96633a --- /dev/null +++ b/applications/lazstats/source_orig/kr21unit.lrs @@ -0,0 +1,29 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('TKR21Frm','FORMDATA',[ + 'TPF0'#8'TKR21Frm'#7'KR21Frm'#4'Left'#3#151#0#6'Height'#3#227#0#3'Top'#2'b'#5 + +'Width'#3#204#0#7'Caption'#6#19'Kuder-Richarson #21'#12'ClientHeight'#3#227#0 + +#11'ClientWidth'#3#204#0#6'OnShow'#7#8'FormShow'#10'LCLVersion'#6#8'0.9.26.2' + +#0#6'TLabel'#6'Label1'#4'Left'#2#7#6'Height'#2#14#3'Top'#2#16#5'Width'#2'x'#7 + +'Caption'#6#23'Maximum Score Possible:'#11'ParentColor'#8#0#0#6'TLabel'#6'La' + +'bel2'#4'Left'#2#7#6'Height'#2#14#3'Top'#2'.'#5'Width'#2'v'#7'Caption'#6#23 + +'Mean of he Test Scores:'#11'ParentColor'#8#0#0#6'TLabel'#6'Label3'#4'Left'#2 + +#7#6'Height'#2#14#3'Top'#2'P'#5'Width'#2'{'#7'Caption'#6#25'Std. Dev. of Tes' + +'t Scores:'#11'ParentColor'#8#0#0#6'TLabel'#6'Label4'#4'Left'#2#6#6'Height'#2 + +#14#3'Top'#2'p'#5'Width'#3#130#0#7'Caption'#6#27'KR#21 Reliability Estimate:' + +#11'ParentColor'#8#0#0#5'TEdit'#11'NoItemsEdit'#4'Left'#3#143#0#6'Height'#2 + +#22#3'Top'#2#8#5'Width'#2'1'#8'TabOrder'#2#0#4'Text'#6#11'NoItemsEdit'#0#0#5 + +'TEdit'#8'MeanEdit'#4'Left'#3#143#0#6'Height'#2#22#3'Top'#2'&'#5'Width'#2'1' + +#8'TabOrder'#2#1#4'Text'#6#5'Edit1'#0#0#5'TEdit'#10'StdDevEdit'#4'Left'#3#143 + +#0#6'Height'#2#22#3'Top'#2'H'#5'Width'#2'1'#8'TabOrder'#2#2#4'Text'#6#5'Edit' + +'1'#0#0#5'TEdit'#7'RelEdit'#4'Left'#3#143#0#6'Height'#2#22#3'Top'#2'h'#5'Wid' + +'th'#2'1'#8'TabOrder'#2#3#4'Text'#6#5'Edit1'#0#0#7'TButton'#8'ResetBtn'#4'Le' + +'ft'#2#6#6'Height'#2' '#3'Top'#3#137#0#5'Width'#2'E'#7'Caption'#6#5'Reset'#7 + +'OnClick'#7#13'ResetBtnClick'#8'TabOrder'#2#4#0#0#7'TButton'#9'CancelBtn'#4 + +'Left'#2'{'#6'Height'#2' '#3'Top'#3#137#0#5'Width'#2'E'#7'Caption'#6#6'Cance' + +'l'#11'ModalResult'#2#2#8'TabOrder'#2#5#0#0#7'TButton'#10'ComputeBtn'#4'Left' + +#2#8#6'Height'#2' '#3'Top'#3#184#0#5'Width'#2'E'#7'Caption'#6#7'Compute'#7'O' + +'nClick'#7#15'ComputeBtnClick'#8'TabOrder'#2#6#0#0#7'TButton'#9'ReturnBtn'#4 + +'Left'#2'{'#6'Height'#2' '#3'Top'#3#184#0#5'Width'#2'E'#7'Caption'#6#6'Retur' + +'n'#11'ModalResult'#2#1#8'TabOrder'#2#7#0#0#0 +]); diff --git a/applications/lazstats/source_orig/kr21unit.pas b/applications/lazstats/source_orig/kr21unit.pas new file mode 100644 index 000000000..d3ad96711 --- /dev/null +++ b/applications/lazstats/source_orig/kr21unit.pas @@ -0,0 +1,73 @@ +unit KR21Unit; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, + StdCtrls; + +type + + { TKR21Frm } + + TKR21Frm = class(TForm) + ResetBtn: TButton; + CancelBtn: TButton; + ComputeBtn: TButton; + ReturnBtn: TButton; + NoItemsEdit: TEdit; + MeanEdit: TEdit; + StdDevEdit: TEdit; + RelEdit: TEdit; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + Label4: TLabel; + procedure ComputeBtnClick(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure ResetBtnClick(Sender: TObject); + private + { private declarations } + public + { public declarations } + end; + +var + KR21Frm: TKR21Frm; + +implementation + +{ TKR21Frm } + +procedure TKR21Frm.ResetBtnClick(Sender: TObject); +begin + NoItemsEdit.Text := ''; + MeanEdit.Text := ''; + StdDevEdit.Text := ''; + RelEdit.Text := ''; +end; + +procedure TKR21Frm.FormShow(Sender: TObject); +begin + ResetBtnClick(self); +end; + +procedure TKR21Frm.ComputeBtnClick(Sender: TObject); +var + items, mean, stddev, rel : double; +begin + items := StrToFloat(NoItemsEdit.Text); + mean := StrToFloat(MeanEdit.Text); + stddev := StrToFloat(StdDevEdit.Text); + rel := (items / (items - 1.0)) * (1.0 - (mean * (items - mean))/ + (items * sqr(stddev))); + RelEdit.Text := FloatToStr(rel); +end; + +initialization + {$I kr21unit.lrs} + +end. + diff --git a/applications/lazstats/source_orig/kwanovaunit.lfm b/applications/lazstats/source_orig/kwanovaunit.lfm new file mode 100644 index 000000000..dee1341fb --- /dev/null +++ b/applications/lazstats/source_orig/kwanovaunit.lfm @@ -0,0 +1,307 @@ +object KWAnovaFrm: TKWAnovaFrm + Left = 154 + Height = 357 + Top = 128 + Width = 339 + Caption = 'Kruskal-Wallis One Way ANOVA on Ranks' + ClientHeight = 357 + ClientWidth = 339 + OnShow = FormShow + LCLVersion = '0.9.30.4' + object Label1: TLabel + Left = 5 + Height = 16 + Top = 4 + Width = 99 + Caption = 'Variables Available' + ParentColor = False + end + object Label2: TLabel + Left = 193 + Height = 16 + Top = 24 + Width = 79 + Caption = 'Group Variable' + ParentColor = False + end + object Label3: TLabel + Left = 193 + Height = 16 + Top = 113 + Width = 104 + Caption = 'Dependent Variable' + ParentColor = False + end + object VarList: TListBox + Left = 6 + Height = 265 + Top = 20 + Width = 140 + ItemHeight = 0 + TabOrder = 0 + end + object GrpIn: TBitBtn + Left = 153 + Height = 31 + Top = 23 + Width = 33 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00216324B81D5E2006FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF002A702F38256929F7216324D9FFFFFF00FFFFFF00FFFFFF00FFFFFF0061BE + 6DFF5DB868FF58B162FF53A95CFF4DA156FF47994FFF419149FF3B8842FF3580 + 3BFF3F8845FF59A15EFF448B49FF216324CFFFFFFF00FFFFFF00FFFFFF0065C3 + 71FFA0D7A9FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF458C4AFF216324C4FFFFFF00FFFFFF0068C7 + 74FFA5DAAEFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF4A9150FF256929C9FFFFFF00FFFFFF0068C7 + 74FF68C774FF65C371FF61BE6DFF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF5AA362FF559D5CFF2F7835D1FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00419149F73B8842DBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0047994FBB41914906FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + NumGlyphs = 0 + OnClick = GrpInClick + TabOrder = 1 + end + object GrpOut: TBitBtn + Left = 152 + Height = 31 + Top = 56 + Width = 33 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF004DA1560647994FB8FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0053A95CD94DA156F747994F38FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF005DB868CF71BE7BFF7AC183FF5BAA64FF47994FFF419149FF3B8842FF3580 + 3BFF2F7835FF2A702FFF256929FF216324FF1D5E20FFFFFFFF00FFFFFF0065C3 + 71C47BC886FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF72BD78FF216324FFFFFFFF00FFFFFF0068C7 + 74C97FCC8AFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF78C07EFF256929FFFFFFFF00FFFFFF00FFFF + FF0068C774D180CD8BFF7CC987FF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF3B8842FF35803BFF2F7835FF2A702FFFFFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C774DB65C371F7FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C7740668C774BBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + NumGlyphs = 0 + OnClick = GrpOutClick + TabOrder = 2 + end + object DepIn: TBitBtn + Left = 153 + Height = 31 + Top = 112 + Width = 33 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00216324B81D5E2006FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF002A702F38256929F7216324D9FFFFFF00FFFFFF00FFFFFF00FFFFFF0061BE + 6DFF5DB868FF58B162FF53A95CFF4DA156FF47994FFF419149FF3B8842FF3580 + 3BFF3F8845FF59A15EFF448B49FF216324CFFFFFFF00FFFFFF00FFFFFF0065C3 + 71FFA0D7A9FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF458C4AFF216324C4FFFFFF00FFFFFF0068C7 + 74FFA5DAAEFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF4A9150FF256929C9FFFFFF00FFFFFF0068C7 + 74FF68C774FF65C371FF61BE6DFF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF5AA362FF559D5CFF2F7835D1FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00419149F73B8842DBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0047994FBB41914906FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + NumGlyphs = 0 + OnClick = DepInClick + TabOrder = 3 + end + object DepOut: TBitBtn + Left = 153 + Height = 31 + Top = 144 + Width = 33 + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF004DA1560647994FB8FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0053A95CD94DA156F747994F38FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF005DB868CF71BE7BFF7AC183FF5BAA64FF47994FFF419149FF3B8842FF3580 + 3BFF2F7835FF2A702FFF256929FF216324FF1D5E20FFFFFFFF00FFFFFF0065C3 + 71C47BC886FF9CD5A5FF98D3A1FF94D09DFF90CE98FF8BCB93FF87C98EFF82C6 + 89FF7EC384FF7AC180FF76BE7CFF72BD78FF216324FFFFFFFF00FFFFFF0068C7 + 74C97FCC8AFFA2D8ABFF9ED6A7FF9AD4A3FF96D29FFF93CF9AFF8ECC95FF89CA + 90FF85C78BFF81C587FF7DC282FF78C07EFF256929FFFFFFFF00FFFFFF00FFFF + FF0068C774D180CD8BFF7CC987FF5DB868FF58B162FF53A95CFF4DA156FF4799 + 4FFF419149FF3B8842FF35803BFF2F7835FF2A702FFFFFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C774DB65C371F7FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0068C7740668C774BBFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 + } + NumGlyphs = 0 + OnClick = DepOutClick + TabOrder = 4 + end + object GrpEdit: TEdit + Left = 191 + Height = 23 + Top = 39 + Width = 120 + TabOrder = 5 + Text = 'GrpEdit' + end + object DepEdit: TEdit + Left = 193 + Height = 23 + Top = 136 + Width = 120 + TabOrder = 6 + Text = 'Edit1' + end + object ResetBtn: TButton + Left = 153 + Height = 32 + Top = 248 + Width = 63 + Caption = 'Reset' + OnClick = ResetBtnClick + TabOrder = 7 + end + object CancelBtn: TButton + Left = 248 + Height = 32 + Top = 248 + Width = 63 + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 8 + end + object ComputeBtn: TButton + Left = 153 + Height = 32 + Top = 304 + Width = 63 + Caption = 'Compute' + OnClick = ComputeBtnClick + TabOrder = 9 + end + object ReturnBtn: TButton + Left = 248 + Height = 32 + Top = 304 + Width = 63 + Caption = 'Return' + ModalResult = 1 + TabOrder = 10 + end + object MWUChk: TCheckBox + Left = 161 + Height = 19 + Top = 206 + Width = 141 + Caption = 'Mann-Whitney U Tests' + TabOrder = 11 + end + object Label4: TLabel + Left = 162 + Height = 16 + Top = 185 + Width = 162 + Caption = 'Post Hoc Comparisons Option' + ParentColor = False + end + object Label5: TLabel + Left = 9 + Height = 16 + Top = 312 + Width = 46 + Caption = 'Alpha = ' + ParentColor = False + end + object AlphaEdit: TEdit + Left = 57 + Height = 23 + Top = 303 + Width = 41 + TabOrder = 12 + Text = 'AlphaEdit' + end +end diff --git a/applications/lazstats/source_orig/kwanovaunit.lrs b/applications/lazstats/source_orig/kwanovaunit.lrs new file mode 100644 index 000000000..3de8006d3 --- /dev/null +++ b/applications/lazstats/source_orig/kwanovaunit.lrs @@ -0,0 +1,239 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('TKWAnovaFrm','FORMDATA',[ + 'TPF0'#11'TKWAnovaFrm'#10'KWAnovaFrm'#4'Left'#3#154#0#6'Height'#3'e'#1#3'Top' + +#3#128#0#5'Width'#3'S'#1#7'Caption'#6'%Kruskal-Wallis One Way ANOVA on Ranks' + +#12'ClientHeight'#3'e'#1#11'ClientWidth'#3'S'#1#6'OnShow'#7#8'FormShow'#10'L' + +'CLVersion'#6#8'0.9.30.4'#0#6'TLabel'#6'Label1'#4'Left'#2#5#6'Height'#2#16#3 + +'Top'#2#4#5'Width'#2'c'#7'Caption'#6#19'Variables Available'#11'ParentColor' + +#8#0#0#6'TLabel'#6'Label2'#4'Left'#3#193#0#6'Height'#2#16#3'Top'#2#24#5'Widt' + +'h'#2'O'#7'Caption'#6#14'Group Variable'#11'ParentColor'#8#0#0#6'TLabel'#6'L' + +'abel3'#4'Left'#3#193#0#6'Height'#2#16#3'Top'#2'q'#5'Width'#2'h'#7'Caption'#6 + +#18'Dependent Variable'#11'ParentColor'#8#0#0#8'TListBox'#7'VarList'#4'Left' + +#2#6#6'Height'#3#9#1#3'Top'#2#20#5'Width'#3#140#0#10'ItemHeight'#2#0#8'TabOr' + +'der'#2#0#0#0#7'TBitBtn'#5'GrpIn'#4'Left'#3#153#0#6'Height'#2#31#3'Top'#2#23 + +#5'Width'#2'!'#10'Glyph.Data'#10':'#4#0#0'6'#4#0#0'BM6'#4#0#0#0#0#0#0'6'#0#0 + +#0'('#0#0#0#16#0#0#0#16#0#0#0#1#0' '#0#0#0#0#0#0#4#0#0'd'#0#0#0'd'#0#0#0#0#0 + +#0#0#0#0#0#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0'!c$'#184#29'^ '#6#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'*p/8%i)' + +#247'!c$'#217#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'a'#190 + +'m'#255']'#184'h'#255'X'#177'b'#255'S'#169'\'#255'M'#161'V'#255'G'#153'O'#255 + +'A'#145'I'#255';'#136'B'#255'5'#128';'#255'?'#136'E'#255'Y'#161'^'#255'D'#139 + +'I'#255'!c$'#207#255#255#255#0#255#255#255#0#255#255#255#0'e'#195'q'#255#160 + +#215#169#255#156#213#165#255#152#211#161#255#148#208#157#255#144#206#152#255 + +#139#203#147#255#135#201#142#255#130#198#137#255'~'#195#132#255'z'#193#128 + +#255'v'#190'|'#255'E'#140'J'#255'!c$'#196#255#255#255#0#255#255#255#0'h'#199 + +'t'#255#165#218#174#255#162#216#171#255#158#214#167#255#154#212#163#255#150 + +#210#159#255#147#207#154#255#142#204#149#255#137#202#144#255#133#199#139#255 + +#129#197#135#255'}'#194#130#255'J'#145'P'#255'%i)'#201#255#255#255#0#255#255 + +#255#0'h'#199't'#255'h'#199't'#255'e'#195'q'#255'a'#190'm'#255']'#184'h'#255 + +'X'#177'b'#255'S'#169'\'#255'M'#161'V'#255'G'#153'O'#255'A'#145'I'#255'Z'#163 + +'b'#255'U'#157'\'#255'/x5'#209#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'A'#145'I'#247 + +';'#136'B'#219#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'G'#153'O'#187 + +'A'#145'I'#6#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#9'NumGlyphs'#2#0#7'OnCl' + +'ick'#7#10'GrpInClick'#8'TabOrder'#2#1#0#0#7'TBitBtn'#6'GrpOut'#4'Left'#3#152 + +#0#6'Height'#2#31#3'Top'#2'8'#5'Width'#2'!'#10'Glyph.Data'#10':'#4#0#0'6'#4#0 + +#0'BM6'#4#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#16#0#0#0#16#0#0#0#1#0' '#0#0#0#0#0#0 + ,#4#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0'M'#161'V'#6'G'#153'O'#184#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0'S'#169'\'#217'M'#161'V'#247'G'#153'O8'#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0']'#184'h'#207 + +'q'#190'{'#255'z'#193#131#255'['#170'd'#255'G'#153'O'#255'A'#145'I'#255';' + +#136'B'#255'5'#128';'#255'/x5'#255'*p/'#255'%i)'#255'!c$'#255#29'^ '#255#255 + +#255#255#0#255#255#255#0'e'#195'q'#196'{'#200#134#255#156#213#165#255#152#211 + +#161#255#148#208#157#255#144#206#152#255#139#203#147#255#135#201#142#255#130 + +#198#137#255'~'#195#132#255'z'#193#128#255'v'#190'|'#255'r'#189'x'#255'!c$' + +#255#255#255#255#0#255#255#255#0'h'#199't'#201#127#204#138#255#162#216#171 + +#255#158#214#167#255#154#212#163#255#150#210#159#255#147#207#154#255#142#204 + +#149#255#137#202#144#255#133#199#139#255#129#197#135#255'}'#194#130#255'x' + +#192'~'#255'%i)'#255#255#255#255#0#255#255#255#0#255#255#255#0'h'#199't'#209 + +#128#205#139#255'|'#201#135#255']'#184'h'#255'X'#177'b'#255'S'#169'\'#255'M' + +#161'V'#255'G'#153'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';'#255'/x5'#255 + +'*p/'#255#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'h'#199't' + +#219'e'#195'q'#247#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'h'#199't' + +#6'h'#199't'#187#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#9'NumGlyphs'#2#0#7'OnClick'#7#11'GrpOutClick'#8'TabOrde' + +'r'#2#2#0#0#7'TBitBtn'#5'DepIn'#4'Left'#3#153#0#6'Height'#2#31#3'Top'#2'p'#5 + +'Width'#2'!'#10'Glyph.Data'#10':'#4#0#0'6'#4#0#0'BM6'#4#0#0#0#0#0#0'6'#0#0#0 + +'('#0#0#0#16#0#0#0#16#0#0#0#1#0' '#0#0#0#0#0#0#4#0#0'd'#0#0#0'd'#0#0#0#0#0#0 + +#0#0#0#0#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + ,#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0'!c$'#184#29'^ '#6#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'*p/8%i)' + +#247'!c$'#217#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'a'#190 + +'m'#255']'#184'h'#255'X'#177'b'#255'S'#169'\'#255'M'#161'V'#255'G'#153'O'#255 + +'A'#145'I'#255';'#136'B'#255'5'#128';'#255'?'#136'E'#255'Y'#161'^'#255'D'#139 + +'I'#255'!c$'#207#255#255#255#0#255#255#255#0#255#255#255#0'e'#195'q'#255#160 + +#215#169#255#156#213#165#255#152#211#161#255#148#208#157#255#144#206#152#255 + +#139#203#147#255#135#201#142#255#130#198#137#255'~'#195#132#255'z'#193#128 + +#255'v'#190'|'#255'E'#140'J'#255'!c$'#196#255#255#255#0#255#255#255#0'h'#199 + +'t'#255#165#218#174#255#162#216#171#255#158#214#167#255#154#212#163#255#150 + +#210#159#255#147#207#154#255#142#204#149#255#137#202#144#255#133#199#139#255 + +#129#197#135#255'}'#194#130#255'J'#145'P'#255'%i)'#201#255#255#255#0#255#255 + +#255#0'h'#199't'#255'h'#199't'#255'e'#195'q'#255'a'#190'm'#255']'#184'h'#255 + +'X'#177'b'#255'S'#169'\'#255'M'#161'V'#255'G'#153'O'#255'A'#145'I'#255'Z'#163 + +'b'#255'U'#157'\'#255'/x5'#209#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'A'#145'I'#247 + +';'#136'B'#219#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'G'#153'O'#187 + +'A'#145'I'#6#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#9'NumGlyphs'#2#0#7'OnCl' + +'ick'#7#10'DepInClick'#8'TabOrder'#2#3#0#0#7'TBitBtn'#6'DepOut'#4'Left'#3#153 + +#0#6'Height'#2#31#3'Top'#3#144#0#5'Width'#2'!'#10'Glyph.Data'#10':'#4#0#0'6' + +#4#0#0'BM6'#4#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#16#0#0#0#16#0#0#0#1#0' '#0#0#0#0 + +#0#0#4#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0'M'#161'V'#6'G'#153'O'#184#255#255#255#0#255#255#255#0#255#255#255 + +#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0'S'#169'\'#217'M'#161'V'#247'G'#153'O8'#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0']'#184'h'#207 + +'q'#190'{'#255'z'#193#131#255'['#170'd'#255'G'#153'O'#255'A'#145'I'#255';' + +#136'B'#255'5'#128';'#255'/x5'#255'*p/'#255'%i)'#255'!c$'#255#29'^ '#255#255 + +#255#255#0#255#255#255#0'e'#195'q'#196'{'#200#134#255#156#213#165#255#152#211 + +#161#255#148#208#157#255#144#206#152#255#139#203#147#255#135#201#142#255#130 + +#198#137#255'~'#195#132#255'z'#193#128#255'v'#190'|'#255'r'#189'x'#255'!c$' + +#255#255#255#255#0#255#255#255#0'h'#199't'#201#127#204#138#255#162#216#171 + ,#255#158#214#167#255#154#212#163#255#150#210#159#255#147#207#154#255#142#204 + +#149#255#137#202#144#255#133#199#139#255#129#197#135#255'}'#194#130#255'x' + +#192'~'#255'%i)'#255#255#255#255#0#255#255#255#0#255#255#255#0'h'#199't'#209 + +#128#205#139#255'|'#201#135#255']'#184'h'#255'X'#177'b'#255'S'#169'\'#255'M' + +#161'V'#255'G'#153'O'#255'A'#145'I'#255';'#136'B'#255'5'#128';'#255'/x5'#255 + +'*p/'#255#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'h'#199't' + +#219'e'#195'q'#247#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'h'#199't' + +#6'h'#199't'#187#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0 + +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255 + +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255 + +#255#0#255#255#255#0#9'NumGlyphs'#2#0#7'OnClick'#7#11'DepOutClick'#8'TabOrde' + +'r'#2#4#0#0#5'TEdit'#7'GrpEdit'#4'Left'#3#191#0#6'Height'#2#23#3'Top'#2''''#5 + +'Width'#2'x'#8'TabOrder'#2#5#4'Text'#6#7'GrpEdit'#0#0#5'TEdit'#7'DepEdit'#4 + +'Left'#3#193#0#6'Height'#2#23#3'Top'#3#136#0#5'Width'#2'x'#8'TabOrder'#2#6#4 + +'Text'#6#5'Edit1'#0#0#7'TButton'#8'ResetBtn'#4'Left'#3#153#0#6'Height'#2' '#3 + +'Top'#3#248#0#5'Width'#2'?'#7'Caption'#6#5'Reset'#7'OnClick'#7#13'ResetBtnCl' + +'ick'#8'TabOrder'#2#7#0#0#7'TButton'#9'CancelBtn'#4'Left'#3#248#0#6'Height'#2 + +' '#3'Top'#3#248#0#5'Width'#2'?'#7'Caption'#6#6'Cancel'#11'ModalResult'#2#2#8 + +'TabOrder'#2#8#0#0#7'TButton'#10'ComputeBtn'#4'Left'#3#153#0#6'Height'#2' '#3 + +'Top'#3'0'#1#5'Width'#2'?'#7'Caption'#6#7'Compute'#7'OnClick'#7#15'ComputeBt' + +'nClick'#8'TabOrder'#2#9#0#0#7'TButton'#9'ReturnBtn'#4'Left'#3#248#0#6'Heigh' + +'t'#2' '#3'Top'#3'0'#1#5'Width'#2'?'#7'Caption'#6#6'Return'#11'ModalResult'#2 + +#1#8'TabOrder'#2#10#0#0#9'TCheckBox'#6'MWUChk'#4'Left'#3#161#0#6'Height'#2#19 + +#3'Top'#3#206#0#5'Width'#3#141#0#7'Caption'#6#20'Mann-Whitney U Tests'#8'Tab' + +'Order'#2#11#0#0#6'TLabel'#6'Label4'#4'Left'#3#162#0#6'Height'#2#16#3'Top'#3 + +#185#0#5'Width'#3#162#0#7'Caption'#6#27'Post Hoc Comparisons Option'#11'Pare' + +'ntColor'#8#0#0#6'TLabel'#6'Label5'#4'Left'#2#9#6'Height'#2#16#3'Top'#3'8'#1 + +#5'Width'#2'.'#7'Caption'#6#8'Alpha = '#11'ParentColor'#8#0#0#5'TEdit'#9'Alp' + +'haEdit'#4'Left'#2'9'#6'Height'#2#23#3'Top'#3'/'#1#5'Width'#2')'#8'TabOrder' + +#2#12#4'Text'#6#9'AlphaEdit'#0#0#0 +]); diff --git a/applications/lazstats/source_orig/kwanovaunit.pas b/applications/lazstats/source_orig/kwanovaunit.pas new file mode 100644 index 000000000..85980e118 --- /dev/null +++ b/applications/lazstats/source_orig/kwanovaunit.pas @@ -0,0 +1,488 @@ +unit KWANOVAUnit; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, + StdCtrls, Buttons, MainUnit, OutPutUnit, FunctionsLib, + Globals, DataProcs, Math; + +type + + { TKWAnovaFrm } + + TKWAnovaFrm = class(TForm) + AlphaEdit: TEdit; + Label4: TLabel; + Label5: TLabel; + MWUChk: TCheckBox; + ResetBtn: TButton; + CancelBtn: TButton; + ComputeBtn: TButton; + ReturnBtn: TButton; + GrpEdit: TEdit; + DepEdit: TEdit; + GrpIn: TBitBtn; + GrpOut: TBitBtn; + DepIn: TBitBtn; + DepOut: TBitBtn; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + VarList: TListBox; + procedure ComputeBtnClick(Sender: TObject); + procedure DepInClick(Sender: TObject); + procedure DepOutClick(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure GrpInClick(Sender: TObject); + procedure GrpOutClick(Sender: TObject); + procedure ResetBtnClick(Sender: TObject); + private + { private declarations } + public + { public declarations } + end; + +var + KWAnovaFrm: TKWAnovaFrm; + +implementation + +{ TKWAnovaFrm } + +procedure TKWAnovaFrm.ResetBtnClick(Sender: TObject); +VAR i : integer; +begin + GrpEdit.Text := ''; + DepEdit.Text := ''; + AlphaEdit.Text := '0.05'; + GrpIn.Visible := true; + GrpOut.Visible := false; + DepIn.Visible := true; + DepOut.Visible := false; + MWUChk.Checked := false; + VarList.Items.Clear; + for i := 1 to NoVariables do + VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]); +end; + +procedure TKWAnovaFrm.FormShow(Sender: TObject); +begin + ResetBtnClick(self); +end; + +procedure TKWAnovaFrm.DepInClick(Sender: TObject); +VAR index : integer; +begin + index := VarList.ItemIndex; + DepEdit.Text := VarList.Items.Strings[index]; + VarList.Items.Delete(index); + DepIn.Visible := false; + DepOut.Visible := true; +end; + +procedure TKWAnovaFrm.ComputeBtnClick(Sender: TObject); +label cleanup, Check1, Check2; +var + i, j, k, m, ind_var, dep_var, min_grp, max_grp, group, total_n : integer; + NoTies, NoTieGroups, nogroups, NoSelected, npairs, n1, n2 : integer; + largestn : integer; + ColNoSelected : IntdyneVec; + group_count : IntDyneVec; + score, t, SumT, Avg, Probchi, H, CorrectedH, value : double; + Correction, Temp, TieSum, alpha, U, U2, SD, z, prob : double; + Ranks, X : DblDyneMat; + RankSums : DblDyneVec; + cellstring, outline : string; +begin + // Check for data + if (NoVariables < 1) then + begin + ShowMessage('ERROR! You must have grid data!'); + exit; + end; + + // allocate space + SetLength(ColNoSelected,NoVariables); + SetLength(Ranks,NoCases,2); + SetLength(X,NoCases,2); + + // Get column numbers of the independent and dependent variables + ind_var := 0; + dep_var := 0; + for i := 1 to NoVariables do + begin + cellstring := GrpEdit.Text; + if (cellstring = OS3MainFrm.DataGrid.Cells[i,0]) then ind_var := i; + cellstring := DepEdit.Text; + if (cellstring = OS3MainFrm.DataGrid.Cells[i,0]) then dep_var := i; + end; + ColNoSelected[0] := ind_var; + ColNoSelected[1] := dep_var; + + //get minimum and maximum group codes + total_n := 0; + NoSelected := 2; + min_grp := 10000; //atoi(MainForm.Grid.Cells[ind_var,1].c_str); + max_grp := -10000; + for i := 1 to NoCases do + begin + if (not GoodRecord(i,NoSelected,ColNoSelected)) then continue; + group := round(StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[ind_var,i]))); + if (group < min_grp) then min_grp := group; + if (group > max_grp) then max_grp := group; + total_n := total_n + 1; + end; + nogroups := max_grp - min_grp + 1; + NoTieGroups := 0; + SumT := 0.0; + H := 0.0; + + // Initialize arrays + SetLength(RankSums,nogroups); + SetLength(group_count,nogroups); + for i := 0 to nogroups-1 do + begin + group_count[i] := 0; + RankSums[i] := 0.0; + end; + + // Setup for printer output + OutPutFrm.RichEdit.Clear; + OutPutFrm.RichEdit.Lines.Add('Kruskal - Wallis One-Way Analysis of Variance'); + OutPutFrm.RichEdit.Lines.Add('See pages 184-194 in S. Siegel: Nonparametric Statistics for the Behavioral Sciences'); + OutPutFrm.RichEdit.Lines.Add(''); + + // Get data + for i := 1 to NoCases do + begin + if (not GoodRecord(i,NoSelected,ColNoSelected)) then continue; + score := StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[dep_var,i])); + group := round(StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[ind_var,i]))); + group := group - min_grp + 1; + if (group > nogroups) then + begin + ShowMessage('ERROR! Group codes must be sequential like 1 and 2!'); + goto cleanup; + end; + group_count[group-1] := group_count[group-1] + 1; + X[i-1,0] := score; + X[i-1,1] := group; + end; + + //Sort all scores in ascending order + for i := 1 to total_n - 1 do + begin + for j := i + 1 to total_n do + begin + if (X[i-1,0] > X[j-1,0]) then + begin + Temp := X[i-1,0]; + X[i-1,0] := X[j-1,0]; + X[j-1,0] := Temp; + Temp := X[i-1,1]; + X[i-1,1] := X[j-1,1]; + X[j-1,1] := Temp; + end; + end; + end; + + // Store ranks + for i := 0 to total_n-1 do + begin + Ranks[i,0] := i+1; + Ranks[i,1] := X[i,1]; + end; + + //Check for ties in ranks - replace with average rank and calculate + //T for each tie and sum of the T's + i := 1; + while i < total_n do + begin + j := i + 1; + TieSum := 0; + NoTies := 0; + while (j < total_n) do + begin + if (X[j-1,0] > X[i-1,0]) then goto Check1; + if (X[j-1,0] = X[i-1,0]) then // match + begin + TieSum := TieSum + round(Ranks[j-1,0]); + NoTies := NoTies + 1; + end; + j := j + 1; + end; +Check1: + if (NoTies > 0) then //At least one tie found + begin + TieSum := TieSum + Ranks[i-1,0]; + NoTies := NoTies + 1; + Avg := TieSum / NoTies; + for j := i to i + NoTies - 1 do Ranks[j-1,0] := Avg; + t := Power(NoTies,3) - NoTies; + SumT := SumT + t; + NoTieGroups := NoTieGroups + 1; + i := i + (NoTies - 1); + end; + i := i + 1; + end; // next i + + // Calculate sum of ranks in each group + for i := 1 to total_n do + begin + group := round(Ranks[i-1,1]); + RankSums[group-1] := RankSums[group-1] + Ranks[i-1,0]; + end; + + // Calculate statistics + for j := 0 to nogroups-1 do H := H + (RankSums[j] * RankSums[j] / (group_count[j])); + H := H * (12.0 / ( total_n * (total_n + 1)) ); + H := H - (3.0 * (total_n + 1)); + Correction := 1.0 - ( SumT / (Power(total_n,3) - total_n) ); + CorrectedH := H / Correction; + k := max_grp - min_grp; + Probchi := 1.0 - chisquaredprob(H, k); + + // Report results + OutPutFrm.RichEdit.Lines.Add(' Score Rank Group'); + OutPutFrm.RichEdit.Lines.Add(''); + for i := 1 to total_n do + begin + outline := format('%10.2f %10.2f %10.0f', + [X[i-1,0], Ranks[i-1,0], Ranks[i-1,1]]); + OutPutFrm.RichEdit.Lines.Add(outline); + end; + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add('Sum of Ranks in each Group'); + OutPutFrm.RichEdit.Lines.Add('Group Sum No. in Group'); + for i := 1 to nogroups do + begin + outline := format('%3d %10.2f %5d', [i+min_grp-1, RankSums[i-1],group_count[i-1]]); + OutPutFrm.RichEdit.Lines.Add(outline); + end; + OutPutFrm.RichEdit.Lines.Add(''); + outline := format('No. of tied rank groups = %3d',[NoTieGroups]); + OutPutFrm.RichEdit.Lines.Add(outline); + outline := format('Statistic H uncorrected for ties = %8.4f',[H]); + OutPutFrm.RichEdit.Lines.Add(outline); + outline := format('Correction for Ties = %6.4f',[Correction]); + OutPutFrm.RichEdit.Lines.Add(outline); + outline := format('Statistic H corrected for ties = %8.4f',[CorrectedH]); + OutPutFrm.RichEdit.Lines.Add(outline); + outline := format('Corrected H is approx. chi-square with %3d D.F. and probability = %6.4f',[k,Probchi]); + OutPutFrm.RichEdit.Lines.Add(outline); + OutPutFrm.ShowModal; + OutPutFrm.RichEdit.Clear; + + if not MWUChk.Checked then goto cleanup; + // do Mann-Whitney U tests on group pairs + alpha := StrToFloat(AlphaEdit.Text); + npairs := nogroups * (nogroups - 1) div 2; + alpha := alpha / npairs; + outline := format('New alpha for %d paired comparisons = %5.3f',[npairs, alpha]); + ShowMessage(outline); + for i := 1 to nogroups - 1 do + begin + for j := i + 1 to nogroups do + begin + // Setup for printer output + OutPutFrm.RichEdit.Clear; + OutPutFrm.RichEdit.Lines.Add('Mann-Whitney U Test'); + OutPutFrm.RichEdit.Lines.Add('See pages 116-127 in S. Siegel: Nonparametric Statistics for the Behavioral Sciences'); + OutPutFrm.RichEdit.Lines.Add(''); + outline := format('Comparison of group %d with group %d',[i,j]); + OutPutFrm.RichEdit.Lines.Add(outline); + group_count[0] := 0; + group_count[1] := 0; + RankSums[0] := 0; + RankSums[1] := 0; + total_n := 0; + for k := 1 to NoCases do + begin + if (not GoodRecord(k,NoSelected,ColNoSelected)) then continue; + score := StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[dep_var,k])); + value := StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[ind_var,k])); + if round(value) = i then + begin + X[total_n,0] := score; + X[total_n,1] := value; + group_count[0] := group_count[0] + 1; + total_n := total_n + 1; + end; + if round(value) = j then + begin + X[total_n,0] := score; + X[total_n,1] := value; + group_count[1] := group_count[1] + 1; + total_n := total_n + 1; + end; + end; // next case k + + //Sort all scores in ascending order + for k := 1 to total_n - 1 do + begin + for m := k + 1 to total_n do + begin + if (X[k-1,0] > X[m-1,0]) then + begin + Temp := X[k-1,0]; + X[k-1,0] := X[m-1,0]; + X[m-1,0] := Temp; + Temp := X[k-1,1]; + X[k-1,1] := X[m-1,1]; + X[m-1,1] := Temp; + end; + end; + end; + + // get ranks for these two groups + for k := 1 to total_n do + begin + Ranks[k-1,0] := k; + Ranks[k-1,1] := X[k-1,1]; + end; + + //Check for ties in ranks - replace with average rank and calculate + //T for each tie and sum of the T's + NoTieGroups := 0; + k := 1; + while k < total_n do + begin + m := k + 1; + TieSum := 0; + NoTies := 0; + while (m < total_n) do + begin + if (X[m-1,0] > X[k-1,0]) then goto Check2; + if (X[m-1,0] = X[k-1,0]) then // match + begin + TieSum := TieSum + round(Ranks[m-1,0]); + NoTies := NoTies + 1; + end; + m := m + 1; + end; + Check2: + if (NoTies > 0) then //At least one tie found + begin + TieSum := TieSum + Ranks[k-1,0]; + NoTies := NoTies + 1; + Avg := TieSum / NoTies; + for m := k to k + NoTies - 1 do Ranks[m-1,0] := Avg; + t := Power(NoTies,3) - NoTies; + SumT := SumT + t; + NoTieGroups := NoTieGroups + 1; + k := k + (NoTies - 1); + end; + k := k + 1; + end; // next k + + // Calculate sum of ranks in each group + for k := 1 to total_n do + begin + group := round(Ranks[k-1,1]); + RankSums[group-1] := RankSums[group-1] + Ranks[k-1,0]; + end; + + //Calculate U for larger and smaller groups + n1 := group_count[0]; + n2 := group_count[1]; + if (n1 > n2) then + begin + group := i-1; + U := (n1 * n2) + ((n1 * (n1 + 1)) / 2.0) - RankSums[group]; + end + else + begin + group := j - 1; + U := (n1 * n2) + ((n2 * (n2 + 1)) / 2.0) - RankSums[group]; + end; + U2 := (n1 * n2) - U; + SD := (n1 * n2 * (n1 + n2 + 1)) / 12.0; + SD := sqrt(SD); + if (U2 > U) then z := (U2 - (n1 * n2 / 2)) / SD + else z := (U - (n1 * n2 / 2)) / SD; + prob := 1.0 - probz(z); + + //Report results + OutPutFrm.RichEdit.Lines.Add(' Score Rank Group'); + OutPutFrm.RichEdit.Lines.Add(''); + for k := 1 to total_n do + begin + outline := format('%10.2f %10.2f %10.0f', + [X[k-1,0], Ranks[k-1,0], Ranks[k-1,1]]); + OutPutFrm.RichEdit.Lines.Add(outline); + end; + OutPutFrm.RichEdit.Lines.Add(''); + OutPutFrm.RichEdit.Lines.Add('Sum of Ranks in each Group'); + OutPutFrm.RichEdit.Lines.Add('Group Sum No. in Group'); + group := i - 1; + outline := format('%3d %10.3f %5d', [i, RankSums[group],group_count[0]]); + OutPutFrm.RichEdit.Lines.Add(outline); + group := j - 1; + outline := format('%3d %10.3f %5d', [j, RankSums[group],group_count[1]]); + OutPutFrm.RichEdit.Lines.Add(outline); + OutPutFrm.RichEdit.Lines.Add(''); + outline := format('No. of tied rank groups = %3d',[NoTieGroups]); + OutPutFrm.RichEdit.Lines.Add(outline); + if (n1 > n2) then largestn := n1 + else largestn := n2; + if (largestn < 20) then + outline := format('Statistic U = %8.4f',[U]) + else + begin + if (U > U2) then outline := format('Statistic U = %8.4f',[U]) + else outline := format('Statistic U = %8.4f',[U2]); + end; + OutPutFrm.RichEdit.Lines.Add(outline); + outline := format('z Statistic (corrected for ties) = %8.4f, Prob. > z = %6.4f', + [z, prob]); + OutPutFrm.RichEdit.Lines.Add(outline); + if (n2 < 20) then + begin + OutPutFrm.RichEdit.Lines.Add('z test is approximate. Use tables of exact probabilities in Siegel.'); + OutPutFrm.RichEdit.Lines.Add('(Table J or K, pages 271-277)'); + end; + OutPutFrm.ShowModal; + end; // next group j + end; // next group i +cleanup: + group_count := nil; + RankSums := nil; + X := nil; + Ranks := nil; + ColNoSelected := nil; +end; + +procedure TKWAnovaFrm.DepOutClick(Sender: TObject); +begin + VarList.Items.Add(DepEdit.Text); + DepEdit.Text := ''; + DepIn.Visible := true; + DepOut.Visible := false; +end; + +procedure TKWAnovaFrm.GrpInClick(Sender: TObject); +VAR index : integer; +begin + index := VarList.ItemIndex; + GrpEdit.Text := VarList.Items.Strings[index]; + VarList.Items.Delete(index); + GrpIn.Visible := false; + GrpOut.Visible := true; +end; + +procedure TKWAnovaFrm.GrpOutClick(Sender: TObject); +begin + VarList.Items.Add(GrpEdit.Text); + GrpEdit.Text := ''; + GrpIn.Visible := true; + GrpOut.Visible := false; +end; + +initialization + {$I kwanovaunit.lrs} + +end. +