Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor error in growth rate calculation #251

Closed
drnickisaac opened this issue May 17, 2023 · 3 comments
Closed

Minor error in growth rate calculation #251

drnickisaac opened this issue May 17, 2023 · 3 comments

Comments

@drnickisaac
Copy link
Contributor

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
Copy link
Member

GPowney commented Jun 9, 2023

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.

GPowney added a commit that referenced this issue Jun 9, 2023
The growth rate function incorrectly used number of years rather than number of periods (in this case nyr-1).

related to #251
@FrancescaMancini
Copy link
Contributor

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

@DylanCarbone
Copy link
Collaborator

Will resolve in pull request #252

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants