A new metric for assortative and disassortative mixing in networks