Analysing large-scale structure - I. Weighted scaling indices and constrained randomization