This function compares the distance between two groupmeans to the distances obtained by random assignment of observations to this groups.
permudist(
data,
groups,
rounds = 1000,
which = NULL,
p.adjust.method = "none",
median = FALSE
)
distance matrix with distances between actual group means
method used for p-value adjustion
distance matrix containing pairwise p-values obtained by comparing the actual distance to randomly acquired distances
array or matrix containing data
factors determining grouping.
number of permutations
integer (optional): in case the factor levels are > 2 this determins which factorlevels to use
method to adjust p-values for multiple comparisons see p.adjust.methods
for options.
logical: if TRUE, comparison will be median instead of mean.
data(boneData)
proc <- procSym(boneLM)
groups <- name2factor(boneLM,which=3)
perm <- permudist(proc$PCscores[,1:10], groups=groups, rounds=10000)
## now we concentrate only on sex dimorphism between Europeans
groups <- name2factor(boneLM,which=3:4)
levels(groups)
perm1 <- permudist(proc$PCscores, groups=groups,which=3:4, rounds=10000)
Run the code above in your browser using DataLab