Code covered by the BSD License  

Highlights from
Pooled mean and standard deviation

Be the first to rate this file! 15 Downloads (last 30 days) File Size: 1.53 KB File ID: #37233 Version: 1.10
image thumbnail

Pooled mean and standard deviation


R P (view profile)


19 Jun 2012 (Updated )

Calculate pooled N, mean and STD (using, as inputs, subgroups N, mean and STD)

| Watch this File

File Information

Calculate pooled n, mean and std from n, mean and std of two groups
 (to calculate it to N groups (N>2), repeat it N-1 times)
[npool,meanpool,stdpool] = pooledmeanstd(n1,mean1,std1,n2,mean2,std2)

based on


    sample1 = randi(100,n1,1);
    mean1= mean(sample1);
    std1= std(sample1);
    sample2 = randi(100,n2,1);
    mean2= mean(sample2);
    std2= std(sample2);
    sample3 = randi(100,n3,1);
    mean3= mean(sample3);
    std3= std(sample3);
    meanpool_real= mean(pool_sample);
    stdpool_real= std(pool_sample);

    [npooltemp,meanpooltemp,stdpooltemp] = pooledmeanstd(n1,mean1,std1,n2,mean2,std2);
    [npool_estimated,meanpool_estimated,stdpool_estimated] = pooledmeanstd(npooltemp,meanpooltemp,stdpooltemp,n3,mean3,std3);

    disp(['meanpool_real=',num2str(meanpool_real),' meanpool_estimated=',num2str(meanpool_estimated)])
    disp(['stdpool_real=',num2str(stdpool_real),' stdpool_estimated=',num2str(stdpool_estimated)])

MATLAB release MATLAB 6.5 (R13)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
20 Jun 2012 1.1


10 Dec 2012 1.5

included line % downloaded from

15 Jul 2013 1.9

Inclusion of screenshot. No updates were done in the function.

12 Aug 2014 1.10

General information summary updated

Contact us