I think you are confusing the goal with the means. The calculation of the PE is not the goal, the true goal is assessing whether a particular stock is an interesting investment opportunity (cheap) under an investment thesis (set of hypotheses).
Therefore, there is an infinite number of ways to calculate PE ratios, as a results of a set of different assumptions as well as a result of an infinite adjustments deemed necessary by the analyst (removing the contribution of one-off items, for example). This also explains why the definition of PE ratio, as per textbooks, is not really "precise" as you may otherwise expect coming from a more technical background.
It is hard to recommend a PE calculation methodology without knowing your investment thesis.
I believe that even under a panel data model framework the choice of PE should be motivate and interpreted through a fundamental approach. Let me make a couple of examples:
- Trailing 12M PE and Last FY: backward looking metrics tend to favor an "as-it-is" approach, ie assuming company bottom line might not change. Does the market "revalues" current bottom lines? What is the pattern there?
- Forward looking PE metrics: How far does the market look? 1-qr, 1-yr and 2-yr growth assumptions might offer different performances, although probably correlated as intuition suggests. @ProbablyPattern suggests the use of CAPE, it is a great hint.
- Sector rotation: different PE metrics might offer different performance in different industries and sectors.
- Different PEs might try to capture different market dynamics. You might even try to combine a few metrics - For example backward looking PEs and EPS growth expectations
- I guess it is important to understand what the choice of PE implies