Maths4UBETA

Weighted means and combined moments

Combine at most two data sets through compatible totals, keeping within-group and between-group spread distinct.

Try the quick check →
Lesson 4 of 5

Section 1 of 5 · Core · about 5 min

How do I combine two group means?

Pooling puts two groups of records into one list. The groups must be disjoint: do not count the same record twice, although different records may have equal values. The measurements must describe the same quantity in compatible units.

Let the positive group sizes be nA,nBn_A,n_B, their means be μA,μB\mu_A,\mu_B, and the combined mean be μ\mu. Recover each total first:

TA=nAμA,TB=nBμB.T_A=n_A\mu_A,\qquad T_B=n_B\mu_B.N=nA+nB,μ=nAμA+nBμBN.N=n_A+n_B,\qquad\mu=\frac{n_A\mu_A+n_B\mu_B}{N}.

Group A is centred at 12 and group B at 17. The pooled mean of 15 is closer to B.

GroupRecords (cm)CountMean (cm)Total (cm)
A9, 9, 15, 1541248
B15, 15, 15, 19, 19, 19617102
xˉpooled=4(12)+6(17)4+6=15010=15 cm.\bar x_{\mathrm{pooled}}=\frac{4(12)+6(17)}{4+6}=\frac{150}{10}=15\,\mathrm{cm}.4(15−12)=6(17−15)⟺4(3)=6(2).4(15-12)=6(17-15)\qquad\Longleftrightarrow\qquad4(3)=6(2).

The pooled mean is closer to B’s mean because six of the ten records belong to B.

Four records with mean 12 cm12\,\mathrm{cm} and six with mean 17 cm17\,\mathrm{cm} have combined mean 15 cm15\,\mathrm{cm}.

Worked example

Restore totals before combining means

Group A contains four plant heights with mean 12 cm12\,\mathrm{cm}. Group B contains six other plant heights with mean 17 cm17\,\mathrm{cm}. Find the mean height of all ten plants.

  1. TA=4(12)=48 cm,TB=6(17)=102 cm.T_A=4(12)=48\,\mathrm{cm},\qquad T_B=6(17)=102\,\mathrm{cm}.
  2. N=4+6=10,T=48+102=150 cm.N=4+6=10,\qquad T=48+102=150\,\mathrm{cm}.
  3. μ=15010=15 cm.\mu=\frac{150}{10}=15\,\mathrm{cm}.
  4. The simple average 12+172=14.5\frac{12+17}{2}=14.5 gives each group equal weight. Here the larger group must contribute more records, so the correct mean is closer to 1717 than to 1212.

Your turn

Two disjoint groups took the same test. Group A contains three scores with mean 1010; group B contains seven scores with mean 2020. Find the combined mean score. Separately, two other disjoint groups contain two and five scores, but both have mean 1616. Find their combined mean.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Counts, means and variances do not generally determine the combined median or mode. Those depend on how the individual values are arranged and repeated. Pooling also differs from forming pairwise sums: the original observations remain separate records.

Section 2 of 5 · Core · about 7 min

How do I combine variances and standard deviations?

For one group, write its count as nn, total as T=∑xT=\sum x, and sum of squares as Q=∑x2Q=\sum x^2. Its descriptive variance uses divisor nn:

μ=Tn,σ2=Qn−μ2,σ=σ2.\mu=\frac{T}{n},\qquad\sigma^2=\frac{Q}{n}-\mu^2,\qquad\sigma=\sqrt{\sigma^2}.

Rearranging gives the quantities that can be added across groups:

T=nμ,Q=n(σ2+μ2).T=n\mu,\qquad Q=n(\sigma^2+\mu^2).

Add counts, totals and sums of squares separately. Then calculate the combined summaries from

N=nA+nB,T=TA+TB,Q=QA+QB,N=n_A+n_B,\quad T=T_A+T_B,\quad Q=Q_A+Q_B,μ=TN,σ2=QN−μ2.\mu=\frac{T}{N},\qquad\sigma^2=\frac{Q}{N}-\mu^2.

Worked example

Combine mean and SD through three totals

Two disjoint groups of plant heights are summarised below. Find the combined descriptive variance and standard deviation.

