Honestly, I feel that's a personal choice. If you feel that Dilithium is something you don't get enough of and is too hard to come by then maybe you'd rather save it for something important. You can get perfectly good items by just spending Energy Credits, or by crafting them. Then again, there are some really good items that can be purchased only with Dilithium. If you don't mind putting in the work to get Dilithium to buy the item then by all means, do it.
If I have to make a quick estimate of a ratio I would say 50 or 100 energy credits to 1 dilithium. I never really looked into this so my numbers might be way off.
Really, it is just a matter of looking at each item, comparing their stats, and seeing which you like better.
I would like to add that from NPC stores, Mk XI items can only be purchased with Dilithium.
I also feel that Energy Credits should be merged into the Dilithium system.
At least this would give more demand for Dilithium, if you can actually buy in-game items!
I disagree. Energy Credits are used for easily obtainable items. Dilithium is used for harder to find items. This is also why Dilithium is harder to get as compared to Energy Credits. If they were merged than everyone would be getting millions of Dilithium and could buy anything.
I could use an additional 200 million EC to buy a Jem'Hadar ship.
But I'd love to have some Dilithium to buy up DOffs when I get the chance.
It's really a matter of what you need at any given time. But personally, I'd say EC, because it's easier to earn and more versatile a currency than Dilithium. Dilithium's also more valuable and it's good to save it for the really valuable, one of a kind items. EC's more of a staple currency.
Kinda like comparing dollar bills to gold. Everyone lusts for gold, but try paying for your groceries with a Gold Krugerrand.