0
$\begingroup$

I want to test with my data weather species richness (Y) is dependent on Treatment (A = factor with two Levels) and if it changes over the years (B = factor with three Levels). The plots were repeated measures (linking feature would be a Plot ID) for one Treatment in 2013 and 2019 and for the other in 2017 and 2019. I have 62 Plots, 42 with a specific Treatment A and 20 without the Treatment. .The once with the Treatment were measured in 2017 and 2019 the once without in 2013 and 2019 (not perfect but there wasn't an other possibility). So here's a small sample of the data:

Treatment <- c('ja','ja', 'ja', 'ja', 'ja', 'ja', 'ja', 'ja', 'ja', 'ja', 'nein', 'nein', 'nein', 'nein', 'nein','nein','ja','ja', 'ja', 'ja', 'ja', 'ja', 'ja', 'ja', 'ja', 'ja', 'nein', 'nein', 'nein', 'nein', 'nein','nein')
Year <- c('2017', '2017', '2017', '2017', '2017', '2017','2017', '2017', '2017','2017','2013','2013','2013','2013','2013','2013','2019','2019','2019','2019','2019','2019','2019','2019','2019','2019','2019','2019','2019','2019','2019','2019')
Species_Richness <-  runif(n = 32, min = 20, max = 40)
Plot_ID<- c('A1','A2','A3','A4','A5','A6','A7','A8','A9','A10', 'B1','B2','B3','B4','B5','B6','A1','A2','A3','A4','A5','A6','A7','A8','A9','A10', 'B1','B2','B3','B4','B5','B6')

mydata <- data.frame(Plot_ID, Year, Treatment, Species_Richness)

I wanted to use an ANOVA for Y~AB+Error(Plot_ID) or Maybe Y~AB+Error(Plot_ID/B). In R I tried it as following:

aov_rich <- aov(Species_Richness~Treatment*Year+Error(Plot_ID))

First question is why is it not possible to use the plot function on this model?

plot(aov_rich)

Fehler in xy.coords(x, y, xlabel, ylabel, log) : 'x' is a list, but does not have components 'x' and 'y'

Second questions is why can't I see the the Year and the Interaction in my summary table?

summary(aov_rich)

Kind regards and thanks your answers and advises.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.