wtedmean | R Documentation |
wtedmean solves the problem of calculating a weighted mean value from a set of values with different weights. Within the aMSE this is common when trying to summarize across populations within an SAU or summarize SAU within a zone by finding a mean value weighted by the respective catch from each related population or SAU.
wtedmean(x, wts)
x |
the values whose weighted mean is wanted |
wts |
the weights to use, often a set of catches |
a single real number
saucpue <- c(91.0,85.5,88.4,95.2)
saucatch <- c(42.0,102.3,75.0,112.0)
wtedmean(saucpue,saucatch)
saucatch/sum(saucatch) # the relative weights
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.