Skip to content
Prev 17680 / 398503 Next

linear correlation?

Hello
dechao wang wrote:
No, that will give different results. The unit must be the same for all
values. Which unit isn't important, but it must be the same
If you have a vector with the units, you can use it to bring all values
to the same unit

eg (for two different units, if there are more it will be more
complicated)
xu <- c('m','m','m','cm','cm','cm') #units
cor(ifelse(xu=='m',100,1)*x1,ifelse(xu=='m',100,1)*x2)

gruess

joerg