t> The Statistics Package
b>
t> This section gives a brief overview of Maple's facilities for 
t> statistical computation.  While there are many other packages in 
t> the Maple library that you may use more frequently, there are details 
t> about how the stats package is set up that need to be aired.
b>
c1>
t> The Multi-leveled package
b>
t> Currently, the stats package is the only Maple package that contains 
t> multiple levels of commands. To demonstrate what this means, lets load 
t> in the package the way we would any other. 
b>
x> with(stats);
c1>
t> All of these "commands" that you see here (with the exception of 
t> importdata) are actually subpackages of the stats package and need to 
t> be loaded in with the "with" command as well. For example, the describe 
t> subpackage, which contains descriptive data analysis commands, is loaded 
t> in with the following command. (But with(stats) must have been entered 
t> first.)
b>
x> with(describe);
c1>
t> Once the commands have been loaded as above, they are accessed in the 
t> standard manner. Let's have a look at some of the more common 
t> descriptive functions. 
b>
x> mean([92,34,55,67,80,92,50,44,87,71]);
x> median([92,34,55,67,80,92,50,44,87,71]);
x> mode([92,34,55,67,80,92,50,44,87,71]);
c1>
t> As you can see, the standard input to a statistical command is a list of 
t> values, or a statistical list. Apart from simple numeric values, 
t> statistical lists can also contain ranges (e.g., 27..50 represents a 
t> single value in the range 27 through 50) and weighted elements 
t> (e.g., Weight(60, 4) represents four values of 60). Weights and 
t> ranges can be combined, as well.
b>
t> As an example, here is a more complicated statistical list.
b>
x> slist := [25, 97, 50..55, Weight(60, 5), 44, Weight(80..89, 3)];
c1>
t> And here are some more complicated commands working upon that statistical 
t> list.
b>
x> variance(slist);
x> standarddeviation(slist);
x> harmonicmean(slist);
c1>
t> Another interesting feature of many of the statistics routines is that 
t> they can be indexed by specific values to alter the operation of the 
t> command proper. For example, in the command decile, the particular 
t> decile desired (1 through 9) is specified before the parameter sequence.
b>
c1>
x> decile[5](slist);
x> decile[9](slist);
x> decile[2](slist);
c1>
t> The other subpackages deal with different areas of statistics and aren't 
t> covered directly in this tutorial. One exception is the statplots 
t> subpackage which is detailed next.
b>
c1>
t> The statplots Subpackage
b>
t> The statplots subpackage contains many useful plotting routines for 
t> analysing statistical data. Box plots, histograms, and one- and 
t> two-dimensional scatter plots are available. 
b>
x> with(statplots);
c1>
t> Following is a larger set of data for a test out of 10, and a few examples
t> of the available plotting commands acting on that data.
b>
c1>
x> testdata := [1,4,8,5,6,9,3,6,5,0,3,10,10,5,6,5,8,7,9,9,9,5,6,2,7,1,10]
c1>
x> scatter1d[jittered](testdata);
c1>
x> boxplot(testdata);
c1>
t> Questions
b>
c2>
q> Create a histogram of the data in testdata (given above).
q> Don't close the plot window right away, you'll need it for the next 
q> question. 
a> histogram(testdata);
c2>
q> From the histogram created in the previous question, can you tell what the 
q> mode of the test results is? Verify your answer using the mode command.
a> mode(testdata);
eoq>
h> testdata := 'testdata';
h> slist := 'slist';
eof>
