I have weekly data from a lake over 3 months and I want to see if there is a correlation between concentrations of algae and richness of the bacterial community (number of bacterial taxa). However, both of these variables show temporal autocorrelation. Is there a way to construct a linear model to measure the effect of algal concentrations on bacterial richness while removing the effects due to time?
Could you specify what you mean specifically by the phrase "removing the effects due to time"?
If you have variables which are autocorrelated across time, you could model your processes using an ARMA, where your choice of specification depends on the Box-Jenkins Methodology. ARMA Models are linear models which can help you measure both the short term and long term effect of algal concentrations on bacterial richness.