Generalized linear models for population dynamics in two juxtaposed habitats