BiologicalRecordsCentre / sparta

Species Presence/Absence R Trends Analyses
http://biologicalrecordscentre.github.io/sparta/index.html
MIT License
21 stars 24 forks source link

Minor error in growth rate calculation #251

Closed drnickisaac closed 2 months ago

drnickisaac commented 1 year ago

There is an error in our calculation of growth rate in occupancy. It's a geometric mean of the difference in occupancy. We have been using the nth root, where n is the number of years in the dataset. We should have been using n-1, since the growth rate is based on transitions between years.

For most applications, the difference is lost completely when reporting the trend to even three significant figures. But it should be corrected. The easiest place to do this is at line 173, to replace: nyr <- length(years) with nyr <- length(years) - 1

GPowney commented 1 year ago

Heads up @FrancescaMancini does this impact the trends we're sending to the State of Nature? Also @03rcooke, might impact your freshwater trends we discussed the other day.

FrancescaMancini commented 1 year ago

I suspect the difference in the trends will be neglible. You can close it for me.

DylanCarbone commented 2 months ago

Will resolve in pull request #252