GroupCountMean in centimetresSD in centimetres
A44121233
B66171722
  1. Square the SDs, then recover each sum of squares:

    QA=4(32+122)=612,QB=6(22+172)=1758.Q_A=4(3^2+12^2)=612,\qquad Q_B=6(2^2+17^2)=1758.
  2. GroupCount nnTotal TTSum of squares QQ
    A444848612612
    B6610210217581758
    Combined101015015023702370

    The totals use centimetres and the sums of squares use squared centimetres.

  3. μ=15010=15 cm.\mu=\frac{150}{10}=15\,\mathrm{cm}.
  4. σ2=237010−152=12 cm2,σ=23 cm.\sigma^2=\frac{2370}{10}-15^2=12\,\mathrm{cm}^2,\qquad\sigma=2\sqrt{3}\,\mathrm{cm}.
  5. Neither the simple average nor the size-weighted average of the two SDs gives this result. The group means are different, which creates additional spread.

Your turn

Two disjoint groups of lengths use centimetres. A contains two observations with mean 4 cm4\,\mathrm{cm} and descriptive SD 1 cm1\,\mathrm{cm}. B contains three observations with mean 9 cm9\,\mathrm{cm} and descriptive SD 2 cm2\,\mathrm{cm}. Find the combined sum of squares, mean, variance and SD.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact value or round to 3 significant figures.

Enter an exact value or round to 3 significant figures.

The same method works backwards: subtract a known group’s count, total and sum of squares from the combined quantities to recover the other group. Its recovered count must be positive, and its variance must be non-negative. A negative variance indicates inconsistent information or an arithmetic error.

Section 3 of 5 · Core · about 6 min

Why can combining groups increase spread?

There are two sources of variation: differences within each group, and the gap between the group centres. For two nonempty groups, the combined variance splits into

Vwithin=nAσA2+nBσB2N,V_{\mathrm{within}}=\frac{n_A\sigma_A^2+n_B\sigma_B^2}{N},Vbetween=nA(μA−μ)2+nB(μB−μ)2N,V_{\mathrm{between}}=\frac{n_A(\mu_A-\mu)^2+n_B(\mu_B-\mu)^2}{N},σ2=Vwithin+Vbetween.\sigma^2=V_{\mathrm{within}}+V_{\mathrm{between}}.

For two groups, the between-group part also simplifies to

Vbetween=nAnBN2(μA−μB)2.V_{\mathrm{between}}=\frac{n_A n_B}{N^2}(\mu_A-\mu_B)^2.

This decomposition follows by writing each deviation from the combined mean as its deviation from its own group mean plus the difference between the means. Within each group, deviations from that group’s mean sum to zero.

Both bars have within-group variance six. Only the separated means add between-group variance six.

The group sizes are 44 and 66, population variances 99 and 44, and pooled mean 1515 centimetres.

W=410(9)+610(4)=6.W=\frac4{10}(9)+\frac6{10}(4)=6.B=410(12−15)2+610(17−15)2=6.B=\frac4{10}(12-15)^2+\frac6{10}(17-15)^2=6.σpooled2=W+B=12 cm2,σpooled=23 cm.\sigma_{\mathrm{pooled}}^2=W+B=12\,\mathrm{cm}^2,\qquad\sigma_{\mathrm{pooled}}=2\sqrt3\,\mathrm{cm}.

Subtracting 55 centimetres from every B observation preserves B’s variance and moves both group means to 1212. Their between-group contribution is then zero.

The weighted within-group variance is 6 cm26\,\mathrm{cm}^2; separation of the group means adds another 6 cm26\,\mathrm{cm}^2.

Worked example

Separate internal spread from different centres

Two disjoint groups have counts 4,64,6, means 12,17 cm12,17\,\mathrm{cm}, and descriptive variances 9,4 cm29,4\,\mathrm{cm}^2, respectively. Separate the combined variance into within-group and between-group contributions. Then translate every record in B down by 5 cm5\,\mathrm{cm} and find the new combined variance.

  1. μ=4(12)+6(17)10=15 cm.\mu=\frac{4(12)+6(17)}{10}=15\,\mathrm{cm}.
  2. Vwithin=4(9)+6(4)10=6 cm2.V_{\mathrm{within}}=\frac{4(9)+6(4)}{10}=6\,\mathrm{cm}^2.
  3. Vbetween=4(12−15)2+6(17−15)210=6 cm2.V_{\mathrm{between}}=\frac{4(12-15)^2+6(17-15)^2}{10}=6\,\mathrm{cm}^2.
  4. σ2=6+6=12 cm2.\sigma^2=6+6=12\,\mathrm{cm}^2.
  5. After translating B, both means are 12 cm12\,\mathrm{cm}. Translation leaves B’s internal variance unchanged. The between-group contribution becomes zero, so the new combined variance is 6 cm26\,\mathrm{cm}^2.

