edit on PAPER OF STA WORKED ON MY MATH LAB
GROUPED DATA
MAGED AYAD
Contents
Numerical Summary
[Mean, SD, N, Skew, Kurtosis] = grpstats(time, [],{'mean', 'std', 'numel', @skewness, @kurtosis} );
disp( table(Mean, SD, N, Skew, Kurtosis) )
Mean SD N Skew Kurtosis
______ ______ __ ______ ________
122.08 98.064 60 0.5146 2.0764
Histogram
hist(time, ceil(sqrt(length(time))) )
hold on
title('PILLBUG time')
xlabel('time (months)')
ylabel('frequency')
hold off
Smoothed Histogram
ksdensity(time)
hold on
title('PILLBUG TIME')
xlabel('PILLBUG (months)')
ylabel('frequency')
hold off
numerical summary
Show the group name, its mean, standard deviation, sample size, and standard error.
[D, Mean, SD, N, SE] = grpstats(time, group,{'gname', 'mean', 'std', 'numel', 'sem'});
Condition = char(D);
disp( table(Condition, Mean, SD, N, SE) )
Condition Mean SD N SE
_________ _____ ______ __ ______
Light 23.55 12.292 20 2.7487
Moisture 169.2 83.538 20 18.68
Control 173.5 85.981 20 19.226
Boxplot
boxplot(time, group)
hold on
ylabel('time (months)')
hold off
Smoothed Histograms
d = unique(group);
for i = 1:length(d)
[fx, xx] = ksdensity(time(ismember(group, {d{i}})));
subplot(1,3,i)
plot(xx, fx, '--')
title(d{i})
xlim([-500 500])
ylim([0 0.03])
end
hold off