Creates the transformation specification used by analyse() from an
expression in x. The expression is evaluated on the pooled estimate and
confidence limits; its symbolic derivative, obtained with D(), is used to
calculate the transformed standard error by the delta method. The
transformation must be monotone over every pooled confidence interval.
Usage
use_transform(
expression,
scale = paste(deparse(substitute(expression)), collapse = " ")
)Value
A list containing transform and derivative functions and the
scale label, suitable for the transform argument of analyse().
Examples
use_transform(exp(x), scale = "rate")
#> $scale
#> [1] "rate"
#>
#> $transform
#> function(x) {
#> eval(
#> transform_expression,
#> envir = list(x = x),
#> enclos = environment()
#> )
#> }
#> <environment: 0x64b9470b4898>
#>
#> $derivative
#> function(x) {
#> value <- eval(
#> derivative_expression,
#> envir = list(x = x),
#> enclos = environment()
#> )
#> if (length(value) == 1) {
#> rep(value, length(x))
#> } else {
#> value
#> }
#> }
#> <environment: 0x64b9470b4898>
#>
use_transform(-x)
#> $scale
#> [1] "-x"
#>
#> $transform
#> function(x) {
#> eval(
#> transform_expression,
#> envir = list(x = x),
#> enclos = environment()
#> )
#> }
#> <bytecode: 0x64b9485f16c8>
#> <environment: 0x64b9346b1268>
#>
#> $derivative
#> function(x) {
#> value <- eval(
#> derivative_expression,
#> envir = list(x = x),
#> enclos = environment()
#> )
#> if (length(value) == 1) {
#> rep(value, length(x))
#> } else {
#> value
#> }
#> }
#> <bytecode: 0x64b94768d418>
#> <environment: 0x64b9346b1268>
#>
