Dear R users, I am having a problem performing the mantel test (both with functions mantel {vegan} and mantel.test {ape}) due to I believe the presence of NAs on my distance matrices, which look like e.g.: NA 1 2 1 2 3 NA 4 5 6 and 1 1 2 2 3 4 5 6 7 8 Would any of you have a solution for that? Thank you for much for your help! Marcia Rocha -- View this message in context: n4.nabble.com/mantel-test-and-NAs-tp966682p966682.html Sent from the R help mailing list archive at Nabble.com.
Could you please supply with a reproducible self sufficient script ? ----------------Contact Details:------------------------------------------------------- Contact me: Tal.Galili@gmail.com | 972-52-7275845 Read me: talgalili.com (Hebrew) | biostatistics.co.il (Hebrew) | r-statistics.com (English) ---------------------------------------------------------------------------------------------- On Thu, Dec 17, 2009 at 7:33 PM, marciarocha <marcia.rocha@gmail.com> wrote:> > Dear R users, > > I am having a problem performing the mantel test (both with functions > mantel > {vegan} and mantel.test {ape}) due to I believe the presence of NAs on my > distance matrices, which look like e.g.: > > NA > 1 2 > 1 2 3 > NA 4 5 6 > > and > > 1 > 1 2 > 2 3 4 > 5 6 7 8 > > Would any of you have a solution for that? > > Thank you for much for your help! > > Marcia Rocha > > > -- > View this message in context: > n4.nabble.com/mantel-test-and-NAs-tp966682p966682.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@r-project.org mailing list > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
You will most likely need to drop the samples that are causing the NA values from both of your datasets. The function won't work with NA values. Sarah On Thu, Dec 17, 2009 at 12:33 PM, marciarocha <marcia.rocha at gmail.com> wrote:> > Dear R users, > > I am having a problem performing the mantel test (both with functions mantel > {vegan} and mantel.test {ape}) due to I believe the presence of NAs on my > distance matrices, which look like e.g.: > > NA > 1 ? ?2 > 1 ? ?2 ? 3 > NA ?4 ? 5 ?6 > > and > > 1 > 1 ? 2 > 2 ? 3 ? 4 > 5 ? 6 ? 7 ?8 > > Would any of you have a solution for that? > > Thank you for much for your help! > > Marcia Rocha > >-- Sarah Goslee functionaldiversity.org