Generalized Linear Models Case Studies Bret Larget Departments of Botany and of Statistics University of Wisconsin Madison February 26 2008 1 13 Poisson Regression Moth Example Researchers studied the effect of habitat on density of two different moth species Researchers looked for moths along transects Each transect was partitioned into different sections depending on the habitat type There are 8 different types of habitat Counts of two moth species labeled A and P were obtained for each part of each transect Under a Poisson model we expect the counts to be proportional to the length of the transect within each habitat Moth Example 2 13 Dotplot of Data 0 5 NWsoak P 5 10 15 20 5 SWsoak 20 NEsoak 0 15 Lowerside 10 Upperside Disturbed 0 0 Bank A 20 P 15 SEsoak A 10 5 10 15 20 Moth Density per 10m Moth Example 3 13 Scatterplot of Data 20 A Moth Density per 10m 15 Bank Disturbed Lowerside NEsoak NWsoak SEsoak SWsoak Upperside 10 5 0 0 5 10 15 P Moth Density per 10m Moth Example 4 13 Model with an Offset The count data for species A comes from transects of different lengths Poisson process assumptions suggest that the expected count for a single transect should be proportional to the length of the transect We need to modify our typical Poisson regression model to accomodate an exposure variable Moth Example 5 13 Model Derivation For transect i I I I I ui hi i yi is the length in meters is the habitat hi is the rate be the count of species A The expected count for the ith habitat is then E yi i ui i Moth Example 6 13 Derivation cont We model i exp Xi where Xi includes all predictors except for length In this case I I i exp 1 if hi is the first habitat i exp 1 k if hi is the kth habitat k 1 We need E yi i ui i With the exponential inverse link function this is i exp log ui log i exp log ui 1 if k 1 exp log ui 1 k if k 1 This is like regular Poisson regression with log u as a predictor except we want to force the estimated coefficient to be equal to one Moth Example 7 13 Fitting the Model fitA with moths glm A habitat data moths family poisson offset log length fitAq with moths glm A habitat data moths family quasipoisson offset log length fitP with moths glm P habitat data moths family poisson offset log length fitPq with moths glm P habitat data moths family quasipoisson offset log length Moth Example 8 13 Poisson Regression for A display fitA glm formula A habitat family poisson data moths offset log len coef est coef se Intercept 18 35 1275 75 habitatDisturbed 16 53 1275 75 habitatLowerside 16 81 1275 75 habitatNEsoak 15 45 1275 75 habitatNWsoak 18 44 1275 75 habitatSEsoak 16 70 1275 75 habitatSWsoak 16 59 1275 75 habitatUpperside 14 82 1275 75 n 41 k 8 residual deviance 180 3 null deviance 499 0 difference 318 7 Moth Example 9 13 QuasiPoisson Regression for A display fitAq glm formula A habitat family quasipoisson data moths offset log length coef est coef se Intercept 18 35 3793 81 habitatDisturbed 16 53 3793 81 habitatLowerside 16 81 3793 81 habitatNEsoak 15 45 3793 81 habitatNWsoak 18 44 3793 81 habitatSEsoak 16 70 3793 81 habitatSWsoak 16 59 3793 81 habitatUpperside 14 82 3793 81 n 41 k 8 residual deviance 180 3 null deviance 499 0 difference 318 7 overdispersion parameter 8 8 Moth Example 10 13 Poisson Regression for P display fitP glm formula P habitat family poisson data moths offset log len coef est coef se Intercept 1 66 0 50 habitatDisturbed 1 26 0 53 habitatLowerside 0 76 0 56 habitatNEsoak 1 24 0 57 habitatNWsoak 0 43 0 55 habitatSEsoak 1 81 0 65 habitatSWsoak 0 78 0 52 habitatUpperside 3 12 0 61 n 41 k 8 residual deviance 92 6 null deviance 389 5 difference 296 9 Moth Example 11 13 QuasiPoisson Regression for P display fitPq glm formula P habitat family quasipoisson data moths offset log length coef est coef se Intercept 1 66 1 07 habitatDisturbed 1 26 1 13 habitatLowerside 0 76 1 19 habitatNEsoak 1 24 1 21 habitatNWsoak 0 43 1 18 habitatSEsoak 1 81 1 38 habitatSWsoak 0 78 1 11 habitatUpperside 3 12 1 31 n 41 k 8 residual deviance 92 6 null deviance 389 5 difference 296 9 overdispersion parameter 4 6 Moth Example 12 13 More More live with R and on Board Moth Example 13 13
View Full Document