A Generalized Spatial Panel Data Model with Random Effects