Last chance! 50% off unlimited learning
Sale ends in
typprob(x, data, small = FALSE, method = c("chisquare", "wilson"),
center = NULL, cova = NULL)typprobClass(x, data, groups, small = FALSE, method = c("chisquare",
"wilson"), outlier = 0.01, sep = FALSE)
typprobClass:
Wilson S. 1981. On comparing fossil specimens with population samples Journal of Human Evolution 10:207 - 214.
library(shapes)
data <- procSym(gorf.dat)$PCscores[,1:3]
probas <- typprob(data,data,small=TRUE)### get probability for each specimen
### now we check how this behaves compared to the mahalanobis distance
maha <- mahalanobis(data,apply(data,2,mean),cov(data))
plot(probas,maha,xlab="Probability",ylab="Mahalanobis D^2")
data2 <- procSym(abind(gorf.dat,gorm.dat))$PCscores[,1:3]
fac <- as.factor(c(rep("female",dim(gorf.dat)[3]),rep("male",dim(gorm.dat)[3])))
typClass <- typprobClass(data2,data2,fac,method="w",small=TRUE)
## only 59 specimen is rather small.
typClass2 <- typprobClass(data2,data2,fac,method="c")## use default settings
### check results for first method:
ct <- table(fac,typClass$groupaffin)
ct #view classification table
### get percentage of correct classification
prop.table(ct, 1)
### check results for second method:
ct1 <- table(fac,typClass2$groupaffin)
ct1 #view classification table ### one specimen has been tagged an outlier.
### get percentage of correct callification
prop.table(ct1, 1)
Run the code above in your browser using DataLab