Xlisp-Stat
Startup
Xlisp-Stat is available (for free) for MSWindows, Mac, or
X-windows.
Xlispstat is not currently installed on our Solaris machines.
Cute plots and linking
Xlispstat does a very nice job with interactive plots and linking
particular points in different plots. To run the demos below, first
load the tutorial.lsp data. On PC or Mac choose load from the file
menu, go to the Data directory (c:\wxls\Data on PC) and double click
on tutorial.lsp. Other loads below are similar. On gauss
type (load "/opt/local/R/xlispstat/Data/tutorial.lsp").
Interaction To see what different transformations actually
look like run the bcdemo. On PC and Mac this is in the
Examples directory, use file menu load as above. On unix machines
type (load "/opt/local/R/xlispstat/Examples/bcdemo").
You will see a plot and a slider. Click on the left and right slider
arrows to change the power of transformation. How close to a straight
line can you get?
Another interactive demo lets you move points around in a
scatterplot and see what happens to the regression line. It's also in
the examples directory under regdemo.lsp. Unix users type
(load "/opt/local/R/xlispstat/Examples/regdemo.lsp").
Brushing and linking:
Run the abrasion demo to see how brushing works. On PC it's
abrasion.lsp in the Examples directory. On unix type
(load "/opt/local/R/xlispstat/Examples/abrasiondemo.lsp")
Two plots will pop up, move the top one over so you can see both
plots. In the scatterplot matrix, use the mouse to highlight some
points. Note how the points are highlighted in each scatterplot. From
the scatterplot menu choose "Link View". Click on the spinplot and
notice the menu changes. Choose "Link View" from the spinplot menu,
also. Now selecting points in one window will select them in all
windows.
Rotating plots: In the Spin plot window opened above, click
on one of the small squares at the bottom. Notice the plot turns. If
you hold down shift and click, it will keep turning until you click a
square again. Try to get the "A" for abrasion loss axis vertical and
rotate till the points form a line (Plane really, but we're looking from
the side). You will notice that the points change size. Points closer
to us appear larger. Load addhandr.lsp (addhandrotate on
Macs and unix) from the Examples directory. Under the plot menu you
will now have another choice for "Mouse Mode" called hand rotate. It
lets you "grab" the 3D plot and move it around.
Xlispstat packages
People are using XlispStat to make some really nice, user
friendly packages.
Examples:
- R-code, from
Cook and Weisberg's An Introduction to Regression Graphics
, is a very nice set of functions to do regression diagnostics.
- Vista,
Visual Statistics System, is supposed to be good for visualizing the
modeling process. It's written by Forrest Young of UNC.
- RXridge by Bob Obenchain
does Ridge Regression.
XlispStat commands:
Xlisp-Stat is an object-oriented stat package built on Lisp which does
many of the things that Splus does. One disadvantage in learning
Xlisp-Stat is that it requires lots and lots of parentheses.
The function format is parenthesis enclosing the function name
followed by the arguments, eg:
> (+ 2 5 7 9)
> (def k 5)
The + or sum function returns the sum of the 4 numbers.
The def function defines k to have value 5.
Help
To get help, put help and a function name preceded by a single apostrophe.
> (help 'read-data-columns)
or if you don't know the specific function, use
help* to get a list of all functions which have a particular
word in their help message.
(help* 'normal)
gives a list of all functions which relate to the normal
distribution.
Example Now to read in the data created previously with
emacs,
\begin{verbatim}
> (def tires (read-data-columns "tires.data"))
The variable name is printed to show that it was
defined. Now we define the three variables we need by "selecting"
the appropriate columns. Note that Lisp starts numbering with 0, not
1.
> (def hardness (select tires 0))
> (def tensile-strength (select tires 1))
> (def abrasion-loss (select tires 2))
We can get a matrix of scatterplots as in Splus with these commands:
> (scatterplot-matrix
(list hardness tensile-strength abrasion-loss)
:variable-labels
(list "Hardness" "Tensile Strength" "Abrasion Loss"))
To print the plot, use the plot menu to save it into a file, then
print the file (in Unix, outside of Xlisp--Stat) using lpr. This
package also does some nice spinning plots which I haven't seen
elsewhere.
> (spin-plot
(list hardness tensile-strength abrasion-loss)
:title "Abrasion Loss Data"
:variable-labels (list "Hardness" "Tensile Strength" "Abrasion Loss"))
You can click on Pitch, Roll, Yaw buttons to make it move a little, or
Shift-Click to make it keep spinning. Notice that the nearer points
are larger than those behind.
To do the regression of abrasion loss on the other two variables,
type:
> (def tire-fit (regression-model
(list hardness tensile-strength) abrasion-loss))
We again plot the residuals versus the fitted values.
> (send tire-fit :help :plot-residuals)
> (send tire-fit :plot-residuals )
We can plot the abrasion loss over the 2 explanatory variables and
link the plots together. By ``brushing'' (select points in one plot,
look where they are in the other plots) we can see where large or
small residuals come from.
> (plot-points hardness abrasion-loss)
> (plot-points tensile-strength abrasion-loss)
Exiting To exit Xlisp--Stat, use the function exit (in parentheses).
Information about
unix and
emacs.
Other Stat package demos for unix packages:
Back to MSU Math Department Home Page
Author: Jim Robison-Cox
Last Updated: November 2, 1995