LazStats: Fine-tuning and updating of chm help of MultXvsYUnit.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8024 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
6740602d6c
commit
9a4ebebaa1
Binary file not shown.
Binary file not shown.
@ -297,7 +297,7 @@
|
||||
<Unit23>
|
||||
<Filename Value="forms\analysis\descriptive\multxvsyunit.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="MultXvsYFrm"/>
|
||||
<ComponentName Value="MultXvsYForm"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="MultXvsYUnit"/>
|
||||
|
@ -1,27 +1,38 @@
|
||||
inherited MultXvsYFrm: TMultXvsYFrm
|
||||
inherited MultXvsYForm: TMultXvsYForm
|
||||
Height = 382
|
||||
HelpType = htKeyword
|
||||
HelpKeyword = 'html/MultipleGroupXVersusYPlot.htm'
|
||||
Caption = 'Multiple X Versus Y Plot'
|
||||
ClientHeight = 382
|
||||
inherited ParamsPanel: TPanel
|
||||
Height = 366
|
||||
Width = 344
|
||||
ClientHeight = 366
|
||||
ClientWidth = 344
|
||||
inherited CloseBtn: TButton
|
||||
Left = 289
|
||||
Top = 341
|
||||
TabOrder = 15
|
||||
end
|
||||
inherited ComputeBtn: TButton
|
||||
Left = 205
|
||||
Top = 341
|
||||
TabOrder = 14
|
||||
end
|
||||
inherited ResetBtn: TButton
|
||||
Left = 143
|
||||
Top = 341
|
||||
TabOrder = 13
|
||||
end
|
||||
inherited HelpBtn: TButton
|
||||
Left = 84
|
||||
Top = 341
|
||||
HelpType = htKeyword
|
||||
HelpKeyword = 'html/MultipleGroupXVersusYPlot.htm'
|
||||
TabOrder = 12
|
||||
end
|
||||
inherited ButtonBevel: TBevel
|
||||
Top = 325
|
||||
Width = 344
|
||||
end
|
||||
object Label5: TLabel[5]
|
||||
@ -30,7 +41,7 @@ inherited MultXvsYFrm: TMultXvsYFrm
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 0
|
||||
Height = 15
|
||||
Top = 374
|
||||
Top = 306
|
||||
Width = 46
|
||||
Caption = 'Plot Title'
|
||||
ParentColor = False
|
||||
@ -42,7 +53,7 @@ inherited MultXvsYFrm: TMultXvsYFrm
|
||||
AnchorSideBottom.Control = ButtonBevel
|
||||
Left = 54
|
||||
Height = 23
|
||||
Top = 370
|
||||
Top = 302
|
||||
Width = 290
|
||||
Anchors = [akLeft, akRight, akBottom]
|
||||
BorderSpacing.Left = 8
|
||||
@ -63,9 +74,10 @@ inherited MultXvsYFrm: TMultXvsYFrm
|
||||
AnchorSideTop.Control = Label1
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = XInBtn
|
||||
AnchorSideBottom.Control = OptionsGroup
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 309
|
||||
Height = 277
|
||||
Top = 17
|
||||
Width = 153
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
@ -178,7 +190,7 @@ inherited MultXvsYFrm: TMultXvsYFrm
|
||||
AnchorSideBottom.Control = LabelEdit
|
||||
Left = 159
|
||||
Height = 49
|
||||
Top = 313
|
||||
Top = 245
|
||||
Width = 182
|
||||
Anchors = [akLeft, akBottom]
|
||||
AutoSize = True
|
||||
@ -295,9 +307,11 @@ inherited MultXvsYFrm: TMultXvsYFrm
|
||||
end
|
||||
inherited ParamsSplitter: TSplitter
|
||||
Left = 356
|
||||
Height = 382
|
||||
end
|
||||
inherited PageControl: TPageControl
|
||||
Left = 365
|
||||
Height = 366
|
||||
Width = 343
|
||||
end
|
||||
end
|
||||
|
@ -14,9 +14,9 @@ uses
|
||||
|
||||
type
|
||||
|
||||
{ TMultXvsYFrm }
|
||||
{ TMultXvsYForm }
|
||||
|
||||
TMultXvsYFrm = class(TBasicStatsReportAndChartForm)
|
||||
TMultXvsYForm = class(TBasicStatsReportAndChartForm)
|
||||
XInBtn: TBitBtn;
|
||||
XOutBtn: TBitBtn;
|
||||
YInBtn: TBitBtn;
|
||||
@ -59,7 +59,7 @@ type
|
||||
end;
|
||||
|
||||
var
|
||||
MultXvsYFrm: TMultXvsYFrm;
|
||||
MultXvsYForm: TMultXvsYForm;
|
||||
|
||||
implementation
|
||||
|
||||
@ -67,18 +67,18 @@ implementation
|
||||
|
||||
uses
|
||||
TATypes,
|
||||
Math, Utils, MatrixUnit;
|
||||
Math, Utils, MatrixUnit, GridProcs;
|
||||
|
||||
|
||||
{ TMultXvsYFrm }
|
||||
{ TMultXvsYForm }
|
||||
|
||||
constructor TMultXvsYFrm.Create(AOwner: TComponent);
|
||||
constructor TMultXvsYForm.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
|
||||
procedure TMultXvsYFrm.AdjustConstraints;
|
||||
procedure TMultXvsYForm.AdjustConstraints;
|
||||
begin
|
||||
ParamsPanel.Constraints.MinWidth := Max(
|
||||
4*CloseBtn.Width + 3*CloseBtn.BorderSpacing.Left,
|
||||
@ -89,11 +89,10 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure TMultXvsYFrm.Compute;
|
||||
procedure TMultXvsYForm.Compute;
|
||||
var
|
||||
i, N, xCol, yCol, grpCol, grp, numGrps: integer;
|
||||
grpName: String;
|
||||
//minX, maxX, minY, maxY,
|
||||
X, Y: double;
|
||||
cellstring: string;
|
||||
numInGrp: IntDyneVec = nil;
|
||||
@ -109,17 +108,10 @@ begin
|
||||
SetLength(stdDevs, 2);
|
||||
|
||||
// Get selected variables
|
||||
xCol := 0;
|
||||
yCol := 0;
|
||||
grpCol := 0;
|
||||
for i := 1 to NoVariables do
|
||||
begin
|
||||
cellstring := OS3MainFrm.DataGrid.Cells[i, 0];
|
||||
if (cellstring = XEdit.Text) then xCol := i;
|
||||
if (cellstring = YEdit.Text) then yCol := i;
|
||||
if (cellstring = GroupEdit.Text) then grpCol := i;
|
||||
end;
|
||||
if (xCol = 0) or (yCol = 0) or (grpCol = 0) then
|
||||
xCol := GetVariableIndex(OS3MainFrm.DataGrid, XEdit.Text);
|
||||
yCol := GetVariableIndex(OS3MainFrm.DataGrid, YEdit.Text);
|
||||
grpCol := GetVariableIndex(OS3MainFrm.DataGrid, GroupEdit.Text);
|
||||
if (xCol = -1) or (yCol = -1) or (grpCol = -1) then
|
||||
begin
|
||||
ErrorMsg('No variable selected.');
|
||||
exit;
|
||||
@ -152,7 +144,7 @@ begin
|
||||
N := 0;
|
||||
for i := 1 to NoCases do
|
||||
begin
|
||||
if not GoodRecord(i, Length(selected), selected) then continue;
|
||||
if not GoodRecord(OS3MainFrm.Datagrid, i, selected) then continue;
|
||||
inc(N);
|
||||
|
||||
X := StrToFloat(OS3MainFrm.DataGrid.Cells[XCol, i]);
|
||||
@ -199,7 +191,7 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure TMultXvsYFrm.GroupInBtnClick(Sender: TObject);
|
||||
procedure TMultXvsYForm.GroupInBtnClick(Sender: TObject);
|
||||
var
|
||||
i: integer;
|
||||
begin
|
||||
@ -213,7 +205,7 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure TMultXvsYFrm.GroupOutBtnClick(Sender: TObject);
|
||||
procedure TMultXvsYForm.GroupOutBtnClick(Sender: TObject);
|
||||
begin
|
||||
if GroupEdit.Text <> '' then
|
||||
begin
|
||||
@ -227,7 +219,7 @@ end;
|
||||
// Routine to plot X versus multiple Y values for several groups
|
||||
// Layout of X and Y matrices:
|
||||
// 1st index: group index, 2nd index: point index within group
|
||||
procedure TMultXvsYFrm.PlotXY(const XValues, YValues: DblDyneMat;
|
||||
procedure TMultXvsYForm.PlotXY(const XValues, YValues: DblDyneMat;
|
||||
const Groups: StrDyneVec);
|
||||
var
|
||||
pt: TPlotType;
|
||||
@ -255,25 +247,20 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure TMultXvsYFrm.Reset;
|
||||
var
|
||||
i: integer;
|
||||
procedure TMultXvsYForm.Reset;
|
||||
begin
|
||||
inherited;
|
||||
|
||||
VarList.Clear;
|
||||
for i := 1 to NoVariables do
|
||||
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]);
|
||||
CollectVariableNames(OS3MainFrm.DataGrid, varList.Items);
|
||||
XEdit.Text := '';
|
||||
YEdit.Text := '';
|
||||
GroupEdit.Text := '';
|
||||
LinesChk.Checked := false;
|
||||
|
||||
UpdateBtnStates;
|
||||
end;
|
||||
|
||||
|
||||
procedure TMultXvsYFrm.VarListDblClick(Sender: TObject);
|
||||
procedure TMultXvsYForm.VarListDblClick(Sender: TObject);
|
||||
var
|
||||
index: Integer;
|
||||
begin
|
||||
@ -292,7 +279,7 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure TMultXvsYFrm.UpdateBtnStates;
|
||||
procedure TMultXvsYForm.UpdateBtnStates;
|
||||
var
|
||||
lSelected: Boolean;
|
||||
i: Integer;
|
||||
@ -316,13 +303,13 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure TMultXvsYFrm.VarListSelectionChange(Sender: TObject; User: boolean);
|
||||
procedure TMultXvsYForm.VarListSelectionChange(Sender: TObject; User: boolean);
|
||||
begin
|
||||
UpdateBtnStates;
|
||||
end;
|
||||
|
||||
|
||||
procedure TMultXVsYFrm.WriteToReport(const AMeans, AStdDevs: DblDyneVec);
|
||||
procedure TMultXvsYForm.WriteToReport(const AMeans, AStdDevs: DblDyneVec);
|
||||
var
|
||||
lReport: TStrings;
|
||||
begin
|
||||
@ -348,7 +335,7 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure TMultXvsYFrm.XInBtnClick(Sender: TObject);
|
||||
procedure TMultXvsYForm.XInBtnClick(Sender: TObject);
|
||||
var
|
||||
i: integer;
|
||||
begin
|
||||
@ -362,7 +349,7 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure TMultXvsYFrm.XOutBtnClick(Sender: TObject);
|
||||
procedure TMultXvsYForm.XOutBtnClick(Sender: TObject);
|
||||
begin
|
||||
if XEdit.Text <> '' then
|
||||
begin
|
||||
@ -373,7 +360,7 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure TMultXvsYFrm.YInBtnClick(Sender: TObject);
|
||||
procedure TMultXvsYForm.YInBtnClick(Sender: TObject);
|
||||
var
|
||||
i: integer;
|
||||
begin
|
||||
@ -387,7 +374,7 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure TMultXvsYFrm.YOutBtnClick(Sender: TObject);
|
||||
procedure TMultXvsYForm.YOutBtnClick(Sender: TObject);
|
||||
begin
|
||||
if YEdit.Text <> '' then
|
||||
begin
|
||||
|
@ -1998,9 +1998,9 @@ end;
|
||||
//Menu "Analysis" > "Descriptive" > "Multiple Group X vs Y Plot"
|
||||
procedure TOS3MainFrm.mnuAnalysisDescr_MultXvsYClick(Sender: TObject);
|
||||
begin
|
||||
if MultXvsYFrm = nil then
|
||||
Application.CreateForm(TMultXvsYFrm, MultXvsYFrm);
|
||||
MultXvsYFrm.Show;
|
||||
if MultXvsYForm = nil then
|
||||
Application.CreateForm(TMultXvsYForm, MultXvsYForm);
|
||||
MultXvsYForm.Show;
|
||||
end;
|
||||
|
||||
// Menu "Analysis" > "Descriptive" > "Normality Tests"
|
||||
|
@ -158,7 +158,8 @@ end;
|
||||
Probability = 0 ... 1 --> Result = -INF ... +INF
|
||||
|
||||
Algorithm by Peter John Acklam.
|
||||
http://home.online.no/~pjacklam/notes/invnorm/index.html }
|
||||
http://home.online.no/~pjacklam/notes/invnorm/index.html --- no longer valid!
|
||||
https://stackedboxes.org/2017/05/01/acklams-normal-quantile-function/ }
|
||||
function InverseNormalDist(Probability: Double): Double;
|
||||
const
|
||||
A: array[1..6] of Double = (
|
||||
|
Loading…
Reference in New Issue
Block a user