rsd | R Documentation |
Calculates the coefficient of variation, also known as relative standard deviation, which is given by
sd(x)/mean(x)
rsd(x, as.percentage = TRUE, na.rm = TRUE, adjust = FALSE, adjust.lo = 1)
x |
Numeric: Input |
as.percentage |
Logical: If TRUE, multiply by 100 |
na.rm |
Logical: If TRUE, remove missing values before computation |
adjust |
Logical: If TRUE, if |
adjust.lo |
Float: Threshold to be used if |
This is not meaningful if mean is close to 0. For such cases, set adjust = TRUE
.
This will add min(x)
to x
## Not run:
mplot3_x(sapply(1:100, function(x) cov(rnorm(100))), 'd', xlab = 'rnorm(100) x 100 times')
# cov of rnorm without adjustment is all over the place
mplot3_x(sapply(1:100, function(x) cov(rnorm(100), adjust = T)), 'd',
xlab = 'rnorm(100) x 100 times')
# COV after shifting above 1 is what you probably want
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.