summary: Summary Method for kproto Cluster Result

Description Usage Arguments Details Value Author(s) Examples

Description

Investigation of variances to specify lambda for k-prototypes clustering.

Usage

1
2
## S3 method for class 'kproto'
summary(object, data = NULL, pct.dig = 3, ...)

Arguments

object

Object of class kproto.

data

Optional data set to be analyzed. If !(is.null(data)) clusters for data are assigned by predict(object, data). If not specified the clusters of the original data ara analyzed which is only possible if kproto has been called using keep.data = TRUE.

pct.dig

Number of digits for rounding percentages of factor variables.

...

Further arguments to be passed to internal call of summary() for numeric variables.

Details

For numeric variables statistics are computed for each clusters using summary(). For categorical variables distribution percentages are computed.

Value

List where each element corresponds to one variable. Each row of any element corresponds to one cluster.

Author(s)

gero.szepannek@web.de

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# generate toy data with factors and numerics

n   <- 100
prb <- 0.9
muk <- 1.5 
clusid <- rep(1:4, each = n)

x1 <- sample(c("A","B"), 2*n, replace = TRUE, prob = c(prb, 1-prb))
x1 <- c(x1, sample(c("A","B"), 2*n, replace = TRUE, prob = c(1-prb, prb)))
x1 <- as.factor(x1)

x2 <- sample(c("A","B"), 2*n, replace = TRUE, prob = c(prb, 1-prb))
x2 <- c(x2, sample(c("A","B"), 2*n, replace = TRUE, prob = c(1-prb, prb)))
x2 <- as.factor(x2)

x3 <- c(rnorm(n, mean = -muk), rnorm(n, mean = muk), rnorm(n, mean = -muk), rnorm(n, mean = muk))
x4 <- c(rnorm(n, mean = -muk), rnorm(n, mean = muk), rnorm(n, mean = -muk), rnorm(n, mean = muk))

x <- data.frame(x1,x2,x3,x4)

res <- kproto(x, 4)
summary(res)

clustMixType documentation built on Aug. 18, 2021, 5:08 p.m.