Imagine I have two large arrays of 0's and 1's representing locations along a one-dimensional spatial domain, where: $$ X = \text{Locations where the error is high},\\ Y = \text{Locations where data quality is poor}. $$ These paired arrays are boolean, with each entry indicating whether an error is high or data quality is poor at that location. The locations are ordered spatially, meaning that adjacent locations are closer than non-adjacent ones.
I want to understand whether high-error regions tend to correlate with poor data quality regions. Given the binary nature of the data, would the Chi-squared test or phi coefficient be appropriate to test this correlation, or would there be a better statistical approach to account for the spatial structure?