필터 지우기
필터 지우기

Descriptive Statistics Function for a Dataset Array

조회 수: 2 (최근 30일)
Diego
Diego 2012년 12월 4일
Dear all,
Is there a single function that returns the basic descriptive statistics from a dataset array?
Something like the summary function but more complete
Thanks in advance,
Diego

채택된 답변

Peter Perkins
Peter Perkins 2012년 12월 4일
Diego, the grpstats function ordinarily works on groups within data, but it will compute summary stats on complete variables as well if you pass in [] as the grouping variable. Hope this helps.
  댓글 수: 1
Diego
Diego 2012년 12월 5일
Thank you Peter.
It works!
Best Regards,
Diego

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Teja Muppirala
Teja Muppirala 2012년 12월 4일
Perhaps you could write a simple routine using the DATASETFUN function to calculate all the stats you wanted?
For example:
% Just a sample dataset
DS = cell2dataset([{'Bill' 'Jane' 'Mark' 'Mary'}; num2cell(rand(6,4))])
% Calculate the stats you want
stats = datasetfun(@(x) [mean(x); min(x); max(x); std(x)],DS,'Uniform',0);
% Now display the result in a a new dataset
myStats = dataset(stats{:},'VarNames',get(DS,'VarNames'),'ObsNames',{'Mean' 'Min' 'Max' 'St Dev.'});
disp(myStats);
  댓글 수: 1
Diego
Diego 2012년 12월 4일
Thank you Teja,
Yes you're right. But I was wondering if there is a built in function that do the same, like in other packages including SPSS and Excel.
Regards,
Diego

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Large Files and Big Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by