Inference for Two-Sample and Regression Models with Heterogeneity Effect: A