Choosing Analysis

Choosing the correct analysis before touching any API saves time and prevents statistically invalid results. This page gives you a decision guide and a chart-selection matrix organized around your data type and measurement structure.

Decision guide

Answer the questions below in order to identify the correct chart family for your data.

Are your measurements continuous (numeric) or attribute (pass/fail or count)?

  • Continuous. Go to Variables chart selection below.

  • Pass/fail or proportion defective. Go to Attribute chart selection — defectives below.

  • Defect or nonconformity counts. Go to Attribute chart selection — defects below.

  • Need to detect small sustained shifts? Go to Time-weighted chart selection below.

Variables chart selection

Variables charts apply to continuous numeric measurements.

  • One observation per time point (individuals data). Use Individuals–Moving Range (I‑MR).

  • Rational subgroups of 2–8 observations. Use XBar–R. For subgroup sizes larger than 8, consider XBar–S.

  • Subgroup sizes larger than 8, or variable subgroup sizes. Use XBar–S.

XBar–R vs XBar–S: how to choose. The range (R) chart estimates within-subgroup variation efficiently for small, equal-sized subgroups. The standard-deviation (S) chart is more efficient and numerically stable for larger subgroups. The library enforces these constraints and will reject incompatible configurations. See variables charts for the exact subgroup-size thresholds.

  Caution

Wrong chart, wrong conclusion. Applying a subgrouped chart to individuals data, or treating unrelated observations as a rational subgroup, produces control limits that do not reflect the true process variation. The library cannot detect this category of error.

Attribute chart selection — defectives

Defective charts apply when each unit either passes or fails inspection. The measurement is binary.

  • Fixed sample size per subgroup. Use the NP chart (count of defectives).

  • Varying sample size per subgroup. Use the P chart (fraction defective). Control limits will be pointwise and will vary with sample size.

Attribute chart selection — defects

Defect charts apply when you are counting the number of nonconformities (defects) per unit or opportunity. A single unit can have multiple defects.

  • Fixed inspection area or opportunity per subgroup. Use the C chart (count of defects).

  • Varying inspection area or opportunity per subgroup. Use the U chart (defects per unit). Control limits will be pointwise and will vary with opportunity.

  Caution

Defects and defectives are different. A defect is a nonconformity within a unit. A defective is a unit that failed inspection. Using a P/NP chart for defect counts, or a C/U chart for defective fractions, produces incorrect results.

Time-weighted chart selection

Time-weighted charts (EWMA and CUSUM) are designed to detect small, sustained process shifts that Shewhart charts may miss. Use them when:

  • You need to detect shifts of less than 1.5σ.

  • You have prior knowledge of the shift size you need to detect (required for optimal CUSUM parameterization).

See time-weighted charts for EWMA and CUSUM configuration guidance.

  Important

Standard Nelson and Western Electric rules were designed for Shewhart charts and are not appropriate for EWMA or CUSUM statistics. The library does not prevent applying rules to these charts, but the statistical interpretation is incorrect. See common pitfalls and misuse patterns.

Chart-selection matrix

Data type

Structure

Chart

Primary API

Continuous

One observation per time point

I‑MR

IndividualsMovingRangeChartSet

Continuous

Equal subgroups, size 2–8

XBar–R

XBarRChartSet

Continuous

Equal subgroups, size >8, or variable size

XBar–S

XBarSChartSet

Binary (pass/fail)

Fixed sample size

NP

NpChart

Binary (pass/fail)

Varying sample size

P

PChart

Defect count

Fixed opportunity

C

CChart

Defect count

Varying opportunity

U

UChart

Continuous (small shifts)

Individuals or subgrouped

EWMA

EwmaChart

Continuous (small shifts)

Individuals or subgrouped

CUSUM

CusumChart

Capability is a downstream step

Capability analysis is not a chart-selection consideration. It is a downstream analysis that runs after the process has been shown to be in statistical control. Do not choose a chart based on whether you want capability results; choose based on your measurement type and data structure.

  Important

Capability comes after stability. Always confirm that the process is stable before running capability analysis. Capability computed on an unstable process does not describe a meaningful process state.

See Also