I have created a dataset that includes 28 rows (burials) and 27 columns
(variables) that are coded binomially. I have gotten metaMDS to run in the
pst but now can't seem to get it run at all.
> mortdata.mds <- metaMDS(mortdata)
Error in FUN(X[[i]], ...) :
only defined on a data frame with all numeric variables
In addition: Warning message:
In Ops.factor(left, right) : ‘<’ not meaningful for factors
I'd like to create a 3D MDS plot and add the line of best fit for the 3
dimensions (3 variables). I am also trying to figure out, or understand,
which variables are causing the variation.
I ran PCA and it told me that with 3 variables approximately 50% of the
data variation is explained. So I assumed that meant that running MDS in 3
dimensions would show me 3 variables causing the variation but I can't get
that to work.
Here is my code so far (i've also attached it to the email):
row.names(mortdata) <- mortdata[,1]
mortdata <- mortdata[,-1]
mortdata.mds <- metaMDS(mortdata)
mortdata.mds.alt <- metaMDS(mortdata, distance="euclidean", k=3, trymax=50,
*object = mortdata.mds.alt
x <- mortdata.mds.alt$species
y <- mortdata.mds.alt$points
vScoresScale <- scale(, center = TRUE, scale = TRUE)
*multiple linear regression model
lm(formula = x ~ y)
abline(lm(x ~ y), col="red")
scatterplot3d(mortdata.mds.alt, x="sampleScores", y="variableScores",
Any help would be greatly appreciated. I can also send the dataset if that
Remail@example.com mailing list -- To UNSUBSCRIBE and more, see
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.