Pooled mean and standard deviation

버전 1.10.0.0 (1.53 KB) 작성자: R P
Calculate pooled N, mean and STD (using, as inputs, subgroups N, mean and STD)
다운로드 수: 959
업데이트 날짜: 2014/8/12

라이선스 보기

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 http://www.talkstats.com/showthread.php/7130-standard-deviation-of-multiple-sample-sets

Example:

n1=32;
sample1 = randi(100,n1,1);
mean1= mean(sample1);
std1= std(sample1);
n2=20;
sample2 = randi(100,n2,1);
mean2= mean(sample2);
std2= std(sample2);
n3=9;
sample3 = randi(100,n3,1);
mean3= mean(sample3);
std3= std(sample3);
pool_sample=[sample1;sample2;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)])

인용 양식

R P (2024). Pooled mean and standard deviation (https://www.mathworks.com/matlabcentral/fileexchange/37233-pooled-mean-and-standard-deviation), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R13
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Performance and Memory에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.10.0.0

General information summary updated

1.9.0.0

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

1.5.0.0

included line % downloaded from http://www.mathworks.com/matlabcentral/fileexchange/37233-pooled-mean-and-standard-deviation

1.1.0.0

*

1.0.0.0