Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anova.cca #517

Open
PauLucio opened this issue Jun 3, 2022 · 2 comments
Open

Anova.cca #517

PauLucio opened this issue Jun 3, 2022 · 2 comments

Comments

@PauLucio
Copy link

PauLucio commented Jun 3, 2022

Hi everyone,

I hope you can help.

I am testing the effect of Period (Autumn, Winter, and Spring), Year, Rainfall, and Average temperature in a bird passerine community using the function var par. When I have tested the effect of Period in the community (ANOVA), it has been always significant, and when I compare each of the most abundant bird species with Period, the effect of Period has been always significant. So, I am surprised when I used the code below and the result was the Perid being non-significant . So, for that reason, I think I must be doing something wrong. Any advise please?

Anova_period <- (cca(com.hel ~ as.matrix(Period) + Condition(as.matrix(Year)) + Condition(as.matrix(rainfall)) +
Condition(as.matrix(Tmean))))
anova(Anova_period, by="terms", model = "direct")

Many thanks

@jarioksa
Copy link
Contributor

jarioksa commented Jun 6, 2022

There is no way to know what you have done and what did you get: I don't have access to your data. However, variable name Period gives an impression that it is correlated with other periodically varying variables such as Year, rainfall and Tmean, and if this is true of any of these variables, there may be little left for Period to explain.

You only have one explanatory variable (Period), and it makes no sense to request a test by="terms". The overall test without the by= argument will give the same result, but faster.

@PauLucio
Copy link
Author

PauLucio commented Jun 7, 2022

Many thanks for your quick reply Jari. I am attaching the script and the files.

com <- read.csv ("Community.csv", header=TRUE, sep = ";")
com <- as.matrix(com[c(3:45)])
com.hel <- decostand(com, "hel")

Year <- read.csv ("Year.csv", header=TRUE, sep = ";")

Period <- read.csv ("Period.csv", header=TRUE, sep = ";")

rainfall <- read.csv ("Rainfall.csv", header=TRUE, sep = ";")
rainfall <- as.matrix(rainfall[c(3:7)])

Tmean <- read.csv ("Tmean.csv", header=TRUE, sep = ";")
Tmean <- as.matrix(Tmean[c(3:7)])

##############
#Varpar with 4 variables
?varpart
x <- varpart(com.hel, Year, Period, Tmean, rainfall)
x$part # to access results
plot(x, Xnames = c('Year', 'Period', 'Tmean', 'Pp'), bg = c("hotpink","skyblue","yellow","orange"), alpha=100, cex=1, id.size=1)

#Testing the significance of each component

#Anova Year
anova(rda(com.hel ~ as.matrix(Year) + Condition(as.matrix(Period)) + Condition(as.matrix(rainfall)) +
Condition(as.matrix(Tmean)))) #P-value 0.006

#Anova Period

anova(rda(com.hel ~ as.matrix(Period) + Condition(as.matrix(Year)) + Condition(as.matrix(rainfall)) +
Condition(as.matrix(Tmean)))) #P-value 0.298

#Anova Rainfall
anova(rda(com.hel ~ as.matrix(rainfall) + Condition(as.matrix(Year)) + Condition(as.matrix(Period)) +
Condition(as.matrix(Tmean)))) #0.200

#Anova Temperature
anova(rda(com.hel ~ as.matrix(Tmean) + Condition(as.matrix(Year)) + Condition(as.matrix(Period)) +
Condition(as.matrix(rainfall)))) #P-value 0.009

#Testing the Period individually
anova(rda(com.hel, Period)) # P-value 0.001

VarPAR.zip

Many thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants