Analysis of habitat selection by animals