LabKit MATLAB Workbench

guide

T-Test Wizard Design

Development index | App manual | App development | Simple scientific CSV exchange

Product Boundary

T-Test Wizard answers:

The App owns visible group selection, order, test settings, result rows, plot meaning, export schemas, and failure wording. It does not choose the scientifically correct test, infer independence or pairing, apply automatic multiple-comparison correction, or replace ANOVA and repeated-measures models.

FieldValue
Display nameT-Test Wizard
Commandlabkit_TTestWizard_app
App IDttest_wizard
FamilyStatistics
Version1.0.0

No new +labkit facade is involved. The multi-group policy stays App-local.

Workflow

Select or enter groups
  -> order groups with reference first
  -> choose one test specification
  -> run group 2..N versus group 1
  -> review result family
  -> draw bar or box comparison plot
  -> export group and result CSVs

The left controls are Data, Test & Plot, Export, and Log. The right workspace has native Data and Plot pages. Data stacks the opened source table and editable analysis table at equal height; Plot gives the figure the full workspace. A compact freshness field stays beside the plot controls. Result rows stay beside the test controls, removing a result-only navigation step.

Data Boundary

The source grid accepts readable CSV, TSV, XLSX, and XLS tables. Selection is schema-free: finite numeric cells and numeric text are copied in visible spreadsheet order; blanks and labels are skipped with counts; nonfinite numeric cells block the selected range.

Each capture appends one durable group:

group.label
group.values
group.sourceDisplayName
group.sheet
group.cellAddresses

Only label and values participate in calculation identity. Source metadata supports traceability and remains App-owned. A source can be replaced without discarding captured groups.

The ordered group editor has Group and Value columns with one observation per row. Repeated labels form one group, and first label appearance defines group order. The first group is the reference. Blank rows support manual entry. The capture dropdown contains (new group) plus current labels, so a source selection can create a group or append to an existing one without an unexplained count column.

For new groups, the App scans upward from the selected numeric cells and combines at most two nonnumeric header levels. Looking left on the same header row supports merged-style spreadsheet headings. Dates, numeric summaries, and row numbers are excluded. The result is only an editable suggestion, not a calculation identity inferred from the source.

The editor supports batch group changes and deletion of selected observation rows. Deleting the final observation removes the empty group; clearing all data remains a distinct action. Table selection is delivered after the completed selection changes so pointer dragging does not trigger repeated presentation commits.

Statistical Contract

runTTest remains the two-vector primitive. runGroupTTests calls it once for each later group:

for k = 2:numel(groups)
    results(k - 1) = runTTest( ...
        groups(1).values, groups(k).values, optionsForTheseLabels);
end

Common rules:

The completed result family stores copies of the reference vector and each comparison vector. Plot callbacks consume those copies and cannot recalculate the tests.

Result And Plot Model

Each result row includes the method, alternative, alpha, labels, sample counts, means, SDs, reference-minus-comparison estimate and interval, standard error, t statistic, degrees of freedom, exact p-value, status, and message.

Significance shorthand is presentation metadata:

p < 0.0001 -> ****
p < 0.001  -> ***
p < 0.01   -> **
p < alpha  -> *
otherwise  -> NS

The plot contract follows the supplied laboratory reference figure:

The first four colors are:

#9DD39C  #F5C38A  #A9D8E8  #FFF89A

They cycle deterministically for additional groups. Plot limits reserve space for every successful bracket. Failed comparisons remain visible as group bars but do not receive a misleading significance annotation.

Export Contract

The data CSV has Row followed by one uniquely named column per group. Shorter groups are padded with blank cells.

The result CSV has one row per later group and columns for:

method, alternative, alpha, reference label, comparison label,
sample counts, means and SDs, difference and interval,
SE, t, df, p, shorthand, status, message

CSV remains the portable boundary. The project MAT file is for recovery, not the only recoverable copy.

Persistence And Migration

Project schema version 2 replaces:

inputs.vectorA
inputs.vectorB

with:

inputs.groups

Migration from version 1 preserves vector A as group 1 and vector B as group 2, including labels, values, and source metadata. A not-run scalar result becomes an empty result family; an existing completed A/B result remains the one-row family for those migrated groups.

Validation

Unit evidence covers:

Hidden GUI evidence covers:

Manual validation remains required for:

Private laboratory files may be used only as local evidence. No real paths, filenames, identifiers, timestamps, or recognizable values enter tracked fixtures or documentation.