For a 4 class discrimination problem the membership values of each class are visualized in a 3 dimensional barycentric coordinate system.
quadplot(e = NULL, f = NULL, g = NULL, h = NULL, angle = 75,
scale.y = 0.6, label = 1:4, labelcol = rainbow(4),
labelpch = 19, labelcex = 1.5, main = "", s3d.control = list(),
simplex.control = list(), legend.control = list(), ...)
either a matrix with 4 columns represanting the membership values or a vector with the membership values of the first class
vector with the membership values of the second class
vector with the membership values of the third class
vector with the membership values of the forth class
angle between x and y axis
scale of y axis related to x- and z axis
label for the classes
colors to use for the labels
pch
for the labels
cex
for the labels
main title of the plot
a list with further arguments passed to the underlying
scatterplot3d
function call that sets up the plot
a list with further arguments passed to the underlying function call that draws the barycentric coordinate system
a list with further arguments passed to the underlying
function call that adds the legend
further arguments passed to the underlying plot
function that draws the data points
A scatterplot3d
object.
The membership values are calculated with quadtrafo
and plotted
with scatterplot3d
.
Garczarek, Ursula Maria (2002): Classification rules in standardized partition spaces. Dissertation, University of Dortmund. URL http://hdl.handle.net/2003/2789
# NOT RUN {
library("MASS")
data(B3)
opar <- par(mfrow = c(1, 2), pty = "s")
posterior <- predict(lda(PHASEN ~ ., data = B3))$post
s3d <- quadplot(posterior, col = rainbow(4)[B3$PHASEN],
labelpch = 22:25, labelcex = 0.8,
pch = (22:25)[apply(posterior, 1, which.max)],
main = "LDA posterior assignments")
quadlines(centerlines(4), sp = s3d, lty = "dashed")
posterior <- predict(qda(PHASEN ~ ., data = B3))$post
s3d <- quadplot(posterior, col = rainbow(4)[B3$PHASEN],
labelpch = 22:25, labelcex = 0.8,
pch = (22:25)[apply(posterior, 1, which.max)],
main = "QDA posterior assignments")
quadlines(centerlines(4), sp = s3d, lty = "dashed")
par(opar)
# }
Run the code above in your browser using DataLab