In this paper, we consider spectral clustering over data collected by a network of sensors. In this context, the spatial data distribution is not necessarily uniform and can further be affected by sensor noise. This is why we propose a new similarity measure for spectral clustering in sensor networks. This similarity function is derived as the p-value of an hypothesis test that has to decide whether two sensor measurements belong to the same cluster. Unlike other existing similarity measures, the p-value takes into account both the local data densities and the fact that the noise variance can vary from sensor to sensor. Simulation results show that the p-value leads to a better spectral clustering performance than the standard Gaussian kernel when there is some noise in the collected data.