Is it wise to use a Generalized Linear Model (GLM) to investigate trends in abundance over time? Not sure if this would be considered as being a "stupid" question, but I am still very new to statistical analyses. I have population abundance data and I wish to determine whether the trend in abundance (abundance values = counts) over time (time=years) shows an increasing/declining trend. Should (or rather, can) I make use of a GLM to investigate the trend in abundance over time (ie dependent variable = abundance value, independent variable=year (ie time)) ? Or is there perhaps a "better" alternative?
Thanks again :)
 A: GLMs are a very large class of models, even for general count data so that, by using a GLM, there are likely a few ways to "do it right" and to "do it wrong". Certainly, if you Google "GLM for count data" you'll likely be pointed to Poisson regression, which is a classic and well understood type of model. A simple trend test can be constructed by fitting exactly the model described by @Allan.
$$ \log(E[\text{Count} | \text{Year} ]) = \beta_0 + \beta_1 \text{Year}$$
Where year is continuously coded. The interpretation of $\exp(\beta_0)$ would be the expected Count at Year 0 (if you're starting at, say, 2000, best to center the variable at this value so that Year=1 corresponds to 2001 and so forth). $\exp(\beta_1)$ is then the average proportional increase in Count each subsequent year. So a value of 1 indicates no change at all, and a value of 1.1 indicates a 10% increase year-to-year. This is exactly the inference you will find in the standard model output. Is the trend parameter $\beta_1$ different from 0?
A probabilistically interesting trait about Poisson models is that the variance is exactly equal to the mean. Because of this, few observations with very large counts can lead to overly precise inference. A remedy with surprisingly implications in small sample sizes - specifically a small number of rows - is the use a quasipoisson model. In this case, we allow the variance to be proportional to the mean through a dispersion parameter. Unlike a parametric Poisson regression, the semiparametric quasipoisson method is not invariant to disaggregation. This means the number of rows in the dataset tell us something about our precision, which in many cases is an appropriate safeguard to overly precise inference.
A: You could use Generalized Additive Models (GAM) with a poisson distribution to model this. GAMs are very flexible, allowing you to model both linear and nonlinear effects for predictors. There are lots of good tools, blogs, and books out there. Specifically, look up the mgcv package (by Simon Wood) and the gratia package (by Gavin Simpson). The mgcv package provides an extensive set of tools for building GAM models and the gratia package will allow you to detect significant change points using the finite difference method with the derivatives() function.
The best intro I've found would be Simon Wood's book Generalized Additive Models An Introduction with R.
Some free courses are around the web too here is one and another by Gavin Simpson.
There are a ton of blogs out there too to get you started. Gavin Simpson has a blog where he goes into a lot of details about fitting time series data with GAMs and detecting change points etc here.
Here is a list of additional resources that has been compiled.
Good luck!
A: I don't know your specific problem, but seem that you can make a model in this fashion:
$$counts = time \beta$$
So if there is significance in your model you can analyze the signal of beta and another stuff.
