Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Key Concepts

This page introduces the core concepts you need to understand ProcessBehavior effectively.

The Three-Step Workflow

ProcessBehavior follows a deliberate three-step workflow:

# 1. Wrap your data
pb = ProcessBehavior(df)

# 2. Formulate your study (DS detection happens here)
study = pb.formulate(response=..., factors=..., time=...)

# 3. Analyze and visualize
result = study.execute()
result.plot()

This separation ensures you understand your data structure before analyzing it.

Design States (DS)

The Design State describes the structure of your data. ProcessBehavior automatically detects which of six states applies:

Complete/Semi-Complete (no empty cells):

DSNameCell SizesRecommended Chart
1Full ReplicationAll N_kt >= 2Xbar
2No ReplicationAll N_kt = 1X
3Partial ReplicationMix of N_kt = 1 and N_kt >= 2X

Incomplete (has empty cells):

DSNameCell SizesRecommended Chart
4Incomplete, No SingletonsEmpty cells + all observed N_kt >= 2X
5Incomplete, No ReplicationEmpty cells + all observed N_kt = 1X
6Incomplete, With SingletonsEmpty cells + mixed N_ktX

See DS Definitions for the formal classification table per Dr. Thomas A. Bishop’s VAS methodology.

Why DS Matters

The DS determines:

study = pb.formulate(response='weight', factors=['lane'], time='batch')
print(f"DS: {study.analytical_design_state.sds}")  # e.g., 1
print(f"Reason: {study.ads_reason}")                # e.g., "full_replication"
print(f"Valid: {study.valid_charts}")                # e.g., ['Histogram', 'Xbar', 'S', 'X', 'mR']

Design State Traceability

ProcessBehavior tracks three Design States as data flows from intent through observation to analysis, providing transparent lineage at every step.

The Three States

StatePropertyComputed FromPurpose
Plan Design State (PDS)study.plan_design_stateSampling plan parametersWhat you intended to collect
Observed Design State (ODS)study.observed_design_stateRaw data (before NA filtering)What was actually collected
Analytical Design State (ADS)study.analytical_design_stateTidy data (after data cleansing)What is fit for analysis

The ADS drives all analysis decisions — valid charts, residual availability, R2 calculation method, and interaction analysis. The ODS and PDS provide diagnostic lineage so you can trace exactly how your data structure changed through processing.

Why Three States?

Raw data often contains garbage values, missing cells, and structural irregularities. The ODS captures this reality — including incomplete designs (DS 4-6) where some factor-time cells are entirely empty. After data cleansing removes invalid observations, the empty cells disappear and the remaining structure may be simpler:

This separation means the system correctly identifies incomplete data collection (ODS) while still performing the most powerful analysis the clean data supports (ADS).

Viewing Design State Lineage

Use study.design() to see the full lineage:

report = study.design()
print(report)

# Design Report (2 factors)
#   Design lineage:
#     Planned Design State:    DS 1 (Full Replication)
#     Observed Design State:   DS 6 (Incomplete, With Singletons) — 3 empty cells
#     Analytical Design State: DS 1 (Full Replication)
#   ...

When ODS and ADS differ, the Study display shows both:

print(study)
# Study(response='weight', factors=[lane], time='pull', ods=6, ads=1)
#   Valid: Histogram, Xbar, S, X, mR | Recommended: Xbar

Key Properties

# Plan Design State (None if no plan was provided)
study.plan_design_state       # SDSResult or None

# Observed Design State (always available)
study.observed_design_state   # SDSResult — diagnostic/lineage

# Analytical Design State (drives analysis)
study.analytical_design_state # SDSResult — the authoritative state
study.ads_reason              # e.g., "full_replication" (machine-readable)
study.ads_description         # e.g., "Full replication (all cells n>=2)"

Bishop’s Variance Analysis System (VAS)

For replicated designs (DS 1-3), ProcessBehavior computes five residual decompositions:

ResidualFormulaQuestions Answered
R1Y - ȲTotal deviation from grand mean
R2Y - ȲktWithin-cell variation (unexplained)
R3Y - Ȳk - Ȳt + ȲFactor-time interaction
R4t - Ȳ + R2Time effects + unexplained
R5k - Ȳ + R2Factor effects + unexplained

Interpreting VAS Residuals

# Access residuals after formulation
print(study.dataset[['R1', 'R2', 'R3', 'R4', 'R5']].head())

# Chart residuals using the value parameter
result = study.execute(chart='X', by=['lane'], value='R4')
result.plot()

Chart Types

Standard Charts

ChartUse CaseRequirements
XbarCompare subgroup meansn >= 2 per subgroup
SMonitor subgroup variationn >= 2 per subgroup
XIndividual measurements over timeAny structure
mRMoving range of individualsAny structure

Residual Charts

Use the value parameter to chart residuals instead of the response variable:

# Chart R5 residuals (factor effects) on an Xbar chart
result = study.execute(chart='Xbar', value='R5')

# Chart R4 residuals (time effects) on a stratified X chart
result = study.execute(chart='X', by=['lane'], value='R4')
ResidualChart TypePurpose
R2S or XWithin-group variation stability
R3XDetect factor-time interactions
R4XDetect time effects
R5Xbar or XDetect factor effects

The by Parameter

The by parameter controls how data is grouped or stratified:

# Xbar chart aggregated by all factors (default)
result = study.execute(chart='Xbar')

# Xbar chart aggregated by single factor
result = study.execute(chart='Xbar', by=['factor 1'])

# Xbar chart collapsed to grand mean
result = study.execute(chart='Xbar', by=[])

# X chart stratified by factor (separate chart per level)
result = study.execute(chart='X', by=['lane'])

Key concept: The by parameter creates views over the same underlying data. Residuals are computed once during formulation and never change regardless of how you view them.

Western Electric Rules

Signal detection uses the Western Electric (WECO) rules:

RuleNameDescription
1Beyond LimitsPoint outside 3-sigma limits
2Zone A2 of 3 consecutive in Zone A (2-3 sigma)
3Zone B4 of 5 consecutive in Zone B or beyond
4Run8+ consecutive same side of centerline
5Trend6+ consecutive increasing or decreasing
6Oscillation14+ consecutive alternating up/down
7Hugging Center15+ consecutive in Zone C (within 1 sigma)
8Avoiding Center8+ consecutive avoiding Zone C

Rule Applicability

# Standard rules (1-4)
signals = result.detect_signals(rules='standard')

# Extended rules (1-8)
signals = result.detect_signals(rules='extended')

Terminology Mapping

ProcessBehavior uses Wheeler’s terminology consistently:

Wheeler TermCommon TermProcessBehavior
Response VariableY, measurementresponse
Rational SubgroupFactor, groupfactors
Time SequencePeriod, batchtime
Design State-observed_design_state / analytical_design_state
Process Behavior ChartControl ChartChart

Philosophy

ProcessBehavior follows Wheeler’s philosophy:

  1. Charts are for understanding, not control - The goal is insight into variation, not just limit checking.

  2. Let the data speak - Automatic DS detection ensures appropriate analysis.

  3. Separate formulation from analysis - Understanding your data structure comes first.

  4. DataFrame-backed results - Access chart data, residuals, and effects as standard pandas DataFrames.

Next Steps