This is the LISP-STAT Reference Manual, version 1.2.0, generated automatically by Declt version 4.0b2.
Copyright © 2019-2022 Steve Nunez
Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided also that the section entitled “Copying” is included exactly as in the original.
Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be translated as well.
This program is distributed under the terms of the Microsoft Public License.
The main system appears first, followed by any subsystem dependency.
A statistical computing environment for Common Lisp
Statistical Computing in Common Lisp
Steve Nunez <steve@symbolics.tech>
(GIT https://github.com/Lisp-Stat/lisp-stat.git)
MS-PL
The Lisp-Stat system is an umbrella for a few projects and provides a unified interface for working with statistics. The general rule is that Lisp-Stat may depend on other libraries, for example data-frame, but not the other way around. Lisp-Stat provides it’s own user package, LS-USER, which imports CL as well as the symbols we need from the other libraries. You should always do your work in the LS-USER package, and not in CL-USER.
1.2.0
Modules are listed depth-first from the system components tree.
lisp-stat (system).
variables.lisp (file).
lisp-stat (system).
doc-strings.lisp (file).
Files are sorted by type and then listed depth-first from the systems components trees.
base (module).
lisp-stat (system).
setup-ls-translations (function).
Packages are listed by definition order.
Definitions are sorted by export status, category, package, and then by lexicographic order.
Define a data variable
VALUE is not evaluated and must be a symbol. Assigns the value of FORM to VALUE and adds VALUE to the list *VARIABLES* of def’ed variables. Returns VALUE. If VALUE is already bound and the global variable *ASK-ON-REDEFINE* is not nil then you are asked if you want to redefine the variable.
VARS is a symbol or a list of symbols. FILE is a string (or a symbol whose print name is used) not ending in SUFFIX (defaults to ".lisp"). The VARS and their current values are written to the file FILE.lisp in a form suitable for use with the load command. NOTE: Ensure VARS doesn’t contain CLOS objects that don’t have a SAVE-OBJ method. Example (savevar ’urban "urban")
Remove V from the system
If V is the symbol of a defined variable the variable it is unbound and removed from the list of defined variables. If V is a list of variable names each is unbound and removed. Returns V.
Example: (undef ’urban)
Returns a list of the names of all def’ed variables.
Edgar Anderson’s Iris Data
Description
This famous (Fisher’s or Anderson’s) iris data set gives the
measurements in centimeters of the variables sepal length and width
and petal length and width, respectively, for 70 flowers from each of
3 species of iris. The species are Iris setosa, versicolor, and
virginica.
Source
Fisher, R. A. (1937) The use of multiple measurements in taxonomic
problems. Annals of Eugenics, 7, Part II, 179–188. The data were
collected by Anderson, Edgar (1937). The irises of the Gaspe
Peninsula, Bulletin of the American Iris Society, 79, 2–7
References
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S
Language. Wadsworth & Brooks/Cole. (has iris3 as iris.)
Examples (from R)
dni3 <- dimnames(iris3)
ii <- data.frame(matrix(aperm(iris3, c(1,3,2)), ncol = 4,
dimnames = list(NULL, sub(" L.",".Length",
sub(" W.",".Width", dni3[[2]])))),
Species = gl(3, 50, labels = sub("S", "s", sub("V", "v", dni3[[3]]))))
all.equal(ii, iris) # TRUE
Motor Trend Car Road Tests
Description
The data was extracted from the 1974 Motor Trend US magazine, and
comprises fuel consumption and 10 aspects of automobile design and
performance for 32 automobiles (1973–74 models).
Note
Henderson and Velleman (1981) comment in a footnote to Table 1:
‘Hocking [original transcriber]’s noncrucial coding of the Mazda’s
rotary engine as a straight six-cylinder engine and the Porsche’s flat
engine as a V engine, as well as the inclusion of the diesel Mercedes
240D, have been retained to enable direct comparisons to be made with
previous analyses.’
Source
Henderson and Velleman (1981), Building multiple regression models
interactively. Biometrics, 37, 391–411.
Results from an Experiment on Plant Growth
Description
Results from an experiment to compare yields (as measured by dried
weight of plants) obtained under a control and two different treatment
conditions.
Format
A data frame of 30 cases on 2 variables.
[, 1] weight numeric
[, 2] group factor
The levels of group are ‘ctrl’, ‘trt1’, and ‘trt2’.
Source
Dobson, A. J. (1983) An Introduction to Statistical Modelling. London:
Chapman and Hall.
Examples (from R)
## One factor ANOVA example from Dobson’s book, cf. Table 7.4:
require(stats); require(graphics)
boxplot(weight ~ group, data = PlantGrowth, main = "PlantGrowth data",
ylab = "Dried weight of plants", col = "lightgray",
notch = TRUE, varwidth = TRUE)
anova(lm(weight ~ group, data = PlantGrowth))
The Effect of Vitamin C on Tooth Growth in Guinea Pigs
Description
The response is the length of odontoblasts (cells responsible for
tooth growth) in 60 guinea pigs. Each animal received one of three
dose levels of vitamin C (0.5, 1, and 2 mg/day) by one of two delivery
methods, orange juice or ascorbic acid (a form of vitamin C and coded
as VC).
Format
A data frame with 60 observations on 3 variables.
[,1] len numeric Tooth length
[,2] supp factor Supplement type (VC or OJ).
[,3] dose numeric Dose in milligrams/day
Source
C. I. Bliss (1952). The Statistics of Bioassay. Academic Press.
References
- McNeil, D. R. (1977). Interactive Data Analysis. New York: Wiley.
- Crampton, E. W. (1947). The growth of the odontoblast of the incisor
teeth as a criterion of vitamin C intake of the guinea pig. The
Journal of Nutrition, 33(5), 491–504. doi: 10.1093/jn/33.5.491.
Examples
require(graphics)
coplot(len ~ dose | supp, data = ToothGrowth, panel = panel.smooth,
xlab = "ToothGrowth data: length vs dose, given type of supplement")
Violent Crime Rates by US State
Description
This data set contains statistics, in arrests per 100,000 residents,
for assault, murder, and rape in each of the 50 US states in 1973.
Also given is the percent of the population living in urban areas.
Note
USArrests contains the data as in McNeil’s monograph. For the UrbanPop
percentages, a review of the table (No. 21) in the Statistical
Abstracts 1975 reveals a transcription error for Maryland (and that
McNeil used the same “round to even” rule that R’s round() uses), as
found by Daniel S Coven (Arizona).
See the example below on how to correct the error and improve accuracy
for the ‘<n>.5’ percentages.
Source
World Almanac and Book of facts 1975. (Crime rates).
Statistical Abstracts of the United States 1975, p.20, (Urban rates),
possibly available as
https://books.google.ch/books?id=zl9qAAAAMAAJ&pg=PA20.
References
McNeil, D. R. (1977) Interactive Data Analysis. New York: Wiley.
Examples
(summary usarrests)
;; Difference between ’USArrests’ and its correction
(which usarrests:x3 :predicate (lambda (x) (string= "Maryland" x))) ; #(19)
(select usarrests 19 ’urbanpop) ; 67, the value transcribed incorrectly
(setf (elt usarrests:urbanpop 19) 76.6) ; change to the correct value
;; correct rounding errors of +/- 0.5 to restore the original <n>.5 percentages
(map nil (lambda (x)
(setf (elt usarrests:urbanpop x)
(+ 0.5 (elt usarrests:urbanpop x))))
(which usarrests:x3 :predicate (lambda (x)
(or (string= "Colorado" x)
(string= "Florida" x)
(string= "Mississippi" x)
(string= "Wyoming" x)))))
(map nil (lambda (x)
(setf (elt usarrests:urbanpop x)
(- 0.5 (elt usarrests:urbanpop x))))
(which usarrests:x3 :predicate (lambda (x)
(or (string= "Nebraska" x)
(string= "Pennsylvania" x)))))
Jump to: | D F G M S U V |
---|
Jump to: | D F G M S U V |
---|
Jump to: | *
I M P S T U |
---|
Jump to: | *
I M P S T U |
---|
Jump to: | B D F L M P S V |
---|
Jump to: | B D F L M P S V |
---|