I performed a mantel test on data from an elevation gradient with a distance of about 14 km. Additionally, I did another mantel test where elevation was held constant, but the distance was only for about 5 km. I got a significant mantel value for the elevation and a flat value for distance. However, since the distances are not comparable, I want to do a sliding window regression along the elevation gradient in order to compare the distance with the elevation.
I was able to split the elevation gradient into different segments and graph a regression line for each. However, now I want to calculate mantel on each of those to make them comparable, but when subsetted my data, I had to make the other values NAs, and my matrices are now NAs swiss cheese.
My question: Is there a way to calculate mantel with all the NAs? I’ve tried with no success. I cannot change the values to zeros because my y-axis is community dissimilarity, and a value of zero means the communities are exactly the same.
I hope my situation and question are clear enough.