[R-sig-eco] Running MANCOVA in R

Adam Ralph Zeilinger arz at berkeley.edu
Tue Feb 21 20:12:08 CET 2017


Hi Laura,

It would be helpful if you provided a reproducible example with a small
data set and copy and paste the error message you are getting.

Advice on making a reproducible example in R is here:
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

Adam

On Mon, Feb 6, 2017 at 10:31 PM, Livingston, Laura <laura.livingston at wsu.edu
> wrote:

> Hello everyone,
>
>
> I am a new user on the r-sig-ecology group. I have been working a
> community dataset that contains 257 invertebrate genera sampled across 3
> categories of streams and a variety of stream temperatures. My committee
> member recommended that I run a MANCOVA on the dataset to see whether there
> was a difference among the 3 categories of streams using stream temperature
> as a co-variate. However, I have been searching on how to run a MANCOVA in
> R without much luck. Has anyone come across this problem before?
>
>
> The closest example that I have been able to find is at this link:
> https://stat.ethz.ch/pipermail/r-sig-ecology/2011-November/002553.html.
>
>
> Using my test data and following that example I wrote:
>
>
> library(vegan)
>
> library(car)
>
> library(dplyr)
>
>
> Data <- read.csv("MANCOVA_testData.csv")
>
> Community <- Data %>% dplyr::select(-VisitID:StreamTemp)
>
> Community_dissimilarity <- vegan::vegdist(Community,method="bray")
>
>
> MANCOVA <- car::ANOVA(lm(as.matrix(Community_dissimilarity) ~
> Data$Category + Data$StreamTemp))
>
> summary(MANCOVA)
>
>
> When I run this code, I get an error. Thoughts?
>
> [R-sig-eco] MANCOVA in R - SfS – Seminar for Statistics<https://stat.ethz.
> ch/pipermail/r-sig-ecology/2011-November/002553.html>
> stat.ethz.ch
> On Fri, 2011-11-25 at 10:47 +0100, marcelino.delacruz at upm.es wrote: >
> Hi, > > maybe adonis? e.g., > > library(vegan) > adonis(Y~Lat+Lat2+Year+Lat:Year+Lat2:Year
> ...
>
>
>
>
> Sincerely,
>
> Laura
>
> M.S. student, Environmental Science
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>



-- 
Adam Zeilinger

Postdoctoral Scholar
Department of Environmental Science, Policy, and Management
University of California Berkeley
arz at berkeley.edu

	[[alternative HTML version deleted]]



More information about the R-sig-ecology mailing list