PrepHistogram: This function transform standard variables into...

Description Usage Arguments Value Author(s) References See Also Examples

Description

This function transforms quantitative variable into histogram-valued variable.

Usage

1
PrepHistogram(X, Z = NULL, k = 3,group=NULL)

Arguments

X

X quantitative variable that need to be transformed into symbolic histogram

Z

Z categorical variable that need to be used for the purpose of clustering

k

k number of bins of histogram-valued variables

group

Data group

Value

Returns a list including :

mido

return the class centres of class and the min and the max of histograms

Vhistogram

dataframe containing the relative frequency of histogram variables

Author(s)

Brahim Brahim Brahim Brahim <[email protected]> and Sun Makosso-Kallyth <[email protected]>

References

Makosso-Kallyth, Sun; Diday, Edwin. Adaptation of interval PCA to symbolic histogram variables. Advances in Data Analysis and Classification. Volume 6. n 2. 2012. pages 147-159. Springer.

See Also

http://www.ivisualizations.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
###  example1 from iris data

## preparation of histogram-valued variables (k= 3 bins)

Sepal.LengthHistogram=PrepHistogram(X=iris[,1],Z=iris[,5])$Vhistogram
Sepal.WidthHistogram=PrepHistogram(X=iris[,2],Z=iris[,5])$Vhistogram
Petal.LengthHistogram=PrepHistogram(X=iris[,3],Z=iris[,5])$Vhistogram
Petal.WidthHistogram=PrepHistogram(X=iris[,4],Z=iris[,5])$Vhistogram

############################     Hitsogram PCA   #################################
HistPCA(Variable=list(Sepal.LengthHistogram,Sepal.WidthHistogram,
        Petal.LengthHistogram,Petal.WidthHistogram),
        Row.names=names(table(iris[,5])),
		Col.names=colnames(iris)[1:4])


###  example2 from iris data

## preparation of histogram-valued variables (k= 4 bins)

Sepal.LengthHistogram=PrepHistogram(X=iris[,1],Z=iris[,5],k=2)$Vhistogram
Sepal.WidthHistogram=PrepHistogram(X=iris[,2],Z=iris[,5],k=2)$Vhistogram
Petal.LengthHistogram=PrepHistogram(X=iris[,3],Z=iris[,5],k=2)$Vhistogram
Petal.WidthHistogram=PrepHistogram(X=iris[,4],Z=iris[,5],k=2)$Vhistogram


############################     Hitsogram PCA   #################################

HistPCA(Variable=list(Sepal.LengthHistogram,Sepal.WidthHistogram,
Petal.LengthHistogram,Petal.WidthHistogram),
Row.names=names(table(iris[,5])),Col.names=colnames(iris)[1:4])

GraphPCA documentation built on May 2, 2019, 1:08 p.m.