Command-line interface¶
Installing the package provides an industrialstats command for generating
designs and running selected analyses without writing a script.
Every subcommand accepts -o/--output to write CSV instead of printing to
standard output.
Factor specification¶
The factorial, fractional and screening subcommands take repeated
-f/--factor arguments in the form NAME=level1,level2. The crd and rcbd
subcommands instead take repeated -t/--treatment arguments, one per treatment
level, because they describe a single treatment factor:
Generating designs¶
Full factorial¶
industrialstats factorial \
-f "Temperature=180,220" \
-f "Pressure=10,20" \
--replicates 2 \
--center-points 3 \
-o design.csv
Fractional factorial¶
Specify either a --fraction or explicit --generator strings:
Completely randomized design¶
Randomized complete block design¶
Screening¶
--design pb builds a Plackett-Burman design; --design dsd builds a
definitive screening design.
Warning
The dsd construction is experimental and scheduled for statistical
correction. Prefer pb for production screening.
Analysis¶
ANOVA¶
industrialstats anova \
--data results.csv \
--response Yield \
--formula "Yield ~ Temperature * Pressure" \
--typ 2
--typ selects the sum-of-squares type (1, 2, or 3). Type II is the usual
choice for balanced designs without significant interactions; type III is used
when interactions are present.
Power analysis¶
Supply exactly two of --effect-size, --power, and --sample-size; the
command solves for the third.
For a one-way ANOVA:
Stepwise model fitting¶
printf 'y,A,B\n1,0,0\n2,0,1\n3,1,0\n4,1,1\n' > model.csv
industrialstats model \
--data model.csv \
--response y \
--entry-threshold 0.01 \
--removal-threshold 0.2
Stepwise selection inflates significance
p-values from a stepwise search are optimistic because the model was chosen using the same data. Treat the selected terms as a hypothesis to confirm, not as a validated model.
Reproducibility¶
The crd, rcbd and screening subcommands accept --seed. Record it with
your results: it is what allows the exact run order to be reconstructed later.
factorial and fractional randomize without a seed
FactorialDesign randomizes by default, but the factorial and
fractional subcommands expose no --seed flag, so their run order cannot
currently be reproduced from the command line. Save the generated CSV with
-o, or use the Python API, which accepts seed.
Errors¶
File reads and writes raise structured DataExcept errors that name the offending path, and the command exits with a non-zero status.