# Computation of a matrix of Gower dissimilarity using
# function daisy()
# Complete data matrix (4 variables)
dat2.S15 <- daisy(dat2, "gower")
range(dat2.S15)
coldiss(dat2.S15, diag = TRUE)
# Data matrix with the two orthogonal factors only
dat2partial.S15 <- daisy(dat2[, 3:4], "gower")
coldiss(dat2partial.S15, diag = TRUE)
head(as.matrix(dat2partial.S15))
# What are the dissimilarity values in the dat2partial.S15 matrix?
levels(factor(dat2partial.S15))
The values correspond to pairs of objects that share the same levels for 2, 1 or no factor.
Pairs with the highest dissimilarity values share no common levels.
# Computation of a matrix of Gower dissimilarity using
# function gowdis() of package FD
?gowdis
dat2.S15.2 <- gowdis(dat2)
range(dat2.S15.2)
coldiss(dat2.S15.2, diag = TRUE)
# Data matrix with the two orthogonal factors only
dat2partial.S15.2 <- gowdis(dat2[ , 3:4])
coldiss(dat2partial.S15.2, diag = TRUE)
head(as.matrix(dat2partial.S15.2))
# What are the dissimilarity values in the dat2partial.S15.2
# matrix?
levels(factor(dat2partial.S15.2))
3.4 R Mode: Computing Dependence Matrices Among
Variables
Correlation-type coefficients must be used to compare variables in the R mode.
These include the Pearson as well as the non-parametric correlation coefficients
(Spearman, Kendall) for quantitative or ordinal data, and contingency statistics for
3.4 R Mode: Computing Dependence Matrices Among Variables
51
# function daisy()
# Complete data matrix (4 variables)
dat2.S15 <- daisy(dat2, "gower")
range(dat2.S15)
coldiss(dat2.S15, diag = TRUE)
# Data matrix with the two orthogonal factors only
dat2partial.S15 <- daisy(dat2[, 3:4], "gower")
coldiss(dat2partial.S15, diag = TRUE)
head(as.matrix(dat2partial.S15))
# What are the dissimilarity values in the dat2partial.S15 matrix?
levels(factor(dat2partial.S15))
The values correspond to pairs of objects that share the same levels for 2, 1 or no factor.
Pairs with the highest dissimilarity values share no common levels.
# Computation of a matrix of Gower dissimilarity using
# function gowdis() of package FD
?gowdis
dat2.S15.2 <- gowdis(dat2)
range(dat2.S15.2)
coldiss(dat2.S15.2, diag = TRUE)
# Data matrix with the two orthogonal factors only
dat2partial.S15.2 <- gowdis(dat2[ , 3:4])
coldiss(dat2partial.S15.2, diag = TRUE)
head(as.matrix(dat2partial.S15.2))
# What are the dissimilarity values in the dat2partial.S15.2
# matrix?
levels(factor(dat2partial.S15.2))
3.4 R Mode: Computing Dependence Matrices Among
Variables
Correlation-type coefficients must be used to compare variables in the R mode.
These include the Pearson as well as the non-parametric correlation coefficients
(Spearman, Kendall) for quantitative or ordinal data, and contingency statistics for
3.4 R Mode: Computing Dependence Matrices Among Variables
51
