Dealing with dependence in retrospective ecological data through longitudinal models