I know I'm a little late to the party here (18 months since OP) but I was searching for this answer also.
Carcer pointed to directions in the DMG, and following them I built a formula that calculates a creature's CR (More or less. It's not an exact science) from their AC, HP, Attack Bonus, Damage per Round, and whether they have significant resistances. I punched in the stats for all the dragons and was pretty happy with the results. I've attached an image of the output table here, in case anyone else stumbles onto this thread like I did.
Thanks Purple Monkey for showing me how to make a MathJax table:
Header Key:
W = Wyrmling.
Y = Young.
A = Adult.
N = Ancient.
S = Shadow Dragon.
L = Dracolich.
\begin{array}{r|llllllllll}
\text{CR by Type} & \text{W} & \text{WS} & \text{Y} & \text{YS} & \text{A} & \text{AL} & \text{AS} & \text{N} & \text{NL} & \text{NS} \\
\hline
Black & 2 & 3 & 7 & 11 & 14 & 15 & 16 & 21 & 22 & 22 \\
Blue & 3 & 4 & 9 & 11 & 16 & 17 & 18 & 23 & 23 & 23 \\
Brass & 1 & 1 & 6 & 10 & 13 & 14 & 15 & 20 & 20 & 21 \\
Bronze & 2 & 3 & 8 & 10 & 15 & 17 & 19 & 22 & 23 & 23 \\
Copper & 1 & 2 & 7 & 10 & 14 & 14 & 16 & 21 & 21 & 21 \\
Gold & 3 & 5 & 10 & 13 & 17 & 19 & 20 & 24 & 24 & 24 \\
Green & 2 & 3 & 8 & 10 & 15 & 16 & 18 & 22 & 21 & 22 \\
Red & 4 & 6 & 10 & 13 & 17 & 19 & 20 & 24 & 25 & 25 \\
Silver & 2 & 4 & 9 & 12 & 16 & 17 & 18 & 23 & 23 & 23 \\
White & 2 & 2 & 6 & 9 & 13 & 15 & 17 & 20 & 20 & 20 \\ \hline
\end{array}
As for the formula I used, it's difficult to transcribe as it frequently points to the lookup table "Monster Statistics By Challenge Rating" on page 274 of the Dungeon Master's Guide, and also the "Effective Hit Points Based on Resistances and Immunities" lookup table from page 277 of the same. I'll do my best to represent it here:
It starts by calculating [EHP] Effective Hit Points from the base monster's [HP] hit points, [CR] challenge rating, and type of "Significant Defense". A monster can have a significant defense type of [N] "None", [R] "Resistance", or [I] "Immune" as seen in the lookup table on 277. Since Shadow Dragons gain an irregular suite of resistances, I added a fourth, less potent option of [S] "Semi-Resistance" specifically for them. SD will equal a modifier between 1 and 2.
\begin{array}{r|lllll}
\text{SD by CR} & \text{N} & \text{S} & \text{R} & \text{I} \\
\hline
1-4 & 1 & 1.5 & 2 & 2 \\
5-10 & 1 & 1.25 & 1.5 & 2 \\
11-16 & 1 & 1 & 1.25 & 1.5 \\
17+ & 1 & 1 & 1 & 1.25 \\
\end{array}
$$
\text{EHP} = \text{Ceiling} (\text{HP} \times \text{SD})
$$
[EDCR] Effective Defensive Challenge Rating is a modified base CR found by looking up the EHP value under Hit Points on the 274 table and returning the listed CR.
Next you calculate the [DCR] Defensive Challenge Rating from the monster's EDCR, [AC] base Armor Class, and [EAC] Expected Armor Class. EAC is found by looking up the EDCR value as CR on 274 and returning the listed Armor Class. For every two points the AC is over the EAC, it should increment the DCR by 1.
$$
\text{DCR} = \text{EDCR} + \text{Floor}\left(\frac{\text{AC} - \text{EAC}}{2}\right)
$$
Next you need to calculate the monster's [DPR] Damage Per Round, which should be the maximum damage the monster can deal in a turn. Assume that a small area of effect attack will hit two targets, and a large one will hit three. Since a dragons breath weapon can't be used every turn and has a 1/3 chance of recharging, calculate the the [DBW] Damage of the Breath Weapon and the [DOA] Damage of Other Attacks separately.
$$
\text{DPR} = \frac{\text{DBW} + \text{DOA} + \text{DOA}}{3}
$$
[EOCR] Effective Offensive Challenge Rating is a modified base CR found by looking up the DPR value as Damage/Round on 274 and return the listed CR.
Next you calculate the [OCR] Offensive Challenge Rating from the monster's EOCR, [AB] base Attack Bonus, and [EAB] Expected Attack Bonus. EAB is found by looking up the EOCR value as CR on 274 and returning the listed Attack Bonus. For every two points the AB is over the EAB, it should increment the OCR by 1.
$$
\text{OCR} = \text{EOCR} + \text{Floor}\left(\frac{\text{AB} - \text{EAB}}{2}\right)
$$
The final Challenge Rating is the rounded average of DCR and ACR.
$$
\text{CR} = \text{Round}\left(\frac{\text{DCR} + \text{OCR}}{2}\right)
$$
You may now see why I didn't post the "formula" the first time, as it five times references lookup tables (six times, if you include finding the base CR from HP). Plus, it took me six hours to get it all together and working and I was too burnt out to "show my work". I hope this was helpful to someone.