It is well recognized that the benefit of medical interventions may not be distributed evenly in the target population due to patient heterogeneity, and conclusions based on traditional randomized clinical trials do not apply to everyone. Considering the increasing cost of randomized trials and difficulties in recruiting patients, there is an urgent need to develop analytical methods to estimate treatment effects in subgroups. In particular, due to limited sample sizes of subgroups, standard analysis tends to yield wide confidence intervals for the treatment effect, which are often uninformative. In this article, the superiority of the empirical Bayes estimate of the conditional average treatment effect is demonstrated by using a linear regression model to specifically represent treatment-covariate interactions. To obtain more accurate prior distributions and posterior estimates of treatment effects in subgroups, we utilize the covariate-dependent precision parameter across subgroups. Based on subgroup data obtained from clinical trials, the covariate-dependent precision parameter is used to assess the similarity of treatment effects across subgroups, which is an approach to obtain more reasonable prior information. To verify the validity of the empirical Bayes method, we evaluate it by a real clinical trial comparing insulin and metformin.