If the function is nonlinear, there should be a starting value that the percentage is calculated from.
x <- -2
get_y <- function(x) {
y <- xˆ2
}
get_z <- function(x) {
z <- get_y(x) * x
}
get_result <- function(x) {
get_z(x)
}
I want to get a value that indicates what happens to z in % if we change x from -2 by 1%.
What do I need to do with get_result(x)
to get that?
Bonus: how would I create a dataframe of x and z values from these?