dataHipam <- sampleSpanishSurvey
bust <- dataHipam$bust
bustSizes <- bustSizesStandard(seq(74, 102, 4), seq(107, 131, 6))
type <- "IMO"
maxsplit <- 5 ; orness <- 0.7
ah <- c(23, 28, 20, 25, 25)
set.seed(2013)
res_hipam <- list()
for(i in 1 : (bustSizes$nsizes - 1)){
data = dataHipam[(bust >= bustSizes$bustCirc[i]) & (bust < bustSizes$bustCirc[i + 1]), ]
dataMat <- as.matrix(data)
res_hipam[[i]] <- hipamAnthropom(dataMat, maxsplit = maxsplit, orness = orness, type = type,
ah = ah, verbose = FALSE)
}
res_hipam #clustering results in each bust size.
fitmodels <- anthrCases("anthropometry", "HipamAnthropom", res_hipam,
oneSize = FALSE, bustSizes$nsizes)
outliers <- trimmOutl("HipamAnthropom", res_hipam, oneSize = FALSE, bustSizes$nsizes)
#ONLY FOR ONE SIZE:
set.seed(1900)
rand <- sample(1:600,20)
dataComp <- sampleSpanishSurvey[rand, c(2, 3, 5)]
numVar <- dim(dataComp)[2]
orness <- 0.7
weightsTrimowa <- weightsMixtureUB(orness, numVar)
maxsplit <- 5
type <- "IMO"
ah <- c(28, 25, 25)
dataMat <- as.matrix(dataComp)
set.seed(2013)
res_hipam_One <- hipamAnthropom(dataMat, maxsplit = maxsplit, orness = orness, type = type,
ah = ah, verbose = FALSE)
plotTreeHipamAnthropom(res_hipam_One, main="Proposed Hierarchical PAM Clustering \n")
fitmodels_One <- anthrCases("anthropometry", "HipamAnthropom", res_hipam_One, oneSize = TRUE)
outliers_One <- trimmOutl("HipamAnthropom", res_hipam_One, oneSize = TRUE)
Run the code above in your browser using DataLab