Semiparametric nonhomogeneity analysis