This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Spatial correlation between two continuous variables

Hi,

Is there a metric that I can use to measure the spatial correlation between two continuous variables? I am aware of the Moran's I or cross-K function to test attraction or repulsion between two categorical features, but I am not aware of a metric to test the same for continuous variables (e.g., correlation between two gene expression)

thanks

spatial transcriptomics correlation

2 answers

Yes. You can just use correlation: cor(X_{ij}, Y_{ij}).

X <- matrix(rnorm(20), nrow=4)
Y <- X + 0.5 * matrix(rnorm(20), nrow=4)
cor(as.vector(X), as.vector(Y))
[1] 0.8943591

Looks at bivariate metrics like Lee’s L

https://link.springer.com/article/10.1007/s101090100064

Log in to answer this question.