I am a university student looking for help with analysis for my dissertation, I do not have the best knowledge of R studios or statistics in general so please bear with me!
I would like to perform a Poisson Generalized Linear Model (GLM) to see if artificial light had an effect on the number of bat passes recorded in each of 5 locations. to do this I was going to use the code:
m1 <- glm(passes ~ location + source, family = poisson(link = "log"))
The summary of this model produces:
summary(m1)
Call:
glm(formula = Passes ~ source + Location, family = poisson(link = "log"))
Deviance Residuals:
Min 1Q Median 3Q Max
-10.074 -5.342 -2.030 1.903 26.322
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 4.26925 0.03290 129.778 < 2e-16
sourcelight -0.08672 0.02724 -3.183 0.00146
LocationGrace Dieu wood -0.05823 0.04335 -1.343 0.17920
LocationMartinshaw wood 0.03848 0.04231 0.910 0.36308
LocationOld wood 0.21655 0.04058 5.336 9.51e-08
LocationSwithland wood -0.35303 0.04702 -7.508 6.01e-14
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for poisson family taken to be 1)
Null deviance: 3597.4 on 79 degrees of freedom
Residual deviance: 3415.4 on 74 degrees of freedom
AIC: 3883.9
Number of Fisher Scoring iterations: 5
I have never performed a Poisson model with multiple explanatory variables before and so I'm not entirely sure what this is telling me.
I am also concerned this isn't comparing the effects of artificial light and location but both separately instead.
I've read about posthoc tests which may be more appropriate, however I can't find a source which explains this dumbed down enough for my level of understanding.
Is my original code correct or am I going wrong entirely?
For more information about my data, I have recorded the number of bat passes (so count data) in 5 different locations in an area with an artificial light source and in an area with a natural light source. Therefore source is a binary factor. I have 8 repeats for both light and dark in each location. Any help would be gratefully received! I apologise if this is not clear, I am trying!
Data <- structure(list(Location = structure(c(3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L,
5L, 5L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("Forest",
"Grace", "Martinshaw", "Old", "Swithland"), class = "factor"),
Al.N = structure(c(2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 2L,
2L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L,
2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L,
2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L,
1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L,
1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L), .Label = c("Dark",
"light"), class = "factor"), Buzzes = c(2L, 4L, 3L, 2L, 88L,
68L, 1L, 63L, 3L, 1L, 20L, 15L, 24L, 24L, 17L, 15L, 0L, 0L,
2L, 6L, 8L, 3L, 5L, 7L, 6L, 2L, 2L, 2L, 7L, 4L, 5L, 4L, 7L,
10L, 5L, 0L, 5L, 1L, 4L, 3L, 1L, 0L, 0L, 2L, 28L, 32L, 2L,
21L, 2L, 2L, 6L, 3L, 17L, 22L, 31L, 29L, 0L, 9L, 3L, 3L,
2L, 1L, 13L, 11L, 14L, 9L, 31L, 16L, 2L, 1L, 0L, 2L, 18L,
29L, 22L, 3L, 18L, 2L, 15L, 6L), Passes = c(37L, 48L, 34L,
28L, 279L, 216L, 7L, 198L, 29L, 17L, 154L, 120L, 68L, 134L,
157L, 144L, 5L, 19L, 45L, 67L, 72L, 48L, 51L, 58L, 48L, 23L,
25L, 20L, 39L, 25L, 23L, 34L, 53L, 57L, 48L, 26L, 57L, 25L,
17L, 29L, 15L, 12L, 9L, 24L, 61L, 79L, 8L, 84L, 40L, 46L,
55L, 46L, 50L, 98L, 104L, 99L, 24L, 93L, 74L, 54L, 15L, 39L,
45L, 61L, 123L, 150L, 376L, 104L, 24L, 35L, 15L, 32L, 125L,
156L, 107L, 47L, 142L, 51L, 59L, 35L), Date = structure(c(4L,
19L, 35L, 13L, 2L, 21L, 34L, 15L, 39L, 16L, 33L, 10L, 37L,
17L, 32L, 11L, 14L, 30L, 6L, 25L, 12L, 31L, 6L, 27L, 7L,
24L, 38L, 18L, 5L, 26L, 36L, 20L, 9L, 28L, 3L, 22L, 8L, 29L,
1L, 23L, 4L, 19L, 35L, 13L, 2L, 21L, 34L, 15L, 39L, 16L,
33L, 10L, 37L, 17L, 32L, 11L, 14L, 30L, 6L, 25L, 12L, 31L,
6L, 27L, 7L, 24L, 38L, 18L, 5L, 26L, 36L, 20L, 9L, 28L, 3L,
22L, 8L, 29L, 1L, 23L), .Label = c("01/09/2017", "02/08/2017",
"02/09/2017", "03/08/2017", "04/08/2017", "04/09/2017", "05/08/2017",
"06/08/2017", "07/08/2017", "07/09/2017", "08/09/2017", "09/08/2017",
"09/09/2017", "10/08/2017", "10/09/2017", "11/08/2017", "12/08/2017",
"12/09/2017", "13/08/2017", "13/09/2017", "14/08/2017", "14/09/2017",
"15/09/2017", "16/08/2017", "16/09/2017", "17/08/2017", "17/09/2017",
"18/08/2017", "19/08/2017", "21/08/2017", "22/08/2017", "25/08/2017",
"26/08/2017", "27/08/2017", "28/08/2017", "29/08/2017", "30/07/2017",
"30/08/2017", "31/07/2017"), class = "factor")), .Names = c("Location",
"Al.N", "Buzzes", "Passes", "Date"), class = "data.frame", row.names = c(NA,
-80L))
I've tried to follow the instructions, apologies if this is incorrect!
glm.nb
) instead of the Poisson model to take that into account, otherwise all your standard errors will be underestimated. $\endgroup$