Summary statistics by group.
MEANS = nan_grpstats(X,groups) nan_grpstats(X,groups,ALPHA) displays a plot of the means versus index with 100(1 - ALPHA)% confidence intervals around each mean. [MEANS,SEM,COUNTS,GNAME] = nan_grpstats(X,groups) [A,B,...] = nan_grpstats(X,groups,whichstats) [...] = nan_grpstats(X,groups,whichstats,ALPHA)
matrix of observations
grouping variable defined as a vector, string array, or list of strings.
means of each column of X by groups
standard error of the mean
number of elements in each group
name of each group
specifies the confidence level as 100(1-ALPHA)% for the 'meanci' and 'predci' options.
a list of single function handles or names (strings)
mean
standard error of the mean
count, or number of elements
group name
standard deviation
variance
minimum
maximum
maximum - minimum
95% confidence interval for the mean
95% prediction interval for a new observation
statistics specified by whichstats, The number of outputs [A,B,...] must match the number function handles and names in whichstats.
nan_grpstats computes groupwise summary statistics, for data in a matrix or dataset array.
nan_grpstats treats NaNs as missing values, and removes them.
Functions in whichstats must accept a matrix and give out one values for each columns.
loadmatfile("demos/data/iris.mat"); [m,p,g] = nan_grpstats(meas,species,list('mean','predci','gname')) n = size(m,1) plot2d((1:n)',m) nan_errorbar(ones(1,4) .*. (1:n)',m,p(:,:,2)-m,p(:,:,2)-m) h=gca(); h.data_bounds(:,1)=[0.9;3.1]; title('95% prediction intervals for mean iris size by species') scf() nan_grpstats(meas,species,0.05)