Menu Close

Fixed, random and mixed effects models: UPSC Statistics Optional PYQ Solutions (2000–2026)

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

Cover of the UPSC Prelims Topic-wise PYQ book with detailed explanations

From the Optional Province team

Preparing for Prelims too?

Our UPSC Prelims Topic-wise PYQ Book covers every Prelims question with detailed explanations, so you can see exactly where UPSC asks from. Now available as a hard copy and an eBook.

Buy Hard Copy on AmazonBuy eBook (PDF)

Download a free sample

The following data come from a two-factor random effect model:

Factor A \ Factor B B1 B2 B3
A1 6, 8 10, 12 14, 16
A2 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.

2026 · Paper I · Q7b · 20 marks

Solution

(i) Model. Two random factors with a=2a=2 levels of A, b=3b=3 levels of B and n=2n=2 observations per cell: yijk=μ+αi+βj+(αβ)ij+eijk,i=1,2;j=1,2,3;k=1,2.y_{ijk}=\mu+\alpha_i+\beta_j+(\alpha\beta)_{ij}+e_{ijk},\qquad i=1,2;\ j=1,2,3;\ k=1,2 . Assumptions.

  • μ\mu is a fixed general mean.
  • αi∼N(0,σA2)\alpha_i\sim N(0,\sigma_A^2), βj∼N(0,σB2)\beta_j\sim N(0,\sigma_B^2), (αβ)ij∼N(0,σAB2)(\alpha\beta)_{ij}\sim N(0,\sigma_{AB}^2) and eijk∼N(0,σe2)e_{ijk}\sim N(0,\sigma_e^2).
  • 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. H0A:σA2=0H_{0A}:\sigma_A^2=0, H0B:σB2=0H_{0B}:\sigma_B^2=0 and H0AB:σAB2=0H_{0AB}:\sigma_{AB}^2=0, each against the alternative that the variance is positive.

Means.

B1B_1 B2B_2 B3B_3 A mean
A1A_1 7 11 15 11
A2A_2 13 17 21 17
B mean 10 14 18 14

Sums of squares.

  • SSA=bn∑(y‾i..−y‾)2=6[(−3)2+32]=108SSA=bn\sum(\bar y_{i..}-\bar y)^2=6\left[(-3)^2+3^2\right]=108.
  • SSB=an∑(y‾.j.−y‾)2=4[(−4)2+0+42]=128SSB=an\sum(\bar y_{.j.}-\bar y)^2=4\left[(-4)^2+0+4^2\right]=128.
  • SSAB=n∑(y‾ij.−y‾i..−y‾.j.+y‾)2=0SSAB=n\sum(\bar y_{ij.}-\bar y_{i..}-\bar y_{.j.}+\bar y)^2=0. Every cell mean is exactly additive (for example 7−11−10+14=07-11-10+14=0).
  • SSESSE: the two observations in each cell differ by 2, so each cell contributes 1+1=21+1=2, and SSE=6×2=12SSE=6\times2=12.
  • Total: ∑(y−14)2=248=108+128+0+12\sum(y-14)^2=248=108+128+0+12.

ANOVA table (random effects).

Source df SS MS E(MS) F
A 1 108 108 σe2+nσAB2+bnσA2\sigma_e^2+n\sigma_{AB}^2+bn\sigma_A^2 MSA/MSAB
B 2 128 64 σe2+nσAB2+anσB2\sigma_e^2+n\sigma_{AB}^2+an\sigma_B^2 MSB/MSAB
AB 2 0 0 σe2+nσAB2\sigma_e^2+n\sigma_{AB}^2 MSAB/MSE =0=0
Error 6 12 2 σe2\sigma_e^2
Total 11 248

Tests.

  1. Interaction: F=0/2=0<F0.05(2,6)=5.14F=0/2=0<F_{0.05}(2,6)=5.14. We do not reject H0ABH_{0AB}: there is no evidence of interaction. (The estimate σ̂AB2=(0−2)/2=−1\hat\sigma_{AB}^2=(0-2)/2=-1 is negative and is taken as 0.)
  2. Main effects. In a random model, A and B are tested against MSAB. Here MSAB =0=0, 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 =0+12=12=0+12=12 on 2+6=82+6=8 df, so the pooled MS is 1.51.5.

  • FA=108/1.5=72.0>F0.05(1,8)=5.32F_A=108/1.5=72.0>F_{0.05}(1,8)=5.32: reject H0AH_{0A}, so σA2>0\sigma_A^2>0.
  • FB=64/1.5=42.7>F0.05(2,8)=4.46F_B=64/1.5=42.7>F_{0.05}(2,8)=4.46: reject H0BH_{0B}, so σB2>0\sigma_B^2>0.

