#COCKPIT DESIGN PROBLEM:
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 archetype 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 archetypoids algorithm repeatedly from 1 to numArch archetypes:
for(numArchoid in 1:numArch){
temp <- stepArchetypoids(numArchoid,nearest="cand_ns",USAFSurvey_preproc$data,lass)
filename <- paste("res", numArchoid, sep="")
assign(filename,temp)
save(list=c(filename),file=paste(filename, ".RData", sep=""))
}
Run the code above in your browser using DataLab