Your turn

Group A contains three lengths, all 5 cm5\,\mathrm{cm}. Group B contains three different records, all 11 cm11\,\mathrm{cm}. Calculate the within-group contribution, between-group contribution and total descriptive variance of the six pooled records.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

When group means are equal, the between-group part is zero, so a size-weighted average of their variances is enough. Equal counts alone do not remove the effect of different means. With counts and internal variances fixed, moving the means farther apart increases the combined variance.

Section 4 of 5 · Core · about 5 min

Can a target mean determine the group size?

If B has unknown positive integer size kk and the required combined mean is mm, write

nAμA+kμB=m(nA+k).n_A\mu_A+k\mu_B=m(n_A+k).

Solve and check the integer and positivity conditions. With different group means and both groups nonempty, the combined mean lies strictly between them. That is a necessary check; it does not guarantee an integer group size.

Worked example

Recover a positive integer group size

Group A contains five measurements with mean 8 cm8\,\mathrm{cm}. Group B contains kk other measurement records with mean 14 cm14\,\mathrm{cm}. The combined mean is 12 cm12\,\mathrm{cm}. Find kk, which must be a positive integer.

  1. T=5(8)+14k=40+14k,N=5+k.T=5(8)+14k=40+14k,\qquad N=5+k.
  2. 40+14k=12(5+k)⟹2k=20⟹k=10.40+14k=12(5+k)\Longrightarrow2k=20\Longrightarrow k=10.
  3. The answer is a positive integer. Check it in the original combined mean:

    5(8)+10(14)5+10=18015=12 cm.\frac{5(8)+10(14)}{5+10}=\frac{180}{15}=12\,\mathrm{cm}.
  4. The target lies strictly between 88 and 1414, as it must when both groups are nonempty and their means differ.

Your turn

A contains six measurements with mean 9 cm9\,\mathrm{cm}. B contains kk other measurement records with mean 16 cm16\,\mathrm{cm}, where kk is a positive integer. Find kk when the combined mean is 13 cm13\,\mathrm{cm}. Could the same setup instead give an exact combined mean of 12 cm12\,\mathrm{cm}?

Enter an exact number, for example 3/2 or 2-sqrt(3).

Can the target be exactly 12 cm12\,\mathrm{cm}?

Section 5 of 5 · Further applications · about 7 min

What if the groups use different codes or units?

Restore each group to the same original scale before pooling. For a code u=x−abu=\frac{x-a}{b}, where b≠0b\ne0, write x=a+bux=a+bu. From coded totals,

uˉ=∑un,σu2=∑u2n−uˉ 2.\bar{u}=\frac{\sum u}{n},\qquad\sigma_u^2=\frac{\sum u^2}{n}-\bar{u}^{\,2}.μx=a+buˉ,σx2=b2σu2,σx=∣b∣σu.\mu_x=a+b\bar{u},\qquad\sigma_x^2=b^2\sigma_u^2,\qquad\sigma_x=|b|\sigma_u.

Apply any unit conversion to the restored means and SDs, and its square to variances. Then form n,T,Qn,T,Q in one common unit. Different numerical codes cannot be treated as one shared measurement scale.

Worked example

Decode and convert before pooling

Two disjoint groups of lengths use different units and codes. Find the combined mean and descriptive variance in centimetres.

