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

sim_stratmean using incorrect survey area and strata weights #14

Open
gavinfay opened this issue Feb 7, 2024 · 0 comments
Open

sim_stratmean using incorrect survey area and strata weights #14

gavinfay opened this issue Feb 7, 2024 · 0 comments

Comments

@gavinfay
Copy link
Contributor

gavinfay commented Feb 7, 2024

@AngeliaMiller & @CataRoman,

The function sim_stratmean() [in sim_stratmean_fn.R] is being passed an argument that is the survey area. This is independent of the strata that are used in the survey data frame, and that get joined to the data from strata_wts.
Thus, the calculations are based on the area of the total survey footprint, not the area of the strata used (so effective weights over strata won't sum to 1).
Can be fixed by having both the survey area to be used in the calculations, as well as the relative weights of each strata, be calculated within the function rather than being passed as arguments.

NB: I would also adjust this function so it only does one calculation, and have the looping (currently over simulations and years) occur outside of the function. But this seems like a lower priority than ensuring the calculations are being done correctly.

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

No branches or pull requests

1 participant