0
$\begingroup$

I have what I think is a three level contingency table, with time spent in three habitats for two species, and whether their 'condition' was in the presence of a competitor species or not.

example

dat= data.frame(experiment= rep(c(1:4),each= 3),
spp = rep(c("spp1","spp2"), each= 6),
condition = rep(c("solo","shared"), each= 3, t = 2),
habitat= rep(c("crest","interdune","slope"), t = 4),
time = c( 58.80,18.15, 23.05,61.58,17.76,20.66, 28.10, 57.88, 14.02, 10.52, 39.92, 49.56))

enter image description here

The independent variable here is % time spent by an individual in each habitat, averaged across 6 individuals tested as independent replicates.

Time in each experiment was always exactly 6 hours and total time across the three habitats for each experiment therefore = 100 %.

I have two questions:

1) Do the two species have different habitat preferences? (i.e. compare habitat usage in experiment 1 & 3, and 2&4 )

2) Does the presence of the second species (shared) affect habitat preference of the focal species? (i.e. compare experiments 1 & 2 and 3 & 4)

enter image description here

In the graphs I can see Question 1) spp 1 prefers crest and spp 2 prefers interdune and Question 2) spp 1 is not affected by the presence of spp 2, while spp 2 is affected and it is 'displaced' from interdune to slope.

enter image description here enter image description here enter image description here enter image description here

how do i test this statistically? (in R if possible) Im not sure what stats test to use.

Can I use a Chi2 for each experiment and say Expected always 33.3% for each habitat (if there was no habitat preference so time would be evenly spread across all three habitats)

But how do I compare experiment pairs?
Should I use a lm for each experiment pair?

I tried this (eg. for experiment 1 & 3) :

 dat1 = dat[dat$experiment %in% c(1,3),]

mod <- lm(time ~ spp + habitat, data=dat1)
summary(mod)

But I dont think this is right either. glm wont work because my data is continuous..

Im not really sure what to do next. Which tests do I need to answer qu 1 & 2?

Thanks

$\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.