Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- chisq.test(c(90,30))
- E.i = (total birds caught during study)/(total hours of effort)*(hours of effort at site i)
- #observations
- obs1 <- 128; obs2 <- 141
- obs.tot <- obs1+obs2
- #sampling effort ("net hours")
- nethours1 <- 287; nethours2 <- 157
- nethours.tot <- nethours1+nethours2
- #expected counts based on effort
- expect1 <- obs.tot/nethours.tot*nethours1
- expect2 <- obs.tot/nethours.tot*nethours2
- #ch2 test statistics:
- ch2 <- sum(c(((expect1-obs1)^2)/expect1, ((expect2-obs2)^2)/expect2))
- #p value
- pchisq(ch2,1,lower.tail = FALSE)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement