What you will find in this guide
Why statistical visualization matters
The case for combining stats and figures
Choosing the right test
Decision guide for common experimental designs
Publication-quality figures
Journal formatting, significance brackets, error bars
Multivariate and classification
PCA and ROC curve analysis
Technique reference
5 statistical techniques with use-case descriptions
Common mistakes
What trips up most researchers in statistical analysis
Why this guide uses Python - and why you do not have to write it
Python statistical analysis is rigorous and reproducible. PLOTIVY removes the implementation barrier.
scipy.stats, statsmodels, and matplotlib together run the test and produce its figure in a single script - results that are:
- Reproducible: re-run after a review with a different correction or normality check by changing one line
- Transparent: every assumption check, multiple comparison correction, and effect size calculation is documented in the script
- Consistent: significance brackets, p-value formatting, and axis layout match across every figure in the paper
- Publication-ready: white background, precise DPI, correct error bar definitions are set once and applied everywhere
The obstacle is the code. PLOTIVY generates and executes the Python code for you in the browser - describe the analysis, and the code is generated and run instantly. Your results remain a real Python script you can inspect, copy, and run independently.
This guide explains the statistical concepts so you understand what is being computed and can defend every result.
Try it on your dataWhy Statistical Visualization Matters in Research
Statistical analysis and data visualization are inseparable in modern scientific research. A p-value without a figure is difficult to interpret. A figure without statistical annotation is incomplete. Reviewers, collaborators, and readers expect to see both: the visual pattern and the quantitative evidence, presented together.
Python has become the standard tool for this combined workflow. scipy.stats provides every common hypothesis test. matplotlib and plotly produce figures with full control over layout, annotation, and formatting. The combination means you can run the test, annotate the result, and export a journal-ready figure in a single script with complete reproducibility.
Key insight: This guide does not replace a statistics textbook. It bridges the gap between understanding a test and producing the figure that communicates it - with copy-ready Python code for each technique.
Choosing the Right Statistical Test
The choice of test depends on your experimental design, the number of groups, and the nature of your data. Use this quick reference to find the right starting point.
| Scenario | Recommended Test | Type |
|---|---|---|
| 2 groups, continuous data, normal distribution | T-Test | Parametric |
| 3 or more groups, continuous data | ANOVA | Parametric |
| 2 groups, non-normal or ordinal data | Mann-Whitney U | Non-parametric |
| 3 or more groups, non-normal data | Kruskal-Wallis | Non-parametric |
| Continuous predictor and outcome | Linear Regression | Regression |
| Evaluate classifier performance | ROC Curve | Classification |
| High-dimensional, explore patterns | PCA | Multivariate |
When normality assumptions are not met - common with small samples (n < 30), ordinal data, or heavily skewed distributions - use the non-parametric alternatives. The technique pages cover how to check assumptions with Shapiro-Wilk tests and Q-Q plots.
Publication-Quality Statistical Figures
Journals enforce specific formatting requirements that standard plotting defaults do not satisfy. The technique pages in this section produce figures that address these requirements directly.
What each figure type includes
- T-test and ANOVA: significance brackets with automatic p-value annotation (ns, *, **, ***)
- ROC curves: AUC with confidence intervals and the diagonal reference line
- PCA plots: explained variance percentages on axes, color-coded by experimental condition
- Regression: confidence and prediction intervals, R-squared, residual diagnostic plots
Every figure uses a clean, publication-appropriate style: white background, black axes, legible sans-serif fonts, and color palettes that remain distinguishable in grayscale. DPI, figure dimensions, and font properties can be adjusted in one place before exporting.
Beyond Individual Tests: Multivariate and Classification Analysis
Not all scientific questions reduce to pairwise group comparisons. High-dimensional datasets - omics data, multi-parameter sensor arrays, clinical studies with dozens of variables - require multivariate methods.
PCA Visualization
Reveals dominant patterns of variation in your data, identifies clusters and outliers, and provides a low-dimensional representation for visualization.
Use for: omics data, multi-parameter arrays, exploratory analysis
ROC Curve
Quantifies classification performance across all possible thresholds. The AUC provides a single summary statistic. Compare multiple classifiers in one figure.
Use for: biomarker evaluation, diagnostic tests, classification models
A typical analysis might begin with PCA to explore the data structure, followed by t-tests or ANOVA on specific features of interest, and conclude with ROC analysis if the goal is diagnostic evaluation. The technique pages are designed to be used both independently and as part of this larger workflow.
Statistical Techniques
T-Test Visualization
Two-group comparison (treatment vs control)
Type: Parametric
ANOVA Visualization
Three or more group comparison with post-hoc tests
Type: Parametric
ROC Curve
Diagnostic test evaluation with sensitivity and specificity
Type: Classification
PCA Visualization
Reduce dimensionality, identify patterns and outliers
Type: Multivariate
Linear Regression
Predict a continuous outcome from one or more variables
Type: Regression
Common Mistakes to Avoid
- Multiple comparisons without correction: running 10 t-tests at p<0.05 gives roughly a 40% chance of at least one false positive. Use Bonferroni or Tukey correction.
- Confusing SD and SEM: SEM is smaller and shrinks with sample size. Using SEM to suggest precision does not reflect variability in individual measurements.
- Reporting p-values without effect sizes. A p-value tells you whether an effect is real; effect size tells you whether it matters.
- Applying parametric tests to clearly non-normal data with small samples (n<10). Check with Shapiro-Wilk before defaulting to a t-test.
- Showing only summary statistics (mean and error bar) without raw data. Reviewers increasingly expect individual data points to be visible.
- Treating p=0.05 and p=0.049 as categorically different. Report exact p-values rather than just significant/not significant.
Run Your Statistical Analysis Now
Upload your dataset and generate publication-ready statistical figures with AI assistance. From t-tests to PCA - no installation required.
Start Analyzing