You've already forked lazarus-ccr
LazStats: Finetuning of the multiple regression forms. Update their chm pages.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8031 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
Binary file not shown.
Binary file not shown.
@ -31,6 +31,8 @@ inherited BackRegForm: TBackRegForm
|
|||||||
inherited HelpBtn: TButton
|
inherited HelpBtn: TButton
|
||||||
Left = 172
|
Left = 172
|
||||||
Top = 357
|
Top = 357
|
||||||
|
HelpType = htKeyword
|
||||||
|
HelpKeyword = 'html/BackwardStepwise.htm'
|
||||||
TabOrder = 9
|
TabOrder = 9
|
||||||
end
|
end
|
||||||
inherited ButtonBevel: TBevel
|
inherited ButtonBevel: TBevel
|
||||||
|
@ -69,7 +69,7 @@ implementation
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Math,
|
Math,
|
||||||
Utils;
|
Utils, GridProcs;
|
||||||
|
|
||||||
|
|
||||||
{ TBackRegForm }
|
{ TBackRegForm }
|
||||||
@ -214,7 +214,8 @@ begin
|
|||||||
if StepNo > 1 then
|
if StepNo > 1 then
|
||||||
lReport.Add('');
|
lReport.Add('');
|
||||||
lReport.Add('');
|
lReport.Add('');
|
||||||
lReport.Add('----------------- STEP %3d ------------------', [StepNo]);
|
lReport.Add('----------------- STEP %d ------------------', [StepNo]);
|
||||||
|
lReport.Add('');
|
||||||
if CPChkBox.Checked then
|
if CPChkBox.Checked then
|
||||||
begin
|
begin
|
||||||
title := 'Cross-Products Matrix';
|
title := 'Cross-Products Matrix';
|
||||||
@ -277,7 +278,7 @@ begin
|
|||||||
MessageDlg('Matrix is singular!', mtError,[mbOK], 0);
|
MessageDlg('Matrix is singular!', mtError,[mbOK], 0);
|
||||||
// goto cleanup;
|
// goto cleanup;
|
||||||
end;
|
end;
|
||||||
lReport.Add('Determinant of correlation matrix = %8.4f', [determinant]);
|
lReport.Add('Determinant of correlation matrix: %.4f', [determinant]);
|
||||||
lReport.Add('');
|
lReport.Add('');
|
||||||
|
|
||||||
NoIndepVars := NoVars-1;
|
NoIndepVars := NoVars-1;
|
||||||
@ -406,16 +407,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBackRegForm.Reset;
|
procedure TBackRegForm.Reset;
|
||||||
var
|
|
||||||
i: integer;
|
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
|
||||||
DepVarEdit.Clear;
|
DepVarEdit.Clear;
|
||||||
VarList.Clear;
|
|
||||||
SelList.Clear;
|
SelList.Clear;
|
||||||
for i := 1 to NoVariables do
|
CollectVariableNames(OS3MainFrm.DataGrid, VarList.Items);
|
||||||
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]);
|
|
||||||
|
|
||||||
CPChkBox.Checked := false;
|
CPChkBox.Checked := false;
|
||||||
CovChkBox.Checked := false;
|
CovChkBox.Checked := false;
|
||||||
|
@ -28,6 +28,8 @@ inherited BestRegForm: TBestRegForm
|
|||||||
inherited HelpBtn: TButton
|
inherited HelpBtn: TButton
|
||||||
Left = 207
|
Left = 207
|
||||||
Top = 392
|
Top = 392
|
||||||
|
HelpType = htKeyword
|
||||||
|
HelpKeyword = 'html/BestCombinationMultipleRegressio.htm'
|
||||||
end
|
end
|
||||||
inherited ButtonBevel: TBevel
|
inherited ButtonBevel: TBevel
|
||||||
Top = 376
|
Top = 376
|
||||||
|
@ -131,7 +131,7 @@ implementation
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Math,
|
Math,
|
||||||
Utils, MathUnit;
|
Utils, MathUnit, GridProcs;
|
||||||
|
|
||||||
|
|
||||||
{ TBestRegForm }
|
{ TBestRegForm }
|
||||||
@ -736,16 +736,12 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
procedure TBestRegForm.Reset;
|
procedure TBestRegForm.Reset;
|
||||||
var
|
|
||||||
i: integer;
|
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
|
||||||
DepVarEdit.Clear;
|
DepVarEdit.Clear;
|
||||||
BlockList.Clear;
|
BlockList.Clear;
|
||||||
VarList.Clear;
|
CollectVariableNames(OS3MainFrm.DataGrid, VarList.Items);
|
||||||
for i := 1 to NoVariables do
|
|
||||||
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]);
|
|
||||||
|
|
||||||
CPChkBox.Checked := false;
|
CPChkBox.Checked := false;
|
||||||
CovChkBox.Checked := false;
|
CovChkBox.Checked := false;
|
||||||
|
@ -8,6 +8,7 @@ inherited BlkMregForm: TBlkMregForm
|
|||||||
Caption = 'Block Entry Multiple Regression'
|
Caption = 'Block Entry Multiple Regression'
|
||||||
ClientHeight = 415
|
ClientHeight = 415
|
||||||
ClientWidth = 962
|
ClientWidth = 962
|
||||||
|
OnCreate = FormCreate
|
||||||
inherited ParamsPanel: TPanel
|
inherited ParamsPanel: TPanel
|
||||||
Height = 399
|
Height = 399
|
||||||
Width = 442
|
Width = 442
|
||||||
@ -31,6 +32,8 @@ inherited BlkMregForm: TBlkMregForm
|
|||||||
inherited HelpBtn: TButton
|
inherited HelpBtn: TButton
|
||||||
Left = 182
|
Left = 182
|
||||||
Top = 374
|
Top = 374
|
||||||
|
HelpType = htKeyword
|
||||||
|
HelpKeyword = 'html/BlockEntryMultipleRegression.htm'
|
||||||
TabOrder = 12
|
TabOrder = 12
|
||||||
end
|
end
|
||||||
inherited ButtonBevel: TBevel
|
inherited ButtonBevel: TBevel
|
||||||
|
@ -49,6 +49,7 @@ type
|
|||||||
procedure BlockListDblClick(Sender: TObject);
|
procedure BlockListDblClick(Sender: TObject);
|
||||||
procedure DepInBtnClick(Sender: TObject);
|
procedure DepInBtnClick(Sender: TObject);
|
||||||
procedure DepOutBtnClick(Sender: TObject);
|
procedure DepOutBtnClick(Sender: TObject);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure InBtnClick(Sender: TObject);
|
procedure InBtnClick(Sender: TObject);
|
||||||
procedure NextBlkBtnClick(Sender: TObject);
|
procedure NextBlkBtnClick(Sender: TObject);
|
||||||
procedure OutBtnClick(Sender: TObject);
|
procedure OutBtnClick(Sender: TObject);
|
||||||
@ -81,7 +82,7 @@ implementation
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Math,
|
Math,
|
||||||
Utils, MathUnit;
|
Utils, MathUnit, GridProcs;
|
||||||
|
|
||||||
|
|
||||||
{ TBlkMregForm }
|
{ TBlkMregForm }
|
||||||
@ -136,24 +137,24 @@ end;
|
|||||||
procedure TBlkMregForm.Compute;
|
procedure TBlkMregForm.Compute;
|
||||||
var
|
var
|
||||||
i, j, k, errorcode: integer;
|
i, j, k, errorcode: integer;
|
||||||
NoIndepVars, DepVarCol, NEntered, StepNo : integer;
|
NoIndepVars, DepVarCol, NEntered, StepNo: integer;
|
||||||
R2, df1, df2: double;
|
R2, df1, df2: double;
|
||||||
StdErrEst, F, FProbF, OldR2 : double;
|
StdErrEst, F, FProbF, OldR2: double;
|
||||||
pdf1, probin, prout : double;
|
pdf1, probin, prout: double;
|
||||||
BetaWeights : DblDyneVec = nil;
|
BetaWeights: DblDyneVec = nil;
|
||||||
corrs : DblDyneMat = nil;
|
corrs: DblDyneMat = nil;
|
||||||
Means : DblDyneVec = nil;
|
Means: DblDyneVec = nil;
|
||||||
Variances : DblDyneVec = nil;
|
Variances: DblDyneVec = nil;
|
||||||
StdDevs : DblDyneVec = nil;
|
StdDevs: DblDyneVec = nil;
|
||||||
title : string;
|
IndRowLabels: StrDyneVec = nil;
|
||||||
IndRowLabels : StrDyneVec = nil;
|
IndColLabels: StrDyneVec = nil;
|
||||||
IndColLabels : StrDyneVec = nil;
|
IndepInverse: DblDyneMat = nil;
|
||||||
IndepInverse : DblDyneMat = nil;
|
IndepIndex: IntDyneVec = nil;
|
||||||
IndepIndex : IntDyneVec = nil;
|
Candidate: IntDyneVec = nil;
|
||||||
Candidate : IntDyneVec = nil;
|
ColEntered: IntDyneVec = nil;
|
||||||
filename : string;
|
title: string;
|
||||||
ColEntered : IntDyneVec = nil;
|
filename: string;
|
||||||
constant : double;
|
constant: double;
|
||||||
errcode: boolean = false;
|
errcode: boolean = false;
|
||||||
NCases: Integer = 0;
|
NCases: Integer = 0;
|
||||||
lReport: TStrings;
|
lReport: TStrings;
|
||||||
@ -171,7 +172,7 @@ begin
|
|||||||
SetLength(ColEntered,NoVariables);
|
SetLength(ColEntered,NoVariables);
|
||||||
|
|
||||||
NextBlkBtnClick(self);
|
NextBlkBtnClick(self);
|
||||||
probin := StrToFloat(InProb.Text); // probability to include a block
|
probin := StrToFloat(InProb.Text); // probability to include a block
|
||||||
prout := 1.0;
|
prout := 1.0;
|
||||||
|
|
||||||
lReport := TStringList.Create;
|
lReport := TStringList.Create;
|
||||||
@ -437,6 +438,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TBlkMregForm.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InProb.Text := FormatFloat('0.00', DEFAULT_ALPHA_LEVEL);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TBlkMregForm.InBtnClick(Sender: TObject);
|
procedure TBlkMregForm.InBtnClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
i: integer;
|
i: integer;
|
||||||
@ -511,17 +518,13 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
procedure TBlkMregForm.Reset;
|
procedure TBlkMregForm.Reset;
|
||||||
var
|
|
||||||
i: integer;
|
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
|
||||||
BlockList.Items.Clear;
|
BlockList.Items.Clear;
|
||||||
VarList.Items.Clear;
|
|
||||||
BlockNoEdit.Text := '1';
|
BlockNoEdit.Text := '1';
|
||||||
NoBlocks := 1;
|
NoBlocks := 1;
|
||||||
for i := 1 to NoVariables do
|
CollectVariableNames(OS3MainFrm.DataGrid, VarList.Items);
|
||||||
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]);
|
|
||||||
|
|
||||||
CPChkBox.Checked := false;
|
CPChkBox.Checked := false;
|
||||||
CovChkBox.Checked := false;
|
CovChkBox.Checked := false;
|
||||||
@ -534,7 +537,6 @@ begin
|
|||||||
|
|
||||||
NoVars := 0;
|
NoVars := 0;
|
||||||
DepVarEdit.Text := '';
|
DepVarEdit.Text := '';
|
||||||
InProb.Text := FormatFloat('0.00', DEFAULT_ALPHA_LEVEL);
|
|
||||||
|
|
||||||
SetLength(BlkVarCols, NoVariables, NoVariables);
|
SetLength(BlkVarCols, NoVariables, NoVariables);
|
||||||
SetLength(VarsInBlk, NoVariables);
|
SetLength(VarsInBlk, NoVariables);
|
||||||
|
@ -8,6 +8,7 @@ inherited CoxRegForm: TCoxRegForm
|
|||||||
Caption = 'Cox Proportional Hazards Survival Regression'
|
Caption = 'Cox Proportional Hazards Survival Regression'
|
||||||
ClientHeight = 393
|
ClientHeight = 393
|
||||||
ClientWidth = 480
|
ClientWidth = 480
|
||||||
|
OnCreate = FormCreate
|
||||||
inherited ParamsPanel: TPanel
|
inherited ParamsPanel: TPanel
|
||||||
Height = 377
|
Height = 377
|
||||||
ClientHeight = 377
|
ClientHeight = 377
|
||||||
@ -22,6 +23,8 @@ inherited CoxRegForm: TCoxRegForm
|
|||||||
end
|
end
|
||||||
inherited HelpBtn: TButton
|
inherited HelpBtn: TButton
|
||||||
Top = 352
|
Top = 352
|
||||||
|
HelpType = htKeyword
|
||||||
|
HelpKeyword = 'html/CoxProportionalHazardsSurvivalRe.htm'
|
||||||
end
|
end
|
||||||
inherited ButtonBevel: TBevel
|
inherited ButtonBevel: TBevel
|
||||||
Top = 336
|
Top = 336
|
||||||
|
@ -38,13 +38,14 @@ type
|
|||||||
procedure BlockListDblClick(Sender: TObject);
|
procedure BlockListDblClick(Sender: TObject);
|
||||||
procedure DepInBtnClick(Sender: TObject);
|
procedure DepInBtnClick(Sender: TObject);
|
||||||
procedure DepOutBtnClick(Sender: TObject);
|
procedure DepOutBtnClick(Sender: TObject);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure InBtnClick(Sender: TObject);
|
procedure InBtnClick(Sender: TObject);
|
||||||
procedure OutBtnClick(Sender: TObject);
|
procedure OutBtnClick(Sender: TObject);
|
||||||
procedure StatusInBtnClick(Sender: TObject);
|
procedure StatusInBtnClick(Sender: TObject);
|
||||||
procedure StatusOutBtnClick(Sender: TObject);
|
procedure StatusOutBtnClick(Sender: TObject);
|
||||||
function ChiSq(x : double; n : integer) : double;
|
function ChiSq(x: double; n: integer) : double;
|
||||||
function Norm(z : double): double;
|
function Norm(z: double): double;
|
||||||
function ix(j, k, nCols : integer): integer;
|
function ix(j, k, nCols: integer): integer;
|
||||||
procedure VarListDblClick(Sender: TObject);
|
procedure VarListDblClick(Sender: TObject);
|
||||||
procedure VarListSelectionChange(Sender: TObject; {%H-}User: boolean);
|
procedure VarListSelectionChange(Sender: TObject; {%H-}User: boolean);
|
||||||
|
|
||||||
@ -55,6 +56,7 @@ type
|
|||||||
procedure AdjustConstraints; override;
|
procedure AdjustConstraints; override;
|
||||||
procedure Compute; override;
|
procedure Compute; override;
|
||||||
procedure UpdateBtnStates; override;
|
procedure UpdateBtnStates; override;
|
||||||
|
function Validate(out AMsg: String; out AControl: TWinControl): Boolean; override;
|
||||||
|
|
||||||
public
|
public
|
||||||
procedure Reset; override;
|
procedure Reset; override;
|
||||||
@ -69,7 +71,7 @@ implementation
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Math,
|
Math,
|
||||||
Utils;
|
Utils, GridProcs;
|
||||||
|
|
||||||
{ TCoxRegForm }
|
{ TCoxRegForm }
|
||||||
|
|
||||||
@ -161,7 +163,7 @@ var
|
|||||||
SE : DblDyneVec = nil;
|
SE : DblDyneVec = nil;
|
||||||
x : DblDyneVec = nil; // data matrix for independent variables
|
x : DblDyneVec = nil; // data matrix for independent variables
|
||||||
RowLabels : StrDyneVec = nil;
|
RowLabels : StrDyneVec = nil;
|
||||||
ColLabels : StrDyneVec;
|
ColLabels : StrDyneVec = nil;
|
||||||
Lo95 : double;
|
Lo95 : double;
|
||||||
Hi95 : double;
|
Hi95 : double;
|
||||||
d : double;
|
d : double;
|
||||||
@ -169,19 +171,7 @@ var
|
|||||||
lReport: TStrings;
|
lReport: TStrings;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if MaxItsEdit.Text = '' then
|
iters := StrToInt(MaxItsEdit.Text);
|
||||||
begin
|
|
||||||
MaxItsEdit.Setfocus;
|
|
||||||
MessageDlg('Maximum iterations not specified.', mtError, [mbOK], 0);
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
|
|
||||||
if not TryStrToInt(MaxItsEdit.Text, iters) then
|
|
||||||
begin
|
|
||||||
MaxItsEdit.SetFocus;
|
|
||||||
MessageDlg('Valid number required.', mtError, [mbOK], 0);
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ get independent item columns }
|
{ get independent item columns }
|
||||||
nR := BlockList.Items.Count;
|
nR := BlockList.Items.Count;
|
||||||
@ -189,11 +179,6 @@ begin
|
|||||||
SetLength(ColNoSelected,nR + 2);
|
SetLength(ColNoSelected,nR + 2);
|
||||||
SetLength(RowLabels,nR + 2);
|
SetLength(RowLabels,nR + 2);
|
||||||
SetLength(ColLabels,nR + 2);
|
SetLength(ColLabels,nR + 2);
|
||||||
if nR < 1 then
|
|
||||||
begin
|
|
||||||
MessageDlg('No independent variables selected.', mtError, [mbOK], 0);
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
|
|
||||||
for i := 1 to nR do
|
for i := 1 to nR do
|
||||||
begin
|
begin
|
||||||
@ -210,16 +195,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ get survival time variable column and survival status var. column }
|
{ get survival time variable column and survival status var. column }
|
||||||
if DepVar.Text = '' then
|
|
||||||
begin
|
|
||||||
MessageDlg('No Survival time variable selected.', mtError, [mbOK], 0);
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
if StatusEdit.Text = '' then
|
|
||||||
begin
|
|
||||||
MessageDlg('No Survival Status variable selected.', mtError, [mbOK], 0);
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
nP := nR + 1;
|
nP := nR + 1;
|
||||||
nS := nP + 1;
|
nS := nP + 1;
|
||||||
for j := 1 to NoVariables do
|
for j := 1 to NoVariables do
|
||||||
@ -521,6 +496,14 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TCoxRegForm.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
MaxItsEdit.Text := '20';
|
||||||
|
ProbsChk.Checked := true;
|
||||||
|
DescChk.Checked := true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TCoxRegForm.InBtnClick(Sender: TObject);
|
procedure TCoxRegForm.InBtnClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
i: integer;
|
i: integer;
|
||||||
@ -540,7 +523,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function TCoxRegForm.ix(j, k, nCols : integer): integer;
|
function TCoxRegForm.ix(j, k, nCols: integer): integer;
|
||||||
begin
|
begin
|
||||||
Result := j*nCols + k;
|
Result := j*nCols + k;
|
||||||
end;
|
end;
|
||||||
@ -572,20 +555,14 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
procedure TCoxRegForm.Reset;
|
procedure TCoxRegForm.Reset;
|
||||||
var
|
|
||||||
i: integer;
|
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
|
||||||
BlockList.Clear;
|
BlockList.Clear;
|
||||||
VarList.Clear;
|
CollectVariableNames(OS3MainFrm.DataGrid, VarList.Items);
|
||||||
for i := 1 to NoVariables do
|
|
||||||
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]);
|
|
||||||
ProbsChk.Checked := true;
|
|
||||||
DescChk.Checked := true;
|
|
||||||
DepVar.Text := '';
|
DepVar.Text := '';
|
||||||
StatusEdit.Text := '';
|
StatusEdit.Text := '';
|
||||||
MaxItsEdit.Text := '20';
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -631,6 +608,52 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function TCoxRegForm.Validate(out AMsg: String;
|
||||||
|
out AControl: TWinControl): Boolean;
|
||||||
|
var
|
||||||
|
n: Integer;
|
||||||
|
begin
|
||||||
|
Result := false;
|
||||||
|
|
||||||
|
if BlockList.Items.Count < 1 then
|
||||||
|
begin
|
||||||
|
AControl := VarList;
|
||||||
|
AMsg := 'No independent variables selected.';
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if DepVar.Text = '' then
|
||||||
|
begin
|
||||||
|
AControl := VarList;
|
||||||
|
AMsg := 'No Survival time variable selected.';
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if StatusEdit.Text = '' then
|
||||||
|
begin
|
||||||
|
AControl := VarList;
|
||||||
|
AMsg := 'No Survival Status variable selected.';
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if MaxItsEdit.Text = '' then
|
||||||
|
begin
|
||||||
|
AControl := MaxItsEdit;
|
||||||
|
AMsg := 'Maximum iterations not specified.';
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if not TryStrToInt(MaxItsEdit.Text, n) then
|
||||||
|
begin
|
||||||
|
AControl := MaxItsEdit;
|
||||||
|
AMsg := 'Valid number required.';
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Result := true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TCoxRegForm.VarListDblClick(Sender: TObject);
|
procedure TCoxRegForm.VarListDblClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
index: Integer;
|
index: Integer;
|
||||||
|
@ -8,6 +8,7 @@ inherited LogRegForm: TLogRegForm
|
|||||||
Caption = 'Binary Logistic Regression'
|
Caption = 'Binary Logistic Regression'
|
||||||
ClientHeight = 342
|
ClientHeight = 342
|
||||||
ClientWidth = 582
|
ClientWidth = 582
|
||||||
|
OnCreate = FormCreate
|
||||||
inherited ParamsPanel: TPanel
|
inherited ParamsPanel: TPanel
|
||||||
Height = 326
|
Height = 326
|
||||||
ClientHeight = 326
|
ClientHeight = 326
|
||||||
@ -25,6 +26,8 @@ inherited LogRegForm: TLogRegForm
|
|||||||
end
|
end
|
||||||
inherited HelpBtn: TButton
|
inherited HelpBtn: TButton
|
||||||
Top = 301
|
Top = 301
|
||||||
|
HelpType = htKeyword
|
||||||
|
HelpKeyword = 'html/BinaryLogisticRegression.htm'
|
||||||
TabOrder = 9
|
TabOrder = 9
|
||||||
end
|
end
|
||||||
inherited ButtonBevel: TBevel
|
inherited ButtonBevel: TBevel
|
||||||
|
@ -32,6 +32,7 @@ type
|
|||||||
procedure BlockListDblClick(Sender: TObject);
|
procedure BlockListDblClick(Sender: TObject);
|
||||||
procedure DepInBtnClick(Sender: TObject);
|
procedure DepInBtnClick(Sender: TObject);
|
||||||
procedure DepOutBtnClick(Sender: TObject);
|
procedure DepOutBtnClick(Sender: TObject);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure InBtnClick(Sender: TObject);
|
procedure InBtnClick(Sender: TObject);
|
||||||
procedure OutBtnClick(Sender: TObject);
|
procedure OutBtnClick(Sender: TObject);
|
||||||
procedure VarListDblClick(Sender: TObject);
|
procedure VarListDblClick(Sender: TObject);
|
||||||
@ -58,7 +59,7 @@ implementation
|
|||||||
{$R *.lfm}
|
{$R *.lfm}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Math;
|
Math, GridProcs;
|
||||||
|
|
||||||
|
|
||||||
function ix(j, k, nCols: integer): integer;
|
function ix(j, k, nCols: integer): integer;
|
||||||
@ -262,7 +263,7 @@ begin
|
|||||||
if DescChk.Checked then
|
if DescChk.Checked then
|
||||||
lReport.Add(' %3d %15s %10.4f %10.4f',[j,RowLabels[j],xM[j],xSD[j]]);
|
lReport.Add(' %3d %15s %10.4f %10.4f',[j,RowLabels[j],xM[j],xSD[j]]);
|
||||||
end;
|
end;
|
||||||
lReport.Add('------------------------------------------------------------------');
|
lReport.Add(DIVIDER_SMALL_AUTO);
|
||||||
lReport.Add('');
|
lReport.Add('');
|
||||||
xM[0] := 0.0;
|
xM[0] := 0.0;
|
||||||
xSD[0] := 1.0;
|
xSD[0] := 1.0;
|
||||||
@ -373,7 +374,7 @@ begin
|
|||||||
end; // iteration
|
end; // iteration
|
||||||
lReport.Add('Converged');
|
lReport.Add('Converged');
|
||||||
lReport.Add('');
|
lReport.Add('');
|
||||||
lReport.Add('------------------------------------------------------------------');
|
lReport.Add(DIVIDER_SMALL_AUTO);
|
||||||
lReport.Add('');
|
lReport.Add('');
|
||||||
|
|
||||||
CSq := LLn - LL;
|
CSq := LLn - LL;
|
||||||
@ -503,6 +504,14 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TLogRegForm.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
MaxItsEdit.Text := '20';
|
||||||
|
ProbsChk.Checked := true;
|
||||||
|
DescChk.Checked := true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TLogRegForm.InBtnClick(Sender: TObject);
|
procedure TLogRegForm.InBtnClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
i: integer;
|
i: integer;
|
||||||
@ -550,15 +559,9 @@ begin
|
|||||||
inherited;
|
inherited;
|
||||||
|
|
||||||
BlockList.Clear;
|
BlockList.Clear;
|
||||||
VarList.Clear;
|
CollectVariableNames(OS3MainFrm.DataGrid, VarList.Items);
|
||||||
for i := 1 to NoVariables do
|
|
||||||
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]);
|
|
||||||
DepVarEdit.Text := '';
|
DepVarEdit.Text := '';
|
||||||
|
|
||||||
ProbsChk.Checked := true;
|
|
||||||
DescChk.Checked := true;
|
|
||||||
MaxItsEdit.Text := '20';
|
|
||||||
|
|
||||||
UpdateBtnStates;
|
UpdateBtnStates;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -31,6 +31,8 @@ inherited SimultForm: TSimultForm
|
|||||||
inherited HelpBtn: TButton
|
inherited HelpBtn: TButton
|
||||||
Left = 147
|
Left = 147
|
||||||
Top = 406
|
Top = 406
|
||||||
|
HelpType = htKeyword
|
||||||
|
HelpKeyword = 'html/SimultaneousMultipleRegression.htm'
|
||||||
TabOrder = 6
|
TabOrder = 6
|
||||||
end
|
end
|
||||||
inherited ButtonBevel: TBevel
|
inherited ButtonBevel: TBevel
|
||||||
|
@ -62,7 +62,7 @@ implementation
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Math,
|
Math,
|
||||||
Utils, MathUnit;
|
Utils, MathUnit, GridProcs;
|
||||||
|
|
||||||
|
|
||||||
{ TSimultForm }
|
{ TSimultForm }
|
||||||
@ -132,12 +132,12 @@ begin
|
|||||||
lReport := TStringList.Create;
|
lReport := TStringList.Create;
|
||||||
try
|
try
|
||||||
lReport.Add('SIMULTANEOUS MULTIPLE REGRESSION by Bill Miller');
|
lReport.Add('SIMULTANEOUS MULTIPLE REGRESSION by Bill Miller');
|
||||||
lReport.Add('------------------------------------------------------------------');
|
lReport.Add(DIVIDER_SMALL_AUTO);
|
||||||
lReport.Add('');
|
lReport.Add('');
|
||||||
errcode := 0;
|
errcode := 0;
|
||||||
if MatInChkBox.Checked then
|
if MatInChkBox.Checked then
|
||||||
begin
|
begin
|
||||||
OpenDialog1.Filter := 'FreeStat matrix files (*.mat)|*.mat;*.MAT|All files (*.*)|*.*';
|
OpenDialog1.Filter := 'LazStat matrix files (*.mat)|*.mat;*.MAT|All files (*.*)|*.*';
|
||||||
OpenDialog1.FilterIndex := 1;
|
OpenDialog1.FilterIndex := 1;
|
||||||
if OpenDialog1.Execute then
|
if OpenDialog1.Execute then
|
||||||
begin
|
begin
|
||||||
@ -175,7 +175,7 @@ begin
|
|||||||
title := 'Cross-Products Matrix';
|
title := 'Cross-Products Matrix';
|
||||||
GridXProd(NoVars,ColNoSelected,Corrs,errorcode,NCases);
|
GridXProd(NoVars,ColNoSelected,Corrs,errorcode,NCases);
|
||||||
MatPrint(Corrs,NoVars,NoVars,title,RowLabels,ColLabels,NCases, lReport);
|
MatPrint(Corrs,NoVars,NoVars,title,RowLabels,ColLabels,NCases, lReport);
|
||||||
lReport.Add('------------------------------------------------------------------');
|
lReport.Add(DIVIDER_SMALL_AUTO);
|
||||||
lReport.Add('');
|
lReport.Add('');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -185,7 +185,7 @@ begin
|
|||||||
GridCovar(NoVars,ColNoSelected,Corrs,Means,Variances,
|
GridCovar(NoVars,ColNoSelected,Corrs,Means,Variances,
|
||||||
StdDevs,errorcode,NCases);
|
StdDevs,errorcode,NCases);
|
||||||
MatPrint(Corrs,NoVars,NoVars,title,RowLabels,ColLabels,NCases, lReport);
|
MatPrint(Corrs,NoVars,NoVars,title,RowLabels,ColLabels,NCases, lReport);
|
||||||
lReport.Add('------------------------------------------------------------------');
|
lReport.Add(DIVIDER_SMALL_AUTO);
|
||||||
lReport.Add('');
|
lReport.Add('');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -197,7 +197,7 @@ begin
|
|||||||
for j := 1 to NoVars do InverseMat[i-1,j-1] := Corrs[i-1,j-1];
|
for j := 1 to NoVars do InverseMat[i-1,j-1] := Corrs[i-1,j-1];
|
||||||
title := 'Product-Moment Correlations Matrix';
|
title := 'Product-Moment Correlations Matrix';
|
||||||
MatPrint(Corrs,NoVars,NoVars,title,RowLabels,ColLabels,NCases, lReport);
|
MatPrint(Corrs,NoVars,NoVars,title,RowLabels,ColLabels,NCases, lReport);
|
||||||
lReport.Add('------------------------------------------------------------------');
|
lReport.Add(DIVIDER_SMALL_AUTO);
|
||||||
lReport.Add('');
|
lReport.Add('');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -217,7 +217,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
title := 'Means';
|
title := 'Means';
|
||||||
DynVectorPrint(Means,NoVars,title,ColLabels,NCases, lReport);
|
DynVectorPrint(Means,NoVars,title,ColLabels,NCases, lReport);
|
||||||
lReport.Add('------------------------------------------------------------------');
|
lReport.Add(DIVIDER_SMALL_AUTO);
|
||||||
lReport.Add('');
|
lReport.Add('');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -225,7 +225,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
title := 'Variances';
|
title := 'Variances';
|
||||||
DynVectorPrint(Variances,NoVars,title,ColLabels,NCases, lReport);
|
DynVectorPrint(Variances,NoVars,title,ColLabels,NCases, lReport);
|
||||||
lReport.Add('------------------------------------------------------------------');
|
lReport.Add(DIVIDER_SMALL_AUTO);
|
||||||
lReport.Add('');
|
lReport.Add('');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -233,7 +233,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
title := 'Standard Deviations';
|
title := 'Standard Deviations';
|
||||||
DynVectorPrint(StdDevs,NoVars,title,ColLabels,NCases, lReport);
|
DynVectorPrint(StdDevs,NoVars,title,ColLabels,NCases, lReport);
|
||||||
lReport.Add('------------------------------------------------------------------');
|
lReport.Add(DIVIDER_SMALL_AUTO);
|
||||||
lReport.Add('');
|
lReport.Add('');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -254,7 +254,7 @@ begin
|
|||||||
MessageDlg('Matrix is singular.', mtError, [mbOK], 0);
|
MessageDlg('Matrix is singular.', mtError, [mbOK], 0);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
lReport.Add('Determinant of correlation matrix = %8.4f', [Determinant]);
|
lReport.Add('Determinant of correlation matrix: %.4f', [Determinant]);
|
||||||
lReport.Add('');
|
lReport.Add('');
|
||||||
|
|
||||||
SVDinverse(InverseMat, NoVars);
|
SVDinverse(InverseMat, NoVars);
|
||||||
@ -262,7 +262,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
title := 'Inverse of correlation matrix';
|
title := 'Inverse of correlation matrix';
|
||||||
MatPrint(InverseMat,NoVars,NoVars,title,RowLabels,ColLabels,NCases, lReport);
|
MatPrint(InverseMat,NoVars,NoVars,title,RowLabels,ColLabels,NCases, lReport);
|
||||||
lReport.Add('------------------------------------------------------------------');
|
lReport.Add(DIVIDER_SMALL_AUTO);
|
||||||
lReport.Add('');
|
lReport.Add('');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -287,7 +287,7 @@ begin
|
|||||||
ProdMat[i-1,j-1] := -InverseMat[i-1,j-1] / InverseMat[j-1,j-1];
|
ProdMat[i-1,j-1] := -InverseMat[i-1,j-1] / InverseMat[j-1,j-1];
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
lReport.Add('------------------------------------------------------------------');
|
lReport.Add(DIVIDER_SMALL_AUTO);
|
||||||
lReport.Add('');
|
lReport.Add('');
|
||||||
|
|
||||||
title := 'Betas in Columns';
|
title := 'Betas in Columns';
|
||||||
@ -301,7 +301,7 @@ begin
|
|||||||
valstring := format('%10s', [ColLabels[i-1]]);
|
valstring := format('%10s', [ColLabels[i-1]]);
|
||||||
lReport.Add('%10s%10.3f', [valstring,StdErr]);
|
lReport.Add('%10s%10.3f', [valstring,StdErr]);
|
||||||
end;
|
end;
|
||||||
lReport.Add('------------------------------------------------------------------');
|
lReport.Add(DIVIDER_SMALL_AUTO);
|
||||||
lReport.Add('');
|
lReport.Add('');
|
||||||
|
|
||||||
for i := 1 to NoVars do
|
for i := 1 to NoVars do
|
||||||
@ -321,7 +321,7 @@ begin
|
|||||||
valstring := format('%10s',[ColLabels[i-1]]);
|
valstring := format('%10s',[ColLabels[i-1]]);
|
||||||
lReport.Add('%10s%10.3f', [valstring, x]);
|
lReport.Add('%10s%10.3f', [valstring, x]);
|
||||||
end;
|
end;
|
||||||
lReport.Add('------------------------------------------------------------------');
|
lReport.Add(DIVIDER_SMALL_AUTO);
|
||||||
lReport.Add('');
|
lReport.Add('');
|
||||||
|
|
||||||
// Get partial correlation matrix
|
// Get partial correlation matrix
|
||||||
@ -397,15 +397,11 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
procedure TSimultForm.Reset;
|
procedure TSimultForm.Reset;
|
||||||
var
|
|
||||||
i: integer;
|
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
|
||||||
VarList.Clear;
|
|
||||||
SelList.Clear;
|
SelList.Clear;
|
||||||
for i := 1 to NoVariables do
|
CollectVariableNames(OS3MainFrm.DataGrid, VarList.Items);
|
||||||
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]);
|
|
||||||
|
|
||||||
CPChkBox.Checked := false;
|
CPChkBox.Checked := false;
|
||||||
CovChkBox.Checked := false;
|
CovChkBox.Checked := false;
|
||||||
@ -433,6 +429,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TSimultForm.VarListDblClick(Sender: TObject);
|
procedure TSimultForm.VarListDblClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
index: Integer;
|
index: Integer;
|
||||||
|
@ -2,12 +2,13 @@ inherited StepFwdForm: TStepFwdForm
|
|||||||
Left = 564
|
Left = 564
|
||||||
Height = 487
|
Height = 487
|
||||||
Top = 333
|
Top = 333
|
||||||
Width = 786
|
Width = 801
|
||||||
HelpType = htKeyword
|
HelpType = htKeyword
|
||||||
HelpKeyword = 'html/ForwardStepwise.htm'
|
HelpKeyword = 'html/ForwardStepwise.htm'
|
||||||
Caption = 'Forward Stepwise Multiple Regression'
|
Caption = 'Forward Stepwise Multiple Regression'
|
||||||
ClientHeight = 487
|
ClientHeight = 487
|
||||||
ClientWidth = 786
|
ClientWidth = 801
|
||||||
|
OnCreate = FormCreate
|
||||||
inherited ParamsPanel: TPanel
|
inherited ParamsPanel: TPanel
|
||||||
Height = 471
|
Height = 471
|
||||||
Width = 448
|
Width = 448
|
||||||
@ -31,6 +32,8 @@ inherited StepFwdForm: TStepFwdForm
|
|||||||
inherited HelpBtn: TButton
|
inherited HelpBtn: TButton
|
||||||
Left = 188
|
Left = 188
|
||||||
Top = 446
|
Top = 446
|
||||||
|
HelpType = htKeyword
|
||||||
|
HelpKeyword = 'html/ForwardStepwise.htm'
|
||||||
TabOrder = 10
|
TabOrder = 10
|
||||||
end
|
end
|
||||||
inherited ButtonBevel: TBevel
|
inherited ButtonBevel: TBevel
|
||||||
|
@ -46,6 +46,7 @@ type
|
|||||||
procedure AllBtnClick(Sender: TObject);
|
procedure AllBtnClick(Sender: TObject);
|
||||||
procedure DepInBtnClick(Sender: TObject);
|
procedure DepInBtnClick(Sender: TObject);
|
||||||
procedure DepOutBtnClick(Sender: TObject);
|
procedure DepOutBtnClick(Sender: TObject);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure InBtnClick(Sender: TObject);
|
procedure InBtnClick(Sender: TObject);
|
||||||
procedure SelListDblClick(Sender: TObject);
|
procedure SelListDblClick(Sender: TObject);
|
||||||
procedure SelListSelectionChange(Sender: TObject; {%H-}User: boolean);
|
procedure SelListSelectionChange(Sender: TObject; {%H-}User: boolean);
|
||||||
@ -73,7 +74,7 @@ implementation
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Math,
|
Math,
|
||||||
Utils, MathUnit;
|
Utils, GridProcs, MathUnit;
|
||||||
|
|
||||||
|
|
||||||
{ TStepFwdForm }
|
{ TStepFwdForm }
|
||||||
@ -486,6 +487,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TStepFwdForm.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InProbEdit.Text := FormatFloat('0.00', DEFAULT_ALPHA_LEVEL);
|
||||||
|
OutProbEdit.Text := FormatFloat('0.00', 0.10);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TStepFwdForm.InBtnClick(Sender: TObject);
|
procedure TStepFwdForm.InBtnClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
i: integer;
|
i: integer;
|
||||||
@ -532,14 +540,10 @@ var
|
|||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
|
||||||
VarList.Clear;
|
CollectVariableNames(OS3MainFrm.DataGrid, VarList.Items);
|
||||||
SelList.Clear;
|
SelList.Clear;
|
||||||
for i := 1 to NoVariables do
|
|
||||||
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]);
|
|
||||||
|
|
||||||
DepVarEdit.Text := '';
|
DepVarEdit.Text := '';
|
||||||
InProbEdit.Text := FormatFloat('0.00', DEFAULT_ALPHA_LEVEL);
|
|
||||||
OutProbEdit.Text := FormatFloat('0.00', 0.10);
|
|
||||||
|
|
||||||
CPChkBox.Checked := false;
|
CPChkBox.Checked := false;
|
||||||
CovChkBox.Checked := false;
|
CovChkBox.Checked := false;
|
||||||
|
@ -31,6 +31,8 @@ inherited TwoSLSForm: TTwoSLSForm
|
|||||||
inherited HelpBtn: TButton
|
inherited HelpBtn: TButton
|
||||||
Left = 55
|
Left = 55
|
||||||
Top = 335
|
Top = 335
|
||||||
|
HelpType = htKeyword
|
||||||
|
HelpKeyword = 'html/TwoStageLeastSquaresRegression.htm'
|
||||||
TabOrder = 11
|
TabOrder = 11
|
||||||
end
|
end
|
||||||
inherited ButtonBevel: TBevel
|
inherited ButtonBevel: TBevel
|
||||||
|
@ -57,6 +57,7 @@ type
|
|||||||
procedure AdjustConstraints; override;
|
procedure AdjustConstraints; override;
|
||||||
procedure Compute; override;
|
procedure Compute; override;
|
||||||
procedure UpdateBtnStates; override;
|
procedure UpdateBtnStates; override;
|
||||||
|
function Validate(out AMsg: String; out AControl: TWinControl): boolean; override;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
@ -72,7 +73,7 @@ implementation
|
|||||||
{$R *.lfm}
|
{$R *.lfm}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
StrUtils, Utils;
|
StrUtils, Utils, GridProcs;
|
||||||
|
|
||||||
{ TTwoSLSForm }
|
{ TTwoSLSForm }
|
||||||
|
|
||||||
@ -130,38 +131,8 @@ var
|
|||||||
lReport: TStrings;
|
lReport: TStrings;
|
||||||
errorcode: Boolean = false;
|
errorcode: Boolean = false;
|
||||||
begin
|
begin
|
||||||
if DepVarEdit.Text = '' then
|
PrintDesc := ProxyRegShowChk.Checked;
|
||||||
begin
|
|
||||||
MessageDlg('Dependent variable not selected.', mtError, [mbOK], 0);
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
if ExplanatoryList.Items.Count = 0 then
|
|
||||||
begin
|
|
||||||
MessageDlg('No explanatory variables selected.', mtError, [mbOK], 0);
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
if InstrumentalList.Items.Count = 0 then
|
|
||||||
begin
|
|
||||||
MessageDlg('No instrumental variables selected.', mtError, [mbOK], 0);
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
|
|
||||||
if (ProxyRegShowChk.Checked) then
|
|
||||||
begin
|
|
||||||
PrintDesc := true;
|
|
||||||
// PrintCorrs := true;
|
|
||||||
// PrintInverse := false;
|
|
||||||
// PrintCoefs := true;
|
|
||||||
// SaveCorrs := false;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
PrintDesc := false;
|
|
||||||
// PrintCorrs := false;
|
|
||||||
// PrintInverse := false;
|
|
||||||
// PrintCoefs := false;
|
|
||||||
// SaveCorrs := false;
|
|
||||||
end;
|
|
||||||
SetLength(Means,NoVariables+2);
|
SetLength(Means,NoVariables+2);
|
||||||
SetLength(Variances,NoVariables+2);
|
SetLength(Variances,NoVariables+2);
|
||||||
SetLength(StdDevs,NoVariables+2);
|
SetLength(StdDevs,NoVariables+2);
|
||||||
@ -293,7 +264,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
IndepCols[Noindep] := DepProx;
|
IndepCols[Noindep] := DepProx;
|
||||||
lReport.Add('');
|
lReport.Add('');
|
||||||
lReport.Add('==================================================================');
|
lReport.Add(DIVIDER_AUTO);
|
||||||
lReport.Add('');
|
lReport.Add('');
|
||||||
lReport.Add('Analysis for ' + ProxLabels[i]);
|
lReport.Add('Analysis for ' + ProxLabels[i]);
|
||||||
lReport.Add('-------------' + DupeString('-', Length(ProxLabels[i])));
|
lReport.Add('-------------' + DupeString('-', Length(ProxLabels[i])));
|
||||||
@ -327,7 +298,7 @@ begin
|
|||||||
// OutputFrm.ShowModal();
|
// OutputFrm.ShowModal();
|
||||||
|
|
||||||
lReport.Add('');
|
lReport.Add('');
|
||||||
lReport.Add('==================================================================');
|
lReport.Add(DIVIDER_AUTO);
|
||||||
lReport.Add('');
|
lReport.Add('');
|
||||||
|
|
||||||
// Compute the OLS using the Prox values and ExplanatoryList
|
// Compute the OLS using the Prox values and ExplanatoryList
|
||||||
@ -598,17 +569,13 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
procedure TTwoSLSForm.Reset;
|
procedure TTwoSLSForm.Reset;
|
||||||
var
|
|
||||||
i: integer;
|
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
|
||||||
DepVarEdit.Clear;
|
DepVarEdit.Clear;
|
||||||
InstrumentalList.Clear;
|
InstrumentalList.Clear;
|
||||||
ExplanatoryList.Clear;
|
ExplanatoryList.Clear;
|
||||||
VarList.Clear;
|
CollectVariableNames(OS3MainFrm.DataGrid, VarList.Items);
|
||||||
for i := 1 to NoVariables do
|
|
||||||
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]);
|
|
||||||
ProxyRegShowChk.Checked := false;
|
ProxyRegShowChk.Checked := false;
|
||||||
UpdateBtnStates;
|
UpdateBtnStates;
|
||||||
end;
|
end;
|
||||||
@ -631,6 +598,36 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function TTwoSLSForm.Validate(out AMsg: String;
|
||||||
|
out AControl: TWinControl): boolean;
|
||||||
|
begin
|
||||||
|
Result := false;
|
||||||
|
|
||||||
|
if DepVarEdit.Text = '' then
|
||||||
|
begin
|
||||||
|
AMsg := 'Dependent variable not selected.';
|
||||||
|
AControl := VarList;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if ExplanatoryList.Items.Count = 0 then
|
||||||
|
begin
|
||||||
|
AMsg := 'No explanatory variables selected.';
|
||||||
|
AControl := VarList;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if InstrumentalList.Items.Count = 0 then
|
||||||
|
begin
|
||||||
|
AMsg := 'No instrumental variables selected.';
|
||||||
|
AControl := VarList;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Result := true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TTwoSLSForm.VarListDblClick(Sender: TObject);
|
procedure TTwoSLSForm.VarListDblClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
index: Integer;
|
index: Integer;
|
||||||
|
@ -32,6 +32,8 @@ inherited WLSForm: TWLSForm
|
|||||||
Tag = 158
|
Tag = 158
|
||||||
Left = 20
|
Left = 20
|
||||||
Top = 428
|
Top = 428
|
||||||
|
HelpType = htKeyword
|
||||||
|
HelpKeyword = 'html/WeightedLeast-SquaresRegression.htm'
|
||||||
TabOrder = 11
|
TabOrder = 11
|
||||||
end
|
end
|
||||||
inherited ButtonBevel: TBevel
|
inherited ButtonBevel: TBevel
|
||||||
@ -346,13 +348,13 @@ inherited WLSForm: TWLSForm
|
|||||||
Height = 453
|
Height = 453
|
||||||
Top = 8
|
Top = 8
|
||||||
Width = 552
|
Width = 552
|
||||||
ActivePage = ResidualsRegPage
|
ActivePage = OLSPage
|
||||||
Align = alClient
|
Align = alClient
|
||||||
BorderSpacing.Left = 4
|
BorderSpacing.Left = 4
|
||||||
BorderSpacing.Top = 8
|
BorderSpacing.Top = 8
|
||||||
BorderSpacing.Right = 8
|
BorderSpacing.Right = 8
|
||||||
BorderSpacing.Bottom = 8
|
BorderSpacing.Bottom = 8
|
||||||
TabIndex = 1
|
TabIndex = 0
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
object OLSPage: TTabSheet
|
object OLSPage: TTabSheet
|
||||||
Caption = 'OLS Regression'
|
Caption = 'OLS Regression'
|
||||||
|
@ -923,14 +923,10 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
procedure TWLSForm.Reset;
|
procedure TWLSForm.Reset;
|
||||||
var
|
|
||||||
i: integer;
|
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
|
||||||
VarList.Clear;
|
CollectVariableNames(OS3MainFrm.DataGrid, VarList.Items);
|
||||||
for i := 0 to NoVariables - 1 do
|
|
||||||
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i+1,0]);
|
|
||||||
IndVarList.Clear;
|
IndVarList.Clear;
|
||||||
|
|
||||||
DepVarEdit.Clear;
|
DepVarEdit.Clear;
|
||||||
|
@ -648,6 +648,9 @@ object OS3MainFrm: TOS3MainFrm
|
|||||||
Caption = 'Binary Logistic'
|
Caption = 'Binary Logistic'
|
||||||
OnClick = mnuAnalysisMultReg_BinLogisticClick
|
OnClick = mnuAnalysisMultReg_BinLogisticClick
|
||||||
end
|
end
|
||||||
|
object MenuItem4: TMenuItem
|
||||||
|
Caption = '-'
|
||||||
|
end
|
||||||
object mnuAnalysisMultReg_CoxSurvival: TMenuItem
|
object mnuAnalysisMultReg_CoxSurvival: TMenuItem
|
||||||
Caption = 'Cox Proportional Hazzards Survival Regression'
|
Caption = 'Cox Proportional Hazzards Survival Regression'
|
||||||
OnClick = mnuAnalysisMultReg_CoxSurvivalClick
|
OnClick = mnuAnalysisMultReg_CoxSurvivalClick
|
||||||
|
@ -47,6 +47,7 @@ type
|
|||||||
FilterLabel: TLabel;
|
FilterLabel: TLabel;
|
||||||
MenuItem2: TMenuItem;
|
MenuItem2: TMenuItem;
|
||||||
MenuItem3: TMenuItem;
|
MenuItem3: TMenuItem;
|
||||||
|
MenuItem4: TMenuItem;
|
||||||
NoCasesEdit: TEdit;
|
NoCasesEdit: TEdit;
|
||||||
NoCasesLabel: TLabel;
|
NoCasesLabel: TLabel;
|
||||||
NoVarsEdit: TEdit;
|
NoVarsEdit: TEdit;
|
||||||
|
Reference in New Issue
Block a user