How to assess a trend during time?

I wanted to know which analysis method would you suggest for assessing a trend during years. Let us say we have data on antibiotic resistance in a particular bacteria from 2010 until 2021. How can we determine that this resistance was increased or decreased and how much it is changed during this decade? Which method would you suggest?

Topic data-analysis rstudio python

Category Data Science


My way is to plot it out first to get a sense of the change with bare eyes, and then take out the trends one by one.

If you suspect for any periodic change, then you may do a discrete fourier transform to find out those significant frequencies. After that remove them from your data, and then look at the residual again.

If you can see a clear monotonic trend, then you may simple fit a linear function (if it is linear) to it. After that, remove the linear trend from your residual, and look at the latest residual again.

If you believe there are some auto-correlation, you need to do auto-regression analysis, you may google ARIMA for more details.

If you can keep removing patterns until the final remaining residual is simply white-noise, then you have isolated out all the trends, and you can answer your questions quantitatively based on those trends.

You can stop earlier if you don't worry about auto-correlation.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.