How you select the batches for your study determines whether batch is a fixed factor or a random factor.

For the examples that follow, suppose that you want to estimate the shelf life of a pill that you produce. You produce the pill on multiple production lines. Each production line is stable and produces consistent output.

If you want to estimate the shelf life of pills that are produced on specific production lines, and you select your test batches from only those lines, then batch is a fixed factor. The following are examples of fixed batch factors:

- To estimate the shelf life of pills that are produced on every production line, you test one batch from each line.
- To estimate the shelf life of pills that are produced on 3 specific production lines, you test one batch from each of the 3 lines.

If you want to estimate the shelf life of pills that are produced on all of your production lines, and you select your test batches from a subset of lines that you select randomly, then batch is a random factor.

For example, suppose that you have a total of 30 production lines. You want to estimate the shelf life of pills that are produced on all 30 lines, but you cannot test all of the lines. Instead, you randomly select a subset of 8 production lines and test one batch from each. In this case, batch is a random factor. The analysis uses the data collected from the 8 randomly selected lines to calculate a single shelf life estimate that applies to pills that are produced on any of the 30 production lines. The more lines you test, the more precise the estimate will be.