GroupCountOriginal unit and codeCoded summaries
A33xx in cm, u=x−202u=\frac{x-20}{2}∑u=3, ∑u2=5\sum u=3,\ \sum u^2=5
B22yy in mm, v=y−30020v=\frac{y-300}{20}∑v=−3, ∑v2=5\sum v=-3,\ \sum v^2=5
  1. For A, first calculate the coded mean and variance:

    uˉ=33=1,σu2=53−12=23.\bar{u}=\frac{3}{3}=1,\qquad \sigma_u^2=\frac{5}{3}-1^2=\frac{2}{3}.

    Using x=20+2ux=20+2u,

    μA=22 cm,σA2=22(23)=83 cm2.\mu_A=22\,\mathrm{cm},\qquad\sigma_A^2=2^2\left(\frac{2}{3}\right)=\frac{8}{3}\,\mathrm{cm}^2.
  2. For B,

    vˉ=−32,σv2=52−(−32)2=14.\bar{v}=-\frac{3}{2},\qquad\sigma_v^2=\frac{5}{2}-\left(-\frac{3}{2}\right)^2=\frac{1}{4}.

    Using y=300+20vy=300+20v,

    μB=270 mm,σB2=202(14)=100 mm2.\mu_B=270\,\mathrm{mm},\qquad\sigma_B^2=20^2\left(\frac{1}{4}\right)=100\,\mathrm{mm}^2.
  3. Convert B to centimetres. Dividing every length by 1010 divides variance by 100100:

    μB=27 cm,σB2=1 cm2.\mu_B=27\,\mathrm{cm},\qquad\sigma_B^2=1\,\mathrm{cm}^2.
  4. N=5,T=3(22)+2(27)=120 cm.N=5,\qquad T=3(22)+2(27)=120\,\mathrm{cm}.Q=3(83+222)+2(1+272)=2920 cm2.Q=3\left(\frac{8}{3}+22^2\right)+2(1+27^2)=2920\,\mathrm{cm}^2.
  5. μ=1205=24 cm,σ2=29205−242=8 cm2.\mu=\frac{120}{5}=24\,\mathrm{cm},\qquad\sigma^2=\frac{2920}{5}-24^2=8\,\mathrm{cm}^2.
  6. The two coded sums could not be added directly: their origins, scales and original units were different.

Your turn

Two disjoint groups record lengths xx, in centimetres. A has two observations coded by u=x−10u=x-10, with coded mean 22 and coded SD 22. B has two observations coded by v=30−x2v=\frac{30-x}{2}, with coded mean 33 and coded SD 11. Find the combined original mean, variance and SD.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact value or round to 3 significant figures.

Worked examples

Practise the method

Core practice

Question 1 of 4

0 / 4 checked in this collection

Question list

Core practice

Fresh variants

Exam-style

Weight group means by their sizes

3 marks

Group A has 3 observations with mean 12; B has 7 with mean 22. Give the combined count and mean, then choose why an unweighted average is inappropriate here.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Reason for weighting

Choose one option. Explain your reasoning on paper.

Full answer-format guide

Exact numbers: 3/2, sqrt(5), 2-sqrt(3), pi/6, 3*pi/2. Sets: {1,4}. Intervals: (3,5]; a round bracket excludes the endpoint. Infinity: inf; union: U; no solutions: empty. Separate coordinate pairs or triples with semicolons. Expressions: 2x^2+3x-1; equations: x^2=3x+1 or the polynomial equal to zero. Factors: x-1 ; x+2. Parameter fraction: numerator ; denominator. List integer answers individually.

Review the method

Progress stays in this browser. Create an account to save it or sign in.

Extra practice from this lesson

Weight each group by its count

Two disjoint groups record the same quantity in the same units. A has 55 observations with mean 1212; B has 1515 observations with mean 2020. Find the combined count and mean. Why would the unweighted average of the two means be inappropriate here?

Enter the value on its own or write n = … . Fractions and exact square roots are accepted.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Reason for weighting

Reconstruct both square-sums

Two disjoint groups of lengths, in centimetres, have these summaries.

GroupCountMean (cm)Descriptive SD (cm)
A472
B6123

Find the combined mean, descriptive variance and standard deviation.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact value or round to 3 significant figures.

Find a count and reject an endpoint target

Group A has 88 observations with mean 99. A disjoint group B has a positive integer number nn of observations with mean 1515. All measure the same quantity. The combined mean is 1313. Find nn. Separately, could any finite positive nn make the combined mean exactly 1515?

Enter the value on its own or write n = … . Fractions and exact square roots are accepted.

Is the separate target of fifteen attainable?

Decode both groups before pooling

