It’s bothered me not knowing how the CP values on the hero cards are calculated. Here is some preliminary work on this:

Looking solely at the CPs of fully ascended 4* and 5* heroes, excluding last year’s Spring event, a simple linear regression gives a very good, but not perfect, fit using the formula:

CP = 40.26 * Stars + 5 * SpecialLvl + 0.2030 * Attack + 0.1650 * Defense + 0.080 * Health + 0.845 * Event + 3.62 * HotM

Standard error = 0.7595

Adjusted R-squared = 0.9808

So, 4* heroes start with a base of about 321 points (including the value of 8 levels of special attack) and 5* with a base of about 401. Attack is valued about 20% per point, while defense is about 16.5% per point, and health half of that.

The Event and HotM variables control for an effect I saw scanning the residuals from the simple form of the regression: Event heroes and, particularly, Heroes of the Month had CP values that didn’t line up with their estimated values. Event heroes have a small but statistically significant boost (0.845 points, P-value=0.3%). HotM have large and highly significant boost (3.62 points, P-value=1.7E-15). This suggests that SG just pins the HotM CP at 777 regardless of the underlying stats. I expect they’d rationalize that boost by pointing to the extra power of the special, but that opens a whole can of worms about trying to compare the value of specials across heroes.

BTW, I excluded Master Lepus and Jack O’Hare, specials from the Spring 2017 event, as they were large outliers and, as early one-off heroes, probably don’t tell us a lot about the current CP formula.

I intend to improve this calculation by adding in data from incomplete ascensions and 3* heroes. Anyone who’s got data they’d like to contribute, please throw it my way!