jenks.tests {classInt} | R Documentation |
Indices for assessing class intervals
Description
The function returns values of two indices for assessing class intervals: the goodness of variance fit measure, and the tabular accuracy index; optionally the overview accuracy index is also returned if the area
argument is not missing.
Usage
jenks.tests(clI, area)
Arguments
clI |
a "classIntervals" object |
area |
an optional vector of object areas if the overview accuracy index is also required |
Details
The goodness of variance fit measure is given by Armstrong et al. (2003, p. 600) as:
where the are the observed values,
is the number of classes,
the class mean for class
, and
the number of counties in class
.
The tabular accuracy index is given by Armstrong et al. (2003, p. 600) as:
The overview accuracy index for polygon observations with known areas is given by Armstrong et al. (2003, p. 600) as:
where are the polygon areas, and as above the
term is indexed over
classes, and
polygons in class
.
Value
a named vector of index values
Author(s)
Roger Bivand <Roger.Bivand@nhh.no>
References
Armstrong, M. P., Xiao, N., Bennett, D. A., 2003. "Using genetic algorithms to create multicriteria class intervals for choropleth maps". Annals, Association of American Geographers, 93 (3), 595–623; Jenks, G. F., Caspall, F. C., 1971. "Error on choroplethic maps: definition, measurement, reduction". Annals, Association of American Geographers, 61 (2), 217–244
See Also
Examples
if (!require("spData", quietly=TRUE)) {
message("spData package needed for examples")
run <- FALSE
} else {
run <- TRUE
}
if (run) {
data(jenks71, package="spData")
fix5 <- classIntervals(jenks71$jenks71, n=5, style="fixed",
fixedBreaks=c(15.57, 25, 50, 75, 100, 155.30))
print(jenks.tests(fix5, jenks71$area))
}
if (run) {
q5 <- classIntervals(jenks71$jenks71, n=5, style="quantile")
print(jenks.tests(q5, jenks71$area))
}
if (run) {
set.seed(1)
k5 <- classIntervals(jenks71$jenks71, n=5, style="kmeans")
print(jenks.tests(k5, jenks71$area))
}
if (run) {
h5 <- classIntervals(jenks71$jenks71, n=5, style="hclust", method="complete")
print(jenks.tests(h5, jenks71$area))
}
if (run) {
print(jenks.tests(getHclustClassIntervals(h5, k=7), jenks71$area))
}
if (run) {
print(jenks.tests(getHclustClassIntervals(h5, k=9), jenks71$area))
}
if (run) {
set.seed(1)
b5 <- classIntervals(jenks71$jenks71, n=5, style="bclust")
print(jenks.tests(b5, jenks71$area))
}
if (run) {
print(jenks.tests(getBclustClassIntervals(b5, k=7), jenks71$area))
}
if (run) {
print(jenks.tests(getBclustClassIntervals(b5, k=9), jenks71$area))
}