When LISP-STAT comes up, it opens the Listener window. The listener is the part of the program that waits (listens) for your commands in order to evaluate them and produce results. The listener window - in addition to the commands you are typing and possible error messages - will receive all textual output. Only graphical commands open additional windows to contain the graph.
Everything you are typing in is an expression that is evaluated by the listener. There are very simple expression and compound expressions containing symbols, functions and lists.
A few commented examples should give you a general idea, whilst explaining a few additional things....
12
pi
(+ 10 20)
(histogram area)
(histogram (list 34 12 43 34 34 3 12 31 32 23 ))
, i.e.
the list of numbers directly with the command (more on lists below)
(histogram area :title "Area (km2)" )
(help 'histogram)
(apropos 'histo)
could be used to lookup any command or
option that contains the string "histo"; help* 'histo)
Is similar but produces more.
Please note that not everything the help facility
finds are actual functions that you can use. LISP-STAT is a full programming
environment with everything a sophisticated programmer needs.LISP-STAT has many built-in functions, but as we shall see later, it is very simple to add new functions. Below you will find some examples, that should speak for themselves.
(mean urb) (median urb) (standard-deviation infmor) (log infmor) (- (mean urb) (median urb))
The last expression being an easy check for symmetry of a variable, i.e. the difference between the mean and the median.
As LISP uses lists all the time: variables are lists of numbers; for instance in order to produce a parallel boxplot you gave a list of variables:
(boxplot (list urb infmor)) (boxplot (list (list 10 11 20 30 21 2)(list 5 4 3 1 2 6)))
in fact you could also have written the second form, i.e. writing out the data as two distinct lists, combined into a single list.
It is useful to know that you can define lists, using the def
function.
(def myfirstvariable (list 12 21 3 32 23 4 34 43 34 34 23 23))
creates the variable myfirstvariable
you might use as in:
(histogram myfirstvariable)
which of course - in this example - is the same as writing
(histogram (list 12 21 3 32 23 4 34 43 34 34 23 23))
This can also be used to create lists of lists. In fact you could write
(def twovars (list urb infmor)) (boxplot twovars)
instead of
(boxplot (list urb infmor))
If you intend to use these variables quite often in that combination it would be much easier to define a list and then use the name of the list.
Please note for later, that entering data into LISP-STAT is defining a list for each variable; to define a data matrix would mean to create a list containing all lists of individual variables.
If you mistype a command or would like to edit it to change e.g. a variable name, you can select the command in the listener window and use the normal copy/paste option from the EDIT menu (or the corresponding keyboard shortcuts). There is a special keyboard short-cut ALT-V, doing this in one step; to make it work