Learn R Programming

Anthropometry (version 1.2)

stepArchetypesMod: Archetype algorithm to raw data

Description

This is a slight modification of the original stepArchetypes function of the archetypes R package to apply the archetype algorithm to raw data. The stepArchetypes function standardizes the data by default and this option is not always desired.

Usage

stepArchetypesMod(data,numArch,numRep=3,verbose=TRUE)

Arguments

data
Data to obtain archetypes.
numArch
Number of archetypes to compute, from 1 to numArch.
numRep
For each numArch, run archetypes numRep times.
verbose
If TRUE, the progress during execution is shown.

Value

  • A list with numArch elements. Each element is a list of class attribute stepArchetypes with numRep elements.

References

Eugster, M. J., and Leisch, F., (2009). From Spider-Man to Hero - Archetypal Analysis in R, Journal of Statistical Software 30, 1--23, http://www.jstatsoft.org/.

Vinue, G., Epifanio, I., and Alemany, S., (2015). Archetypoids: a new approach to define representative archetypal data, Computational Statistics and Data Analysis 87, 102--115.

See Also

stepArchetypes

Examples

Run this code
#Cockpit design problem:
#First, the database USAF 1967 is read and preprocessed (Zehner et al (1993).).
USAFSurvey_First50 <- USAFSurvey[1 : 50, ]
#Variable selection:
variabl_sel <- c(48, 40, 39, 33, 34, 36)
#Changing to inches: 
USAFSurvey_First50_inch <- USAFSurvey_First50[,variabl_sel] / (10 * 2.54)

#Data preprocessing:
USAFSurvey_preproc <- preprocessing(USAFSurvey_First50_inch, TRUE, 0.95, TRUE)

#For reproducing results, seed for randomness:
set.seed(2010) 
#Run archetypes algorithm repeatedly from 1 to numArch archetypes:
numArch <- 10 ; numRep <- 20
lass <- stepArchetypesMod(data = USAFSurvey_preproc$data, 
                          numArch=1:numArch, numRep = numRep, 
                          verbose = FALSE)

Run the code above in your browser using DataLab