Subgroup analysis is a common secondary objective in clinical trials. In oncology where the outcome is often binary (such as tumor response) or time-to-event (such as survival), subgroup analysis can be formulated using an interaction term in logistic or proportional hazards regression models. We focus on a case study of planning a randomized trial in metastatic colorectal cancer possibly involving a treatment-marker interaction. We present a method that can be used to compute the power of interaction tests for a given sample size or to compute the necessary sample sizes for a desired level of power for the planned subgroup analysis. The principle idea is borrowed from analysis of variance and uses appropriate contrasts after a variance-stabilizing transformation. This method is conceptually and operationally simple. It can be applied to binary- or ordinal-marker measurements, and existing sample size tables or software can be used. The accuracy of the approximation is shown to be reasonable by simulation studies.