Two disjoint groups contain lengths in centimetres. For A, nA=3n_A=3 and u=x−102u=\frac{x-10}{2}, with ∑u=3\sum u=3 and ∑u2=11\sum u^2=11. For B, nB=5n_B=5 and v=30−y2v=\frac{30-y}{2}, with ∑v=10\sum v=10 and ∑v2=30\sum v^2=30. Find each original total, then the combined mean and descriptive variance.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact value or round to 3 significant figures.

Enter an exact value or round to 3 significant figures.

Convert units before combining summaries

Two disjoint groups measure lengths. A has 44 observations with mean 160160 cm and descriptive SD 1010 cm. B has 66 observations with mean 1.81.8 m and descriptive SD 0.20.2 m. Find the combined mean, variance and standard deviation, using centimetres.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact value or round to 3 significant figures.

Apply it · original exam-style problems

Show your working on paper and compare it with the worked solution and marking guidance.

Start after this lesson

Recover a hidden group from pooled moments 7 marks

Ten masses have mean 1414 g and descriptive variance 30 g230\ \text{g}^{2}. They consist of disjoint groups A and B. A contains 66 masses with mean 1010 g and descriptive variance 4 g24\ \text{g}^{2}. Find B’s total, sum of squares, mean, variance and standard deviation.

Hint

Reconstruct the full count and both full totals, then subtract A’s contributions. Recalculate B’s summaries using its own count.

Worked solution
  1. N=10,T=10(14)=140,Q=10(30+142)=2260.N=10,\quad T=10(14)=140,\quad Q=10(30+14^2)=2260.
  2. nA=6,TA=6(10)=60,QA=6(4+102)=624.n_A=6,\quad T_A=6(10)=60,\quad Q_A=6(4+10^2)=624.
  3. nB=4,TB=140−60=80,QB=2260−624=1636.n_B=4,\quad T_B=140-60=80,\quad Q_B=2260-624=1636.
  4. xˉB=804=20 g,σB2=16364−202=9 g2,σB=3 g.\bar{x}_B=\frac{80}{4}=20\ \text{g},\quad\sigma_B^2=\frac{1636}{4}-20^2=9\ \text{g}^{2},\quad\sigma_B=3\ \text{g}.
  5. The recovered count is positive and the variance non-negative. Recombining the groups gives total 140140 g and square-sum 2260 g22260\ \text{g}^{2}, restoring both original combined summaries.

Marking guidance
  • 1 mark: reconstruct the combined first moment.
  • 1 mark: reconstruct the combined square-sum.
  • 1 mark: reconstruct A’s two moment totals.
  • 1 mark: subtract counts and both moment totals.
  • 1 mark: obtain B’s mean.
  • 1 mark: obtain B’s variance.
  • 1 mark: take the non-negative square root and check the reconstruction.
Zero spread inside each group can hide pooled spread 7 marks

Two disjoint score groups are combined. A contains four copies of score 66; B contains kk copies of score 1818, where kk is a positive integer. The combined mean is 1414. Find kk, the combined descriptive variance, standard deviation and median. Explain why the pooled variance is positive although each separate group has variance zero.

Hint

Recover the count from the mean equation. Then calculate squared distances from the combined mean, and locate both middle values in the complete ordered list.

Worked solution
  1. 4(6)+18k=14(4+k)⟹4k=32⟹k=8.4(6)+18k=14(4+k)\quad\Longrightarrow\quad4k=32\quad\Longrightarrow\quad k=8.
  2. N=12,σ2=4(6−14)2+8(18−14)212=256+12812=32.N=12,\qquad\sigma^2=\frac{4(6-14)^2+8(18-14)^2}{12}=\frac{256+128}{12}=32.
  3. σ=32=42.\sigma=\sqrt{32}=4\sqrt{2}.
  4. The sixth and seventh ordered observations are both 1818, so the combined median is 1818.

  5. Every value equals its own group mean, so the within-group contribution is zero. The positive variance comes entirely from the difference between the group centres.

Marking guidance
  • 1 mark: form the weighted-mean equation.
  • 1 mark: recover the positive integer count.
  • 1 mark: calculate squared distances from the combined mean.
  • 1 mark: divide by the full count to obtain the variance.
  • 1 mark: obtain the exact standard deviation.
  • 1 mark: locate both central observations and state the median.
  • 1 mark: explain the between-group source of spread.

Come back to what needs practice

Quick revision sheet (A4)

Your review plan starts after your first check.

Question bank and saved work