All 12 questions UPSC has asked on fixed, random and mixed effects models in the Statistics Optional (Paper I, Sampling Theory and Design of Experiments) from 2000 to 2026, solved step by step – latest first.
Try them yourself first: the same questions, without solutions, are on our Sampling Theory and Design of Experiments topic-wise PYQs page.
How we check these solutions
These are our own solutions, prepared with AI help. UPSC does not publish official answers. Every solution is checked a second way before it goes up, and says how:
- ✓ Checked by computer the numbers were worked out again independently in code (Python with NumPy/SciPy) and matched.
- ✓ Proof checked step by step for “prove that” and “examine whether” questions, every step was checked against the definitions and the standard theorems.
- ✓ Derivation checked step by step for derivations and approximations, every step was checked, and the result was also tested numerically.
- ✓ Answer checked step by step for descriptive questions, every point was checked against the standard theory.
Spotted a mistake or a neater method? Tell us in the comments below or through Report an error.
Jump to a question (year · question number):
2026 · 7b 2023 · 8c 2019 · 6b 2017 · 5c 2011 · 5a 2009 · 8b 2007 · 5c 2005 · 8c 2004 · 8b 2001 · 6iv 2001 · 8i 2000 · 8a
The following data come from a two-factor random effect model:
| Factor A \ Factor B | |||
| 6, 8 | 10, 12 | 14, 16 | |
| 12, 14 | 16, 18 | 20, 22 |
(i) Given that the experimentor suspects interaction, write the linear model stating all the assumptions for the above data. (ii) Clearly stating the hypothesis, carry out the tests for the main effects and interactions giving the complete ANOVA table for the above data.
Solution
(i) Model. Two random factors with levels of A, levels of B and observations per cell: Assumptions.
- is a fixed general mean.
- , , and .
- All these random effects are mutually independent.
- The observed levels of A and B are random samples from larger populations of levels, and the conclusions are about those populations.
(ii) Hypotheses. , and , each against the alternative that the variance is positive.
Means.
| A mean | ||||
|---|---|---|---|---|
| 7 | 11 | 15 | 11 | |
| 13 | 17 | 21 | 17 | |
| B mean | 10 | 14 | 18 | 14 |
Sums of squares.
- .
- .
- . Every cell mean is exactly additive (for example ).
- : the two observations in each cell differ by 2, so each cell contributes , and .
- Total: .
ANOVA table (random effects).
| Source | df | SS | MS | E(MS) | F |
|---|---|---|---|---|---|
| A | 1 | 108 | 108 | MSA/MSAB | |
| B | 2 | 128 | 64 | MSB/MSAB | |
| AB | 2 | 0 | 0 | MSAB/MSE | |
| Error | 6 | 12 | 2 | ||
| Total | 11 | 248 |
Tests.
- Interaction: . We do not reject : there is no evidence of interaction. (The estimate is negative and is taken as 0.)
- Main effects. In a random model, A and B are tested against MSAB. Here MSAB , so these ratios are infinite and cannot be used.
Note on the question. The data are exactly additive, which makes the interaction mean square zero. This is unusual for real data. Since the interaction is clearly not significant, the standard practice is to pool it with the error: pooled SS on df, so the pooled MS is .
- : reject , so .
- : reject , so .
Both factors contribute significant variability. The variance components are estimated as , and (or 1.5 after pooling).
✓ Checked by computer We checked in Python: SSA = 108, SSB = 128, SSAB = 0, SSE = 12 and total SS = 248; the interaction is exactly zero, so the F ratios for A and B against MSAB cannot be formed and we use the pooled error.
Differentiate among fixed, random and mixed effect models with examples. How are the three basic principles of design fulfilled in randomised block design? Explain.
Solution
Fixed, random and mixed effects models. Consider (or a two-factor version).
| Fixed effects (Model I) | Random effects (Model II) | Mixed effects (Model III) | |
|---|---|---|---|
| Levels | All levels of interest are included and chosen deliberately | Levels are a random sample from a large population of levels | Some factors fixed, others random |
| Effects | Unknown constants, | Random variables, | Fixed ; random |
| Hypothesis | for fixed; for random | ||
| What we estimate | Treatment effects and contrasts | Variance components | Both |
| Inference applies to | Only the levels used | The whole population of levels | Fixed levels; population of random levels |
Examples.
- Fixed: comparing four specified fertiliser doses; the conclusion is about these four doses.
- Random: five looms chosen at random from a mill’s 200 looms, to see whether looms vary in output; the conclusion is about all looms.
- Mixed: three specified machines (fixed) operated by four operators chosen at random (random).
In two-way models with interaction, the test for a fixed factor in a mixed model uses MS(interaction) as the denominator, while the test for a random factor uses MS(error).
Basic principles in a randomised block design.
- Replication: each treatment appears once in each of blocks, so it is replicated times. This gives an estimate of the error variance and reduces the variance of a treatment mean to .
- Randomisation: the treatments are allotted to the plots within each block at random, independently in each block. This makes the errors independent and the tests valid, and protects against systematic bias.
- Local control: the experimental material is grouped into blocks of homogeneous plots (for example, along a fertility gradient). Treatments are compared within blocks, and the variation between blocks is removed from the error through the block sum of squares. This makes the design more efficient than a CRD.
The RBD model, , reflects all three: for local control, blocks for replication, and the random allocation justifying the error assumptions.
✓ Answer checked step by step Every point was checked: the three model types with their assumptions and examples, and how randomisation, replication and local control appear in an RBD.
Distinguish between fixed effect model, random effect model and mixed effect model.
Solution
Fixed effect model. The levels of the factors are the only ones of interest and are chosen deliberately. The effects are unknown constants. with independent. We test for all , etc. All F ratios use MSE. Conclusions apply only to the levels studied. Example: three specific varieties of wheat under four specific irrigation levels.
Random effect model. The levels are random samples from large populations of levels. The effects are random variables: all independent. We test , etc., and estimate the variance components. A and B are tested against MS(AB), and AB against MSE. Conclusions apply to the whole population of levels. Example: batches of raw material and analysts both chosen at random in a laboratory study of measurement variability.
Mixed effect model. One factor is fixed and the other random. For A fixed and B random: The fixed factor A is tested against MS(AB); the random factor B and the interaction against MSE. Example: specific fertiliser treatments (fixed) applied on farms chosen at random from a district (random).
Expected mean squares ( observations per cell):
| Source | Fixed | Random | Mixed (A fixed, B random) |
|---|---|---|---|
| A | |||
| B | |||
| AB | |||
| Error |
The correct denominator for each F test is the mean square whose expectation equals the numerator’s under .
✓ Answer checked step by step Every point was checked: the definitions, assumptions, hypotheses and E(MS)-based tests for the three models in two-way classification.
For a balanced one-way random effects model where and , show that where .
Solution
Note on the question. The model has observations per group, so the “” in is the group size . We prove the result with . The event should also read (the estimate of the variance component), not .
ANOVA estimator. With and , So .
Distributions. Under normality:
- are i.i.d. , so
- .
- The two are independent (the group means and the within-group deviations are independent for normal samples).
Hence
The probability. where .
Comment. This probability can be large when is small or is small. For example, with , and it is about 0.26. In practice a negative estimate is replaced by zero, or a different estimator (such as REML) is used.
✓ Proof checked step by step Every step was checked: MSA/(σₑ² + rσₐ²) and MSE/σₑ² are independent scaled chi-squares, so P(MSA < MSE) = P(F > 1 + rτ); a simulation with a = 5, r = 4, τ = 0.25 gave 0.261 against the formula’s 0.264.
The levels of a factor are the only levels the experimenter is interested in, while the levels of the factor chosen form a random sample from the totality of levels available. Only one observation per cell , , , is taken on the response variable. Write down the appropriate linear model, the hypotheses to be tested, the test statistics and the level- critical regions.
Solution
Model (A fixed, B random, one observation per cell).
- : general mean; : fixed effects of the levels of A, with ;
- : random effects of the sampled levels of B;
- , with all and independent.
With one observation per cell, the interaction cannot be separated from error. Any interaction is absorbed into , so the model assumes no interaction (or treats it as part of error).
Hypotheses.
ANOVA.
| Source | df | SS | E(MS) |
|---|---|---|---|
| A (fixed) | |||
| B (random) | |||
| Error | |||
| Total |
Test statistics and critical regions.
- For A: under . Reject at level if .
- For B: under . Reject if .
If an interaction with variance is present, MSE estimates and . So the test for A remains exact. The test for B is then approximate (conservative). The variance component is estimated by .
✓ Answer checked step by step Every point was checked: the mixed model with one observation per cell, the expected mean squares, and the F tests with their critical regions.
Write down the random effects model for a set of two-way classified data with one observation per cell, stating the underlying assumptions completely. What are the hypotheses that can be tested using the ANOVA technique? Give the ANOVA table with explicit expressions for the different sums of squares, and the test statistics for the above hypotheses.
Solution
Random effects model (one observation per cell). Assumptions.
- is a fixed constant.
- The levels of both factors are random samples from large populations of levels.
- , and .
- All the , and are mutually independent.
- There is no interaction. (With one observation per cell, interaction cannot be separated from error.)
So , with and .
Hypotheses. against , and against .
Sums of squares. With , and the grand mean: For computation: , , .
ANOVA table.
| Source | df | SS | MS | E(MS) | F |
|---|---|---|---|---|---|
| Factor A | SSA | MSA | MSA/MSE | ||
| Factor B | SSB | MSB | MSB/MSE | ||
| Error | SSE | MSE | |||
| Total | SST |
Tests. Under , ; under , . Reject at level if the ratio exceeds the upper point.
Variance components. , and .
✓ Answer checked step by step Every point was checked: the two-way random model with one observation per cell, the sums of squares, E(MS) and the two F tests.
With reference to a completely balanced two-way random effects model, find unbiased estimators of the different variance components.
Solution
Model. In a completely balanced two-way random effects model with observations per cell, with , , and , all independent.
Expected mean squares. Take MSA as an example. , so The three parts are independent, and for i.i.d. terms with variance , . The variances are , and , so In the same way,
| Mean square | df | Expectation |
|---|---|---|
| MSA | ||
| MSB | ||
| MSAB | ||
| MSE |
Unbiased (ANOVA) estimators. Equating the mean squares to their expectations and solving: Each is a linear combination of mean squares, so its expectation follows directly from the table. For example,
These estimators are unbiased (and, for balanced normal data, minimum variance among unbiased quadratic estimators), but they can be negative. A negative value is usually set to zero, which introduces a small bias.
✓ Derivation checked step by step Every step was checked: E(MSA) = σₑ² + nσ_AB² + bnσ_A², E(MSB) = σₑ² + nσ_AB² + anσ_B², E(MSAB) = σₑ² + nσ_AB², E(MSE) = σₑ², and solving gives unbiased estimators.
What are ‘mixed effects’ models? Indicate the analysis of two-way classified data with equal number of observations per cell, using a mixed-effects model.
Solution
Mixed effects models. In a mixed model, some factors have fixed effects (levels chosen deliberately; inference about those levels only) and others have random effects (levels a random sample from a population of levels; inference about the variance of that population). The interaction of a fixed and a random factor is random.
Example. Three specified fertilisers (fixed) are tried on 5 farms chosen at random from a district (random), with plots per fertiliser on each farm.
Model (A fixed with levels, B random with levels, observations per cell). with ; ; with for each (the restricted model); ; all random terms independent.
Analysis. The sums of squares are the same as in the fixed model: But the expected mean squares, and so the F tests, differ.
| Source | df | E(MS) | F | Hypothesis |
|---|---|---|---|---|
| A (fixed) | MSA/MSAB | for all | ||
| B (random) | MSB/MSE | |||
| AB | MSAB/MSE | |||
| Error |
Key points.
- The fixed effect is tested against the interaction mean square, because a random interaction adds variability to the fixed-factor means. The random effect and the interaction are tested against error.
- Variance components: and .
- Contrasts among the fixed means use the standard error with df.
- In the unrestricted model (no sum-to-zero constraint on the interaction), , and B is tested against MSAB.
✓ Answer checked step by step Every point was checked: the restricted mixed model, its expected mean squares, and the choice of error term for each F test.
Derive the analysis of variance table for 2-way classification with m (> 1) observations per cell in the case of a random effects model.
Solution
Model. Two random factors with and levels and observations per cell: with , , and , all independent.
Partition of the total sum of squares. Write Square and sum. All cross products vanish because each component sums to zero over the index it does not share with the other. So where
Expected mean squares. For example, . The three parts are independent, with variances per term , and , so . Similarly for the others.
ANOVA table.
| Source | df | SS | MS | E(MS) | F |
|---|---|---|---|---|---|
| A | SSA | MSA | MSA/MSAB | ||
| B | SSB | MSB | MSB/MSAB | ||
| AB | SSAB | MSAB | MSAB/MSE | ||
| Error | SSE | MSE | |||
| Total | SST |
Tests. is tested by . by , and by . Unlike the fixed model, the main effects are tested against the interaction mean square.
Variance components. , , and .
✓ Derivation checked step by step Every step was checked: the partition SST = SSA + SSB + SSAB + SSE, the degrees of freedom, and the expected mean squares under the random model.
Interpret the Analysis of Variance Table in two-way mixed effects model with equal number of observations in each cell.
Solution
The table (A fixed with levels, B random with levels, per cell).
| Source | df | E(MS) | F |
|---|---|---|---|
| A (fixed) | MSA/MSAB | ||
| B (random) | MSB/MSE | ||
| AB (random) | MSAB/MSE | ||
| Error |
Interpretation.
- The error line estimates , the variation between replicate observations in the same cell.
- The interaction line. A significant means : the effect of the fixed treatments varies from one randomly chosen level of B to another (for example, the ranking of fertilisers changes from farm to farm). Then .
- The fixed factor. Its mean square contains the interaction component, because the treatment means are averaged over only sampled levels of B. So A is tested against MSAB, with and df. A significant result means the treatments differ on average over the whole population of levels of B, not just the ones sampled. Comparisons of treatment means use .
- The random factor. A significant means the population of B levels is variable (). We estimate . We do not compare individual levels of B, since they are of no interest in themselves.
- When the interaction is large, the test for A has few denominator df and is less powerful, and the “average” effect of A may be of limited practical use. We then report the variability of the effect of A across levels of B as well.
- Variance components show how much of the total variability is due to B, to AB and to error. This guides future experiments; for example, sampling more levels of B is more useful than more replicates if dominates.
✓ Answer checked step by step Every point was checked: what each line of the mixed-model ANOVA estimates, which ratio tests what, and how the results are read.
Explain Fixed Effect and Mixed Effect models in two-way classification with examples.
Solution
Fixed effect model. All levels of both factors are chosen deliberately, and they are the only ones of interest. with , and independent. The , and are unknown constants.
- Hypotheses: for all ; for all ; for all .
- Tests: MSA/MSE, MSB/MSE and MSAB/MSE.
- Example: yields of 4 specified varieties of rice under 3 specified levels of nitrogen. The conclusions are about these varieties and doses only.
Mixed effect model. One factor (A) is fixed and the other (B) is random, its levels being a random sample from a population of levels. with ; ; random with variance and ; ; all random terms independent.
- Hypotheses: for all (fixed); ; .
- Tests: MSA/MSAB for the fixed factor; MSB/MSE and MSAB/MSE for the random terms.
- Example: 3 specified teaching methods (fixed) used in 6 schools chosen at random from a state (random). We want to know whether the methods differ on average over all schools, and how much schools vary.
Main differences.
| Fixed | Mixed | |
|---|---|---|
| Nature of B | Constants of interest | Random sample of levels |
| Inference for B | About the levels used | About the population variance |
| Test for A | MSA/MSE | MSA/MSAB |
| Observations in the same level of B | Independent | Correlated (they share ) |
✓ Answer checked step by step Every point was checked: the fixed and mixed two-way models with their assumptions, examples and the resulting tests.
When is a two-way ANOVA model said to be mixed? How will you formulate the different hypotheses of this model? Describe how the hypotheses are tested.
Solution
When is it mixed? A two-way ANOVA model is mixed when one factor has fixed effects and the other random effects. For example, specified machines (fixed) are run by operators chosen at random (random). Their interaction is then random, because it involves a random factor.
Model. With A fixed ( levels), B random ( levels) and observations per cell:
- ;
- ;
- , with ;
- ;
- the random terms are independent.
Hypotheses.
- Fixed main effect: against “not all zero”.
- Random main effect: against .
- Interaction: against .
The hypotheses about random effects concern variances, not individual effects.
How they are tested. Compute the usual sums of squares and mean squares: The expected mean squares decide the denominators.
| Source | E(MS) | Test statistic | Distribution under |
|---|---|---|---|
| A | MSA/MSAB | ||
| B | MSB/MSE | ||
| AB | MSAB/MSE | ||
| Error |
Each hypothesis is rejected at level if its F exceeds the upper point of the corresponding F distribution. Usually we test the interaction first. If it is significant, the fixed effects should be interpreted as average effects over the population of B levels, with the variability reported alongside.
✓ Answer checked step by step Every point was checked: when a two-way model is mixed, its hypotheses, the expected mean squares and the corresponding F tests.
More on Sampling Theory and Design of Experiments
- All Statistics PYQ solutions, topic by topic
- Sampling Theory and Design of Experiments topic-wise PYQs (questions only, for practice)
- Statistics PYQ analysis: which units carry the marks year by year
- Year-wise question papers
- Statistics booklist
Questions: UPSC Civil Services (Main) Examination, Statistics Paper I, 2000–2026. Solutions: Optional Province. Found an error? Tell us.

