Let m is a mean value of n data xi. Then be definition of the mean value:
m=n1∑i=1nxi then ∑i=1nxi=n∗m
So, for two samples of n1 and n2 data with mean values m1 and m2:
∑i=1n1+n2xi=∑i=1n1xi+∑i=n1+1n1+n2xi=n1∗m1+n2∗m2
And finaly
m=n1+n21∑i=1n1+n2xi=n1+n2n1∗m1+n2∗m2=10+510∗2.4+5∗2=2.27
Similarly for a standard deviation:
σ=n1∑i=1n1+n2(xi−m)2=n1(∑i=1n1+n2xi2−m2)=n∑i=1n1xi2+∑i=n1+1n1+n2xi2−m2
But
∑i=1n1xi2=n1∗(σ1+m12) and ∑i=n1+1n1+n2xi2=n2∗(σ2+m22) therefore
σ=n1+n2n1∗(σ1+m12)+n1∗(σ2+m22)=10+510∗(0.8+2.42)+5∗(1.2+22)−2.272=1565.6+26−5.14=0.97
Comments