Code covered by the BSD License  

Highlights from
plotstats

Be the first to rate this file! 6 Downloads (last 30 days) File Size: 7.6 KB File ID: #19001
image thumbnail

plotstats

by Jean-Yves Tinevez

 

02 Mar 2008 (Updated 11 Feb 2009)

PLOTSTATS Format and plot data for basic statitical analysis.

| Watch this File

File Information
Description

PLOTSTATS(XDATA,YDATA) generate a nice figure for the statistical visualisation of datasets. YDATA is a cell array of vectors, each vector being a group of samples to test. XDATA is a cell array of the same size of YDATA, each element being a single number representing the abscissa of the corresponding sample group in YDATA. XDATA can be omitted. Example:
 ydata = {
   [ 1 2 3 4 5 6 7 8 9 ]
   [ 2 3 4 5 ]
   10*rand(10,1) };
 xdata = {
   1
   2
   3 };
 ydata
 ydata =
     [ 1x9 double]
     [ 1x4 double]
     [10x1 double]
 xdata
 xdata =
     [1]
     [2]
     [3]
 plotstats(xdata,ydata)
 
With this default syntax, the command generate a 2-panel figure. The first one containing the raw data plot, the second one the box plot.
It is possible to extensively customize the generated plot. See inline help for details.

--------
EXAMPLES
--------

% Basic plot
x = {1 2 4};
y={ rand(50,1), rand(50,1), 0.7 + 0.5*rand(100,1)};
plotstats(x,y)

% With everything, outliers and fit (default is straight line)
x = {10 5 20};
y={ 2*rand(50,1), rand(50,1), [2.1 + 0.8*rand(100,1)' 0.2 0.25 0.1]};
labels = {'medium' 'low' 'high'};
fitopt.DoFit = true; % option structure for the fit panel
plotstats(x,y,'SeriesLabels',labels,'PlotHistogram',true,'PlotFit',true,'PlotFitOptions',fitopt)

% With no graphical output and a output argument, one can get only the result struct:
x = {10 5 20};
y={ 2*rand(50,1), rand(50,1), [2.1 + 0.8*rand(100,1)' 0.2 0.25 0.1]};
labels = {'medium' 'low' 'high'};
fitopt.DoFit = true; % option structure for the fit panel
S = plotstats(x,y,'SeriesLabels',labels,'PlotRawData',false,'PlotBox',false,'PlotFitOptions',fitopt)

Required Products Curve Fitting Toolbox
Statistics Toolbox
MATLAB release MATLAB 7.5 (R2007b)
Other requirements checkfield.m that can be found in the FEX (ID: 17441), used to check varargin content.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
03 Mar 2008

Description corrected.

11 Feb 2009

Added an option to omit XDATA

Tag Activity for this File
Tag Applied By Date/Time
specialized Jean-Yves Tinevez 22 Oct 2008 09:51:12
plotting Jean-Yves Tinevez 22 Oct 2008 09:51:12
statistic plot Jean-Yves Tinevez 22 Oct 2008 09:51:12
stats Jean-Yves Tinevez 22 Oct 2008 09:51:12
graphics Jean-Yves Tinevez 22 Oct 2008 09:51:12
data sets Jean-Yves Tinevez 22 Oct 2008 09:51:12
visualization Jean-Yves Tinevez 22 Oct 2008 09:51:12
probability Cristina McIntire 07 Nov 2008 11:40:17
nominal Paul Martin 20 Mar 2009 02:04:55

Contact us at files@mathworks.com