Latin Square Design

A Latin square design where each treatment appears exactly once in each row and once in each column. Supports multiple squares (replicates) when rows and columns are multiples of the treatment count.

Design Reference — what this design is, parameters explained, output guide

Latin Square Design

Treatments are arranged so that each treatment appears exactly once in each row and once in each column within each square. This controls for two sources of variability simultaneously.

Use when: There are two known, orthogonal sources of variability (e.g. both row position and column position in a field, or time and operator in a lab experiment). The number of rows and columns must each be a multiple of the number of treatments.


Parameters

Parameter Type Default Min Max Description
experiment_name text "" — — Name of the experiment
treatment_factor text "Variety" — — Label for the treatment factor
treatment_count integer 3 2 100 Number of treatments
row_factor text "Row" — — Label for the row factor
row_count integer 3 2 — Number of rows — must be a multiple of treatment_count
column_factor text "Column" — — Label for the column factor
column_count integer 3 2 — Number of columns — must be a multiple of treatment_count
replicate_factor text "Square" — — Label for the replicate (square) factor
treatment_names list None — — Optional custom treatment names
seed integer 0 — — Random seed

Constraints

  • row_count must be an exact multiple of treatment_count
  • column_count must be an exact multiple of treatment_count
  • Total units = row_count × column_count must not exceed 5,000
  • Number of squares = (row_count / treatment_count) × (column_count / treatment_count)

Output

List View

Column Description
Unit Sequential unit number
replicate_factor (e.g. Square) Which square/replicate this unit belongs to
column_factor Column position
row_factor Row position
treatment_factor Treatment at this position

Layout View

One grid per square: - Rows = row positions - Columns = column positions - Cell contents = treatment at that position

Total units: row_count × column_count


What makes it a Latin Square?

In a standard t × t Latin square: - Each of the t treatments appears exactly once in each row - Each of the t treatments appears exactly once in each column

This means both row effects and column effects are balanced — neither will confound the treatment comparisons.


Multiple Squares

If row_count = 2 × treatment_count and column_count = treatment_count, you get two squares (replicates). The design is tiled with independent Latin squares.


Algorithm

  1. Start with a cyclic Latin square: row i has treatments shifted by i positions
  2. Randomly permute the treatment-to-symbol mapping
  3. Randomly permute row order within each square
  4. Randomly permute column order within each square
  5. Repeat for each square replicate
📄 Static Preview — This is a read-only snapshot of the EDGAR interface hosted on GitHub Pages. Design generation and downloads are not available here. Run the app locally to generate and download experimental designs.
Enter comma-separated names, or leave blank for defaults.
Use 0 for a random seed, or set a specific value for reproducibility.