Skip to contents

Method for objects of class pkbc which computes some descriptive for each variable with respect to the detected groups.

Method for objects of class pkbc which computes descriptive statistics for each variable with respect to the detected groups.

Usage

stats_clusters(object, ...)

# S4 method for pkbc
stats_clusters(object, k)

Arguments

object

Object of class pkbc.

...

possible additional inputs

k

Number of clusters to be used.

Value

List with computed descriptive statistics for each variable.

Details

The function computes mean, standard deviation, median, inter-quantile range, minimum and maximum for each variable in the data set given the final membership assigned by the clustering algorithm.

Examples

#We generate three samples of 100 observations from 3-dimensional
#Poisson kernel-based densities with rho=0.8 and different mean directions
dat<-matrix(rnorm(300),ncol=3)

#Perform the clustering algorithm
pkbc_res<- pkbc(dat, 3)
stats_clusters(pkbc_res, 3)
#> [[1]]
#>           Group 1     Group 2      Group 3     Overall
#> mean   -0.3821843  0.08282479 -0.002103442 -0.04261745
#> sd      0.1909313  0.15433216  0.567670473  0.53404310
#> median -0.3871139  0.12091003  0.043346085 -0.07143280
#> IQR     0.3066889  0.15035395  0.991817872  0.78616924
#> min    -0.7093754 -0.19391451 -0.986649621 -0.98664962
#> max    -0.1099137  0.22089075  0.997175034  0.99717503
#> 
#> [[2]]
#>            Group 1     Group 2     Group 3     Overall
#> mean    0.01395699 -0.88601465 -0.05481256 -0.09643234
#> sd      0.22081313  0.06606977  0.61604194  0.59736122
#> median -0.02881121 -0.89266575 -0.11281334 -0.14435102
#> IQR     0.30870888  0.05016114  1.16339565  1.08607439
#> min    -0.26200571 -0.97630519 -0.99080627 -0.99080627
#> max     0.43189401 -0.77852191  0.99289949  0.99289949
#> 
#> [[3]]
#>            Group 1    Group 2    Group 3     Overall
#> mean   -0.87756935 -0.4087893  0.1127116 -0.03741216
#> sd      0.07746196  0.1450092  0.5428458  0.59616862
#> median -0.90249140 -0.4290443  0.1324318 -0.04415450
#> IQR     0.10918975  0.1295993  0.8400709  0.96124638
#> min    -0.95435628 -0.5874614 -0.9896503 -0.98965028
#> max    -0.70194289 -0.1684086  0.9632128  0.96321275
#>