CV2se: Helper functions

Description Usage Arguments Value Note Author(s) Examples

View source: R/helper.R

Description

Calculates the standard error or the mean squared error from a given CV and vice versa for log-normal data.

Usage

1
2
3
4
CV2se(CV)
se2CV(se)
CV2mse(CV)
mse2CV(mse)

Arguments

CV

coefficient of variatio as ratio (not percent)

se

standard error

mse

mean squared error (aka residual variance)

Value

Returns
se = sqrt(log(CV^2+1))
CV = sqrt(exp(se^2)-1)
mse = log(CV^2+1)
CV = sqrt(exp(mse)-1)

Note

These functions were originally intended for internal use only but may be useful for others.

Author(s)

D. Labes

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# these functions are one liners:
CV2se <- function(CV) return(sqrt(log(1.0 + CV^2)))
se2CV <- function(se) return(sqrt(exp(se^2)-1))

CV2se(0.3)
# should give:
# [1] 0.2935604 

se2CV(0.2935604)
# [1] 0.3 

Example output

[1] 0.2935604
[1] 0.3

PowerTOST documentation built on Jan. 18, 2021, 5:07 p.m.