Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. chisq.test(c(90,30))
  2.  
  3. E.i = (total birds caught during study)/(total hours of effort)*(hours of effort at site i)
  4.  
  5. #observations
  6. obs1 <- 128; obs2 <- 141
  7. obs.tot <- obs1+obs2
  8.  
  9. #sampling effort ("net hours")
  10. nethours1 <- 287; nethours2 <- 157
  11. nethours.tot <- nethours1+nethours2
  12.  
  13. #expected counts based on effort
  14. expect1 <- obs.tot/nethours.tot*nethours1
  15. expect2 <- obs.tot/nethours.tot*nethours2
  16.  
  17. #ch2 test statistics:
  18. ch2 <- sum(c(((expect1-obs1)^2)/expect1, ((expect2-obs2)^2)/expect2))
  19.  
  20. #p value
  21. pchisq(ch2,1,lower.tail = FALSE)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement