0

How can I transform the following dataset to a more linear representation? R code:

x <- 1:20
y <- c(101, 84, 81, 80, 73, 69, 67, 63, 63, 62, 62, 61, 61, 60, 59, 58, 57, 57, 57, 55)
d <- data.frame(x, y)

ggplot(d, aes(x, y)) + geom_point()

enter image description here

Here is a log version, almost no change:

ggplot(d, aes(x, log(y))) + geom_point()

enter image description here

That is, I have several datasets that look somewhat exponential, like this example, but taking a simple log isn't good enough to produce the level of linearity I need. What can I do to get more linearity?

Figaro
  • 1,152

1 Answers1

1

I would suggest using lm(log(x),log(y)) to look for power law relationships between the variables. The gradient it outputs in this case is very close to -5, suggesting we try plot(x,y^-5).