Ad Code

R Script for Cluster Analysis


library(biotools) 

################# seperating the dependent variables ################## 
dv <- as.matrix(Cotton[,3:6]) 
dv 

###################### model for manova ######################## 
mod <- manova(dv ~ as.factor(Genotype) + as.factor(Repl), data = Cotton) 
summary(mod) 

ss <- SSD(mod) 
?SSD 
ss 

covar <- ss$SSD / ss$df 
covar 

########################### percentage contribution ############## 
imp <- singh(dv, covar) 
imp 
plot(imp) 

######################## mahalanobis distance ################## 
d <- D2.dist(avg[,-1], covar) 

######################## tocher method ################### 
toc <- tocher(d) 
toc$clusters 
toc$distClust

Post a Comment

0 Comments

Close Menu