Descriptive Statistics Function for a Dataset Array

2 次查看(过去 30 天)
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 个)

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 中查找有关 Hypothesis Tests 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by