Both factors contribute significant variability. The variance components are estimated as σ̂A2=(108−0)/6=18\hat\sigma_A^2=(108-0)/6=18, σ̂B2=(64−0)/4=16\hat\sigma_B^2=(64-0)/4=16 and σ̂e2=2\hat\sigma_e^2=2 (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.

↑ Back to the question list

Differentiate among fixed, random and mixed effect models with examples. How are the three basic principles of design fulfilled in randomised block design? Explain.

2023 · Paper I · Q8c · 15 marks

Solution

Fixed, random and mixed effects models. Consider yij=μ+τi+eijy_{ij}=\mu+\tau_i+e_{ij} (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, ∑τi=0\sum\tau_i=0 Random variables, τi∼N(0,στ2)\tau_i\sim N(0,\sigma_\tau^2) Fixed αi\alpha_i; random bj∼N(0,σb2)b_j\sim N(0,\sigma_b^2)
Hypothesis H0:τ1=…=τt=0H_0:\tau_1=\dots=\tau_t=0 H0:στ2=0H_0:\sigma_\tau^2=0 αi=0\alpha_i=0 for fixed; σb2=0\sigma_b^2=0 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.

  1. Replication: each treatment appears once in each of rr blocks, so it is replicated rr times. This gives an estimate of the error variance and reduces the variance of a treatment mean to σ2/r\sigma^2/r.
  2. 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.
  3. 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, yij=μ+τi+βj+eijy_{ij}=\mu+\tau_i+\beta_j+e_{ij}, reflects all three: βj\beta_j for local control, rr 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.

↑ Back to the question list

Distinguish between fixed effect model, random effect model and mixed effect model.

2019 · Paper I · Q6b · 15 marks

Solution

Fixed effect model. The levels of the factors are the only ones of interest and are chosen deliberately. The effects are unknown constants. yijk=μ+αi+βj+(αβ)ij+eijk,∑iαi=∑jβj=∑i(αβ)ij=∑j(αβ)ij=0,y_{ijk}=\mu+\alpha_i+\beta_j+(\alpha\beta)_{ij}+e_{ijk},\qquad \sum_i\alpha_i=\sum_j\beta_j=\sum_i(\alpha\beta)_{ij}=\sum_j(\alpha\beta)_{ij}=0, with eijk∼N(0,σ2)e_{ijk}\sim N(0,\sigma^2) independent. We test H0:αi=0H_0:\alpha_i=0 for all ii, 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: αi∼N(0,σA2),βj∼N(0,σB2),(αβ)ij∼N(0,σAB2),eijk∼N(0,σ2),\alpha_i\sim N(0,\sigma_A^2),\quad \beta_j\sim N(0,\sigma_B^2),\quad (\alpha\beta)_{ij}\sim N(0,\sigma_{AB}^2),\quad e_{ijk}\sim N(0,\sigma^2), all independent. We test H0:σA2=0H_0:\sigma_A^2=0, 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: ∑iαi=0,βj∼N(0,σB2),(αβ)ij∼N(0,a−1aσAB2) with ∑i(αβ)ij=0.\sum_i\alpha_i=0,\qquad \beta_j\sim N(0,\sigma_B^2),\qquad (\alpha\beta)_{ij}\sim N\left(0,\tfrac{a-1}{a}\sigma_{AB}^2\right)\text{ with }\sum_i(\alpha\beta)_{ij}=0 . 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 (nn observations per cell):

Source Fixed Random Mixed (A fixed, B random)
A σ2+bn∑αi2a−1\sigma^2+\frac{bn\sum\alpha_i^2}{a-1} σ2+nσAB2+bnσA2\sigma^2+n\sigma_{AB}^2+bn\sigma_A^2 σ2+nσAB2+bn∑αi2a−1\sigma^2+n\sigma_{AB}^2+\frac{bn\sum\alpha_i^2}{a-1}
B σ2+an∑βj2b−1\sigma^2+\frac{an\sum\beta_j^2}{b-1} σ2+nσAB2+anσB2\sigma^2+n\sigma_{AB}^2+an\sigma_B^2 σ2+anσB2\sigma^2+an\sigma_B^2
AB σ2+n∑∑(αβ)ij2(a−1)(b−1)\sigma^2+\frac{n\sum\sum(\alpha\beta)_{ij}^2}{(a-1)(b-1)} σ2+nσAB2\sigma^2+n\sigma_{AB}^2 σ2+nσAB2\sigma^2+n\sigma_{AB}^2
Error σ2\sigma^2 σ2\sigma^2 σ2\sigma^2

The correct denominator for each F test is the mean square whose expectation equals the numerator’s under H0H_0.

✓ 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.

↑ Back to the question list

For a balanced one-way random effects model Yij=μ+ai+eij,i=1,2,⋯,a;j=1,2,⋯,r where ai∼N(0,σa2)∀i and eij∼N(0,σe2)∀i,j, show that P[σ̂a<0]=P[Fa(r−1),a−1>1+nτ] where τ=σa2σe2.

2017 · Paper I · Q5c · 10 marks

Solution

Note on the question. The model has rr observations per group, so the “nn” in 1+nτ1+n\tau is the group size rr. We prove the result with rr. The event should also read σ̂a2<0\hat\sigma_a^2<0 (the estimate of the variance component), not σ̂a<0\hat\sigma_a<0.

ANOVA estimator. With MSA=r∑i(y‾i.−y‾..)2a−1MSA=\dfrac{r\sum_i(\bar y_{i.}-\bar y_{..})^2}{a-1} and MSE=∑i∑j(yij−y‾i.)2a(r−1)MSE=\dfrac{\sum_i\sum_j(y_{ij}-\bar y_{i.})^2}{a(r-1)}, E(MSA)=σe2+rσa2,E(MSE)=σe2,σ̂a2=MSA−MSEr.E(MSA)=\sigma_e^2+r\sigma_a^2,\qquad E(MSE)=\sigma_e^2,\qquad \hat\sigma_a^2=\frac{MSA-MSE}{r}. So σ̂a2<0⇔MSA<MSE\hat\sigma_a^2<0\iff MSA<MSE.

Distributions. Under normality:

  • y‾i.=μ+ai+e‾i.\bar y_{i.}=\mu+a_i+\bar e_{i.} are i.i.d. N(μ,σa2+σe2/r)N\left(\mu,\sigma_a^2+\sigma_e^2/r\right), so (a−1)MSAσe2+rσa2∼χa−12.\frac{(a-1)MSA}{\sigma_e^2+r\sigma_a^2}\sim\chi^2_{a-1}.
  • a(r−1)MSEσe2∼χa(r−1)2\dfrac{a(r-1)MSE}{\sigma_e^2}\sim\chi^2_{a(r-1)}.
  • The two are independent (the group means and the within-group deviations are independent for normal samples).

Hence F=MSE/σe2MSA/(σe2+rσa2)∼Fa(r−1),a−1.F=\frac{MSE/\sigma_e^2}{MSA/(\sigma_e^2+r\sigma_a^2)}\sim F_{a(r-1),\,a-1}.

The probability. P(σ̂a2<0)=P(MSEMSA>1)=P(MSE/σe2MSA/(σe2+rσa2)>σe2+rσa2σe2)=P[Fa(r−1),a−1>1+rτ],P(\hat\sigma_a^2<0)=P\left(\frac{MSE}{MSA}>1\right)=P\left(\frac{MSE/\sigma_e^2}{MSA/(\sigma_e^2+r\sigma_a^2)}>\frac{\sigma_e^2+r\sigma_a^2}{\sigma_e^2}\right)=P\left[F_{a(r-1),\,a-1}>1+r\tau\right], where τ=σa2/σe2\tau=\sigma_a^2/\sigma_e^2. ◼\blacksquare

Comment. This probability can be large when τ\tau is small or aa is small. For example, with a=5a=5, r=4r=4 and τ=0.25\tau=0.25 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.

↑ Back to the question list

The p levels of a factor A are the only levels the experimenter is interested in, while the q levels of the factor B chosen form a random sample from the totality of levels available. Only one observation per cell Ai×Bj, i=1(1)p, j=1(1)q, 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.

2011 · Paper I · Q5a · 12 marks

Solution

Model (A fixed, B random, one observation per cell). yij=μ+αi+bj+eij,i=1,…,p;j=1,…,q,y_{ij}=\mu+\alpha_i+b_j+e_{ij},\qquad i=1,\dots,p;\ j=1,\dots,q,

  • μ\mu: general mean; αi\alpha_i: fixed effects of the levels of A, with ∑iαi=0\sum_i\alpha_i=0;
  • bj∼N(0,σb2)b_j\sim N(0,\sigma_b^2): random effects of the sampled levels of B;
  • eij∼N(0,σ2)e_{ij}\sim N(0,\sigma^2), with all bjb_j and eije_{ij} independent.

With one observation per cell, the interaction cannot be separated from error. Any interaction is absorbed into eije_{ij}, so the model assumes no interaction (or treats it as part of error).

Hypotheses. H0A:α1=α2=…=αp=0vsH1A:not all αi=0,H_{0A}:\alpha_1=\alpha_2=\dots=\alpha_p=0\quad\text{vs}\quad H_{1A}:\text{not all }\alpha_i=0, H0B:σb2=0vsH1B:σb2>0.H_{0B}:\sigma_b^2=0\quad\text{vs}\quad H_{1B}:\sigma_b^2>0 .

ANOVA.

Source df SS E(MS)
A (fixed) p−1p-1 SSA=q∑i(y‾i.−y‾..)2SSA=q\sum_i(\bar y_{i.}-\bar y_{..})^2 σ2+q∑αi2p−1\sigma^2+\dfrac{q\sum\alpha_i^2}{p-1}
B (random) q−1q-1 SSB=p∑j(y‾.j−y‾..)2SSB=p\sum_j(\bar y_{.j}-\bar y_{..})^2 σ2+pσb2\sigma^2+p\sigma_b^2
Error (p−1)(q−1)(p-1)(q-1) SSE=∑∑(yij−y‾i.−y‾.j+y‾..)2SSE=\sum\sum(y_{ij}-\bar y_{i.}-\bar y_{.j}+\bar y_{..})^2 σ2\sigma^2
Total pq−1pq-1 ∑∑(yij−y‾..)2\sum\sum(y_{ij}-\bar y_{..})^2

Test statistics and critical regions.

  • For A: FA=MSAMSE∼Fp−1,(p−1)(q−1)F_A=\dfrac{MSA}{MSE}\sim F_{p-1,(p-1)(q-1)} under H0AH_{0A}. Reject H0AH_{0A} at level α\alpha if FA>Fα(p−1,(p−1)(q−1))F_A>F_\alpha\big(p-1,(p-1)(q-1)\big).
  • For B: FB=MSBMSE∼Fq−1,(p−1)(q−1)F_B=\dfrac{MSB}{MSE}\sim F_{q-1,(p-1)(q-1)} under H0BH_{0B}. Reject H0BH_{0B} if FB>Fα(q−1,(p−1)(q−1))F_B>F_\alpha\big(q-1,(p-1)(q-1)\big).

If an interaction (αb)ij(\alpha b)_{ij} with variance σab2\sigma_{ab}^2 is present, MSE estimates σ2+σab2\sigma^2+\sigma_{ab}^2 and E(MSA)=σ2+σab2+q∑αi2p−1E(MSA)=\sigma^2+\sigma_{ab}^2+\frac{q\sum\alpha_i^2}{p-1}. So the test for A remains exact. The test for B is then approximate (conservative). The variance component is estimated by σ̂b2=(MSB−MSE)/p\hat\sigma_b^2=(MSB-MSE)/p.

✓ 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.

↑ Back to the question list

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.

2009 · Paper I · Q8b · 20 marks

Solution

Random effects model (one observation per cell). yij=μ+ai+bj+eij,i=1,…,p;j=1,…,q.y_{ij}=\mu+a_i+b_j+e_{ij},\qquad i=1,\dots,p;\ j=1,\dots,q . Assumptions.

  1. μ\mu is a fixed constant.
  2. The levels of both factors are random samples from large populations of levels.
  3. ai∼N(0,σa2)a_i\sim N(0,\sigma_a^2), bj∼N(0,σb2)b_j\sim N(0,\sigma_b^2) and eij∼N(0,σe2)e_{ij}\sim N(0,\sigma_e^2).
  4. All the aia_i, bjb_j and eije_{ij} are mutually independent.
  5. There is no interaction. (With one observation per cell, interaction cannot be separated from error.)

So V(yij)=σa2+σb2+σe2V(y_{ij})=\sigma_a^2+\sigma_b^2+\sigma_e^2, with Cov(yij,yij′)=σa2\operatorname{Cov}(y_{ij},y_{ij'})=\sigma_a^2 and Cov(yij,yi′j)=σb2\operatorname{Cov}(y_{ij},y_{i'j})=\sigma_b^2.

Hypotheses. H01:σa2=0H_{01}:\sigma_a^2=0 against σa2>0\sigma_a^2>0, and H02:σb2=0H_{02}:\sigma_b^2=0 against σb2>0\sigma_b^2>0.

Sums of squares. With y‾i.=1q∑jyij\bar y_{i.}=\frac1q\sum_jy_{ij}, y‾.j=1p∑iyij\bar y_{.j}=\frac1p\sum_iy_{ij} and y‾..\bar y_{..} the grand mean: SSA=q∑i(y‾i.−y‾..)2,SSB=p∑j(y‾.j−y‾..)2,SSA=q\sum_{i}(\bar y_{i.}-\bar y_{..})^2,\qquad SSB=p\sum_j(\bar y_{.j}-\bar y_{..})^2, SSE=∑i∑j(yij−y‾i.−y‾.j+y‾..)2,SST=∑i∑j(yij−y‾..)2=SSA+SSB+SSE.SSE=\sum_i\sum_j(y_{ij}-\bar y_{i.}-\bar y_{.j}+\bar y_{..})^2,\qquad SST=\sum_i\sum_j(y_{ij}-\bar y_{..})^2=SSA+SSB+SSE . For computation: SSA=1q∑iYi.2−G2pqSSA=\frac1q\sum_iY_{i.}^2-\frac{G^2}{pq}, SSB=1p∑jY.j2−G2pqSSB=\frac1p\sum_jY_{.j}^2-\frac{G^2}{pq}, SST=∑∑yij2−G2pqSST=\sum\sum y_{ij}^2-\frac{G^2}{pq}.

ANOVA table.

Source df SS MS E(MS) F
Factor A p−1p-1 SSA MSA σe2+qσa2\sigma_e^2+q\sigma_a^2 MSA/MSE
Factor B q−1q-1 SSB MSB σe2+pσb2\sigma_e^2+p\sigma_b^2 MSB/MSE
Error (p−1)(q−1)(p-1)(q-1) SSE MSE σe2\sigma_e^2
Total pq−1pq-1 SST

Tests. Under H01H_{01}, F1=MSA/MSE∼Fp−1,(p−1)(q−1)F_1=MSA/MSE\sim F_{p-1,(p-1)(q-1)}; under H02H_{02}, F2=MSB/MSE∼Fq−1,(p−1)(q−1)F_2=MSB/MSE\sim F_{q-1,(p-1)(q-1)}. Reject at level α\alpha if the ratio exceeds the upper α\alpha point.

Variance components. σ̂e2=MSE\hat\sigma_e^2=MSE, σ̂a2=(MSA−MSE)/q\hat\sigma_a^2=(MSA-MSE)/q and σ̂b2=(MSB−MSE)/p\hat\sigma_b^2=(MSB-MSE)/p.

✓ 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.

↑ Back to the question list

Cover of the UPSC Mains Topic-wise and Year-wise PYQs book (2013–2026)

From the Optional Province team

Strengthen your GS papers

Our UPSC Mains Topic-wise & Year-wise PYQ Book (2013–2026) maps every GS question to the syllabus, so you know what UPSC asks and how often. Now available as a hard copy and an eBook.

Buy Hard Copy on AmazonBuy eBook (PDF)

Download a free sample

With reference to a completely balanced two-way random effects model, find unbiased estimators of the different variance components.

2007 · Paper I · Q5c · 12 marks

Solution

Model. In a completely balanced two-way random effects model with nn observations per cell, yijk=μ+αi+βj+(αβ)ij+eijk,i=1,…,a;j=1,…,b;k=1,…,n,y_{ijk}=\mu+\alpha_i+\beta_j+(\alpha\beta)_{ij}+e_{ijk},\quad i=1,\dots,a;\ j=1,\dots,b;\ k=1,\dots,n, with αi∼N(0,σA2)\alpha_i\sim N(0,\sigma_A^2), βj∼N(0,σB2)\beta_j\sim N(0,\sigma_B^2), (αβ)ij∼N(0,σAB2)(\alpha\beta)_{ij}\sim N(0,\sigma_{AB}^2) and eijk∼N(0,σe2)e_{ijk}\sim N(0,\sigma_e^2), all independent.

Expected mean squares. Take MSA as an example. y‾i..=μ+αi+β‾.+(αβ)¯i.+e‾i..\bar y_{i..}=\mu+\alpha_i+\bar\beta_.+\overline{(\alpha\beta)}_{i.}+\bar e_{i..}, so y‾i..−y‾...=(αi−α‾)+((αβ)¯i.−(αβ)¯..)+(e‾i..−e‾...).\bar y_{i..}-\bar y_{…}=(\alpha_i-\bar\alpha)+\big(\overline{(\alpha\beta)}_{i.}-\overline{(\alpha\beta)}_{..}\big)+(\bar e_{i..}-\bar e_{…}). The three parts are independent, and for i.i.d. terms uiu_i with variance τ2\tau^2, E∑i=1a(ui−u‾)2=(a−1)τ2E\sum_{i=1}^a(u_i-\bar u)^2=(a-1)\tau^2. The variances are σA2\sigma_A^2, σAB2/b\sigma_{AB}^2/b and σe2/(bn)\sigma_e^2/(bn), so E(SSA)=bn(a−1)[σA2+σAB2b+σe2bn],E(MSA)=σe2+nσAB2+bnσA2.E(SSA)=bn(a-1)\left[\sigma_A^2+\frac{\sigma_{AB}^2}{b}+\frac{\sigma_e^2}{bn}\right],\qquad E(MSA)=\sigma_e^2+n\sigma_{AB}^2+bn\sigma_A^2 . In the same way,

Mean square df Expectation
MSA a−1a-1 σe2+nσAB2+bnσA2\sigma_e^2+n\sigma_{AB}^2+bn\sigma_A^2
MSB b−1b-1 σe2+nσAB2+anσB2\sigma_e^2+n\sigma_{AB}^2+an\sigma_B^2
MSAB (a−1)(b−1)(a-1)(b-1) σe2+nσAB2\sigma_e^2+n\sigma_{AB}^2
MSE ab(n−1)ab(n-1) σe2\sigma_e^2

Unbiased (ANOVA) estimators. Equating the mean squares to their expectations and solving: σ̂e2=MSE,σ̂AB2=MSAB−MSEn,σ̂A2=MSA−MSABbn,σ̂B2=MSB−MSABan.\boxed{\hat\sigma_e^2=MSE,\qquad \hat\sigma_{AB}^2=\frac{MSAB-MSE}{n},\qquad \hat\sigma_A^2=\frac{MSA-MSAB}{bn},\qquad \hat\sigma_B^2=\frac{MSB-MSAB}{an}.} Each is a linear combination of mean squares, so its expectation follows directly from the table. For example, E(σ̂A2)=(σe2+nσAB2+bnσA2)−(σe2+nσAB2)bn=σA2.E(\hat\sigma_A^2)=\frac{(\sigma_e^2+n\sigma_{AB}^2+bn\sigma_A^2)-(\sigma_e^2+n\sigma_{AB}^2)}{bn}=\sigma_A^2 .

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.

↑ Back to the question list

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.

2005 · Paper I · Q8c · 20 marks

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 nn plots per fertiliser on each farm.

Model (A fixed with aa levels, B random with bb levels, nn observations per cell). yijk=μ+αi+βj+(αβ)ij+eijk,y_{ijk}=\mu+\alpha_i+\beta_j+(\alpha\beta)_{ij}+e_{ijk}, with ∑iαi=0\sum_i\alpha_i=0; βj∼N(0,σB2)\beta_j\sim N(0,\sigma_B^2); (αβ)ij∼N(0,a−1aσAB2)(\alpha\beta)_{ij}\sim N\left(0,\frac{a-1}{a}\sigma_{AB}^2\right) with ∑i(αβ)ij=0\sum_i(\alpha\beta)_{ij}=0 for each jj (the restricted model); eijk∼N(0,σ2)e_{ijk}\sim N(0,\sigma^2); all random terms independent.

Analysis. The sums of squares are the same as in the fixed model: SSA=bn∑i(y‾i..−y‾)2,SSB=an∑j(y‾.j.−y‾)2,SSAB=n∑∑(y‾ij.−y‾i..−y‾.j.+y‾)2,SSE=∑∑∑(yijk−y‾ij.)2.SSA=bn\sum_i(\bar y_{i..}-\bar y)^2,\quad SSB=an\sum_j(\bar y_{.j.}-\bar y)^2,\quad SSAB=n\sum\sum(\bar y_{ij.}-\bar y_{i..}-\bar y_{.j.}+\bar y)^2,\quad SSE=\sum\sum\sum(y_{ijk}-\bar y_{ij.})^2 . But the expected mean squares, and so the F tests, differ.

Source df E(MS) F Hypothesis
A (fixed) a−1a-1 σ2+nσAB2+bn∑αi2a−1\sigma^2+n\sigma_{AB}^2+\dfrac{bn\sum\alpha_i^2}{a-1} MSA/MSAB αi=0\alpha_i=0 for all ii
B (random) b−1b-1 σ2+anσB2\sigma^2+an\sigma_B^2 MSB/MSE σB2=0\sigma_B^2=0
AB (a−1)(b−1)(a-1)(b-1) σ2+nσAB2\sigma^2+n\sigma_{AB}^2 MSAB/MSE σAB2=0\sigma_{AB}^2=0
Error ab(n−1)ab(n-1) σ2\sigma^2

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: σ̂B2=(MSB−MSE)/(an)\hat\sigma_B^2=(MSB-MSE)/(an) and σ̂AB2=(MSAB−MSE)/n\hat\sigma_{AB}^2=(MSAB-MSE)/n.
  • Contrasts among the fixed means use the standard error 2MSAB/(bn)\sqrt{2MSAB/(bn)} with (a−1)(b−1)(a-1)(b-1) df.
  • In the unrestricted model (no sum-to-zero constraint on the interaction), E(MSB)=σ2+nσAB2+anσB2E(MSB)=\sigma^2+n\sigma_{AB}^2+an\sigma_B^2, 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.

↑ Back to the question list

Derive the analysis of variance table for 2-way classification with m (> 1) observations per cell in the case of a random effects model.

2004 · Paper I · Q8b · 20 marks

Solution

Model. Two random factors with pp and qq levels and m>1m>1 observations per cell: yijk=μ+ai+bj+(ab)ij+eijk,i=1,…,p;j=1,…,q;k=1,…,m,y_{ijk}=\mu+a_i+b_j+(ab)_{ij}+e_{ijk},\qquad i=1,\dots,p;\ j=1,\dots,q;\ k=1,\dots,m, with ai∼N(0,σa2)a_i\sim N(0,\sigma_a^2), bj∼N(0,σb2)b_j\sim N(0,\sigma_b^2), (ab)ij∼N(0,σab2)(ab)_{ij}\sim N(0,\sigma_{ab}^2) and eijk∼N(0,σ2)e_{ijk}\sim N(0,\sigma^2), all independent.

Partition of the total sum of squares. Write yijk−y‾=(y‾i..−y‾)+(y‾.j.−y‾)+(y‾ij.−y‾i..−y‾.j.+y‾)+(yijk−y‾ij.).y_{ijk}-\bar y=(\bar y_{i..}-\bar y)+(\bar y_{.j.}-\bar y)+(\bar y_{ij.}-\bar y_{i..}-\bar y_{.j.}+\bar y)+(y_{ijk}-\bar y_{ij.}). Square and sum. All cross products vanish because each component sums to zero over the index it does not share with the other. So SST=SSA+SSB+SSAB+SSE,SST=SSA+SSB+SSAB+SSE, where SSA=qm∑i(y‾i..−y‾)2,SSB=pm∑j(y‾.j.−y‾)2,SSAB=m∑i∑j(y‾ij.−y‾i..−y‾.j.+y‾)2,SSE=∑∑∑(yijk−y‾ij.)2.SSA=qm\sum_i(\bar y_{i..}-\bar y)^2,\quad SSB=pm\sum_j(\bar y_{.j.}-\bar y)^2,\quad SSAB=m\sum_i\sum_j(\bar y_{ij.}-\bar y_{i..}-\bar y_{.j.}+\bar y)^2,\quad SSE=\sum\sum\sum(y_{ijk}-\bar y_{ij.})^2 .

Expected mean squares. For example, y‾i..−y‾=(ai−a‾)+(ab¯i.−ab¯..)+(e‾i..−e‾...)\bar y_{i..}-\bar y=(a_i-\bar a)+(\overline{ab}_{i.}-\overline{ab}_{..})+(\bar e_{i..}-\bar e_{…}). The three parts are independent, with variances per term σa2\sigma_a^2, σab2/q\sigma_{ab}^2/q and σ2/(qm)\sigma^2/(qm), so E(SSA)=qm(p−1)[σa2+σab2q+σ2qm]E(SSA)=qm(p-1)\left[\sigma_a^2+\frac{\sigma_{ab}^2}{q}+\frac{\sigma^2}{qm}\right]. Similarly for the others.

ANOVA table.

Source df SS MS E(MS) F
A p−1p-1 SSA MSA σ2+mσab2+qmσa2\sigma^2+m\sigma_{ab}^2+qm\sigma_a^2 MSA/MSAB
B q−1q-1 SSB MSB σ2+mσab2+pmσb2\sigma^2+m\sigma_{ab}^2+pm\sigma_b^2 MSB/MSAB
AB (p−1)(q−1)(p-1)(q-1) SSAB MSAB σ2+mσab2\sigma^2+m\sigma_{ab}^2 MSAB/MSE
Error pq(m−1)pq(m-1) SSE MSE σ2\sigma^2
Total pqm−1pqm-1 SST

Tests. H0:σab2=0H_0:\sigma_{ab}^2=0 is tested by MSAB/MSE∼F(p−1)(q−1),pq(m−1)MSAB/MSE\sim F_{(p-1)(q-1),\,pq(m-1)}. H0:σa2=0H_0:\sigma_a^2=0 by MSA/MSAB∼Fp−1,(p−1)(q−1)MSA/MSAB\sim F_{p-1,(p-1)(q-1)}, and H0:σb2=0H_0:\sigma_b^2=0 by MSB/MSAB∼Fq−1,(p−1)(q−1)MSB/MSAB\sim F_{q-1,(p-1)(q-1)}. Unlike the fixed model, the main effects are tested against the interaction mean square.

Variance components. σ̂2=MSE\hat\sigma^2=MSE, σ̂ab2=MSAB−MSEm\hat\sigma_{ab}^2=\frac{MSAB-MSE}{m}, σ̂a2=MSA−MSABqm\hat\sigma_a^2=\frac{MSA-MSAB}{qm} and σ̂b2=MSB−MSABpm\hat\sigma_b^2=\frac{MSB-MSAB}{pm}.

✓ 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.

↑ Back to the question list

Interpret the Analysis of Variance Table in two-way mixed effects model with equal number of observations in each cell.

2001 · Paper I · Q6iv · 15 marks

Solution

The table (A fixed with aa levels, B random with bb levels, nn per cell).

Source df E(MS) F
A (fixed) a−1a-1 σ2+nσAB2+bna−1∑αi2\sigma^2+n\sigma_{AB}^2+\frac{bn}{a-1}\sum\alpha_i^2 MSA/MSAB
B (random) b−1b-1 σ2+anσB2\sigma^2+an\sigma_B^2 MSB/MSE
AB (random) (a−1)(b−1)(a-1)(b-1) σ2+nσAB2\sigma^2+n\sigma_{AB}^2 MSAB/MSE
Error ab(n−1)ab(n-1) σ2\sigma^2

Interpretation.

  1. The error line estimates σ2\sigma^2, the variation between replicate observations in the same cell.
  2. The interaction line. A significant F=MSAB/MSEF=MSAB/MSE means σAB2>0\sigma_{AB}^2>0: 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 σ̂AB2=(MSAB−MSE)/n\hat\sigma_{AB}^2=(MSAB-MSE)/n.
  3. The fixed factor. Its mean square contains the interaction component, because the treatment means are averaged over only bb sampled levels of B. So A is tested against MSAB, with (a−1)(a-1) and (a−1)(b−1)(a-1)(b-1) 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 SE=2MSAB/(bn)SE=\sqrt{2MSAB/(bn)}.
  4. The random factor. A significant F=MSB/MSEF=MSB/MSE means the population of B levels is variable (σB2>0\sigma_B^2>0). We estimate σ̂B2=(MSB−MSE)/(an)\hat\sigma_B^2=(MSB-MSE)/(an). We do not compare individual levels of B, since they are of no interest in themselves.
  5. 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.
  6. 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 σAB2\sigma_{AB}^2 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.

↑ Back to the question list

Explain Fixed Effect and Mixed Effect models in two-way classification with examples.

2001 · Paper I · Q8i · 15 marks

Solution

Fixed effect model. All levels of both factors are chosen deliberately, and they are the only ones of interest. yijk=μ+αi+βj+(αβ)ij+eijk,y_{ijk}=\mu+\alpha_i+\beta_j+(\alpha\beta)_{ij}+e_{ijk}, with ∑αi=∑βj=0\sum\alpha_i=\sum\beta_j=0, ∑i(αβ)ij=∑j(αβ)ij=0\sum_i(\alpha\beta)_{ij}=\sum_j(\alpha\beta)_{ij}=0 and eijk∼N(0,σ2)e_{ijk}\sim N(0,\sigma^2) independent. The αi\alpha_i, βj\beta_j and (αβ)ij(\alpha\beta)_{ij} are unknown constants.

  • Hypotheses: αi=0\alpha_i=0 for all ii; βj=0\beta_j=0 for all jj; (αβ)ij=0(\alpha\beta)_{ij}=0 for all i,ji,j.
  • 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. yijk=μ+αi+bj+(αb)ij+eijk,y_{ijk}=\mu+\alpha_i+b_j+(\alpha b)_{ij}+e_{ijk}, with ∑αi=0\sum\alpha_i=0; bj∼N(0,σb2)b_j\sim N(0,\sigma_b^2); (αb)ij(\alpha b)_{ij} random with variance a−1aσαb2\frac{a-1}{a}\sigma_{\alpha b}^2 and ∑i(αb)ij=0\sum_i(\alpha b)_{ij}=0; eijk∼N(0,σ2)e_{ijk}\sim N(0,\sigma^2); all random terms independent.

  • Hypotheses: αi=0\alpha_i=0 for all ii (fixed); σb2=0\sigma_b^2=0; σαb2=0\sigma_{\alpha b}^2=0.
  • 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 σb2\sigma_b^2
Test for A MSA/MSE MSA/MSAB
Observations in the same level of B Independent Correlated (they share bjb_j)

✓ Answer checked step by step Every point was checked: the fixed and mixed two-way models with their assumptions, examples and the resulting tests.

↑ Back to the question list

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.

2000 · Paper I · Q8a · 20 marks

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 (aa levels), B random (bb levels) and nn observations per cell: yijk=μ+αi+bj+(αb)ij+eijk,y_{ijk}=\mu+\alpha_i+b_j+(\alpha b)_{ij}+e_{ijk},

  • ∑iαi=0\sum_i\alpha_i=0;
  • bj∼N(0,σb2)b_j\sim N(0,\sigma_b^2);
  • (αb)ij∼N(0,a−1aσαb2)(\alpha b)_{ij}\sim N\left(0,\frac{a-1}{a}\sigma_{\alpha b}^2\right), with ∑i(αb)ij=0\sum_i(\alpha b)_{ij}=0;
  • eijk∼N(0,σ2)e_{ijk}\sim N(0,\sigma^2);
  • the random terms are independent.

Hypotheses.

  1. Fixed main effect: H0A:α1=…=αa=0H_{0A}:\alpha_1=\dots=\alpha_a=0 against “not all zero”.
  2. Random main effect: H0B:σb2=0H_{0B}:\sigma_b^2=0 against σb2>0\sigma_b^2>0.
  3. Interaction: H0AB:σαb2=0H_{0AB}:\sigma_{\alpha b}^2=0 against σαb2>0\sigma_{\alpha b}^2>0.

The hypotheses about random effects concern variances, not individual effects.

How they are tested. Compute the usual sums of squares and mean squares: SSA=bn∑(y‾i..−y‾)2,SSB=an∑(y‾.j.−y‾)2,SSAB=n∑∑(y‾ij.−y‾i..−y‾.j.+y‾)2,SSE=∑∑∑(yijk−y‾ij.)2.SSA=bn\sum(\bar y_{i..}-\bar y)^2,\quad SSB=an\sum(\bar y_{.j.}-\bar y)^2,\quad SSAB=n\sum\sum(\bar y_{ij.}-\bar y_{i..}-\bar y_{.j.}+\bar y)^2,\quad SSE=\sum\sum\sum(y_{ijk}-\bar y_{ij.})^2 . The expected mean squares decide the denominators.

Source E(MS) Test statistic Distribution under H0H_0
A σ2+nσαb2+bn∑αi2a−1\sigma^2+n\sigma_{\alpha b}^2+\frac{bn\sum\alpha_i^2}{a-1} FA=F_A= MSA/MSAB Fa−1,(a−1)(b−1)F_{a-1,(a-1)(b-1)}
B σ2+anσb2\sigma^2+an\sigma_b^2 FB=F_B= MSB/MSE Fb−1,ab(n−1)F_{b-1,ab(n-1)}
AB σ2+nσαb2\sigma^2+n\sigma_{\alpha b}^2 FAB=F_{AB}= MSAB/MSE F(a−1)(b−1),ab(n−1)F_{(a-1)(b-1),ab(n-1)}
Error σ2\sigma^2

Each hypothesis is rejected at level α\alpha if its F exceeds the upper α\alpha 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 σαb2\sigma_{\alpha b}^2 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.

↑ Back to the question list

More on Sampling Theory and Design of Experiments

Questions: UPSC Civil Services (Main) Examination, Statistics Paper I, 2000–2026. Solutions: Optional Province. Found an error? Tell us.

Spotted an error? Tell us.

We classify every PYQ with care, but mistakes can slip in. If a question is in the wrong topic, has a typo, the wrong year, or is missing, let us know. We review every report and update the page.

Report an Error
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted