Last chance! 50% off unlimited learning
Sale ends in
Computes linear discriminant analysis on classified cluster groups. This function plots a bar graph indicating the goodness of classification for each group.
sjc.grpdisc(data, groups, groupcount, clss.fit = TRUE)
A data frame with variables that should be used for the cluster analysis.
group classification of the cluster analysis that was returned
from the sjc.cluster
-function
amount of groups (clusters) that should be used. Use
sjc.elbow
to determine the group-count depending
on the elbow-criterion.
logical, if TRUE
(default), a vertical line indicating the
overall goodness of classification is added to the plot, so one can see
whether a certain group is below or above the average classification goodness.
(Invisibly) returns an object with
data
: the used data frame for plotting,
plot
: the ggplot object,
accuracy
: a vector with the accuracy of classification for each group,
total.accuracy
: the total accuracy of group classification.
# NOT RUN {
# retrieve group classification from hierarchical cluster analysis
# on the mtcars data set (5 groups)
groups <- sjc.cluster(mtcars, 5)
# plot goodness of group classificatoin
sjc.grpdisc(mtcars, groups, 5)
# }
Run the code above in your browser using DataLab