Those stars show your strenght.
Economic, depend on :
Number of Provinces. If you got small number of wealthy provinces, you are more likely to get more stars. But for more than 3 you need a COT. If you have big number of poor provinces if you have no COT, you may get 1-2 stars, if you got COT you will have at least 3. It counts not only your monthly income but also yearly.
Do you or don't you have any COT (if you don't it is max 3 stars - unless some special cirtumstances, if you got COT it is at least 3 stars, and ussualy 4-5)
Technology - if you lack in tech it is lower i think, if you're tech leader it is likely to be extremly high. That is why new world nations and african ones, ussualy get max 2 even with COT.
Tech group - i think but not sure about it. But it is tied with tech, so maybe that also count.
Buildings.
Military depends on:
Your current army
Other countries armies
Your land tech - if it is drasticaly low you will have it low anyway. Whatever incas can't ussualy get armies bigger than 30k...
Your army limit - most countries that are big but lost all their armies got it at least 3... ussualy. And if you are small but got quite big army, you ussualy get 3-4 stars, even if you got biggest or one of biggest armies. I think it has to do with manpower...
Also it depend on that, are you or not, at war.
Diplomatic depends:
On your prestige
On your current aliances
On your army/economy and your enemies strength
Relations with other nation i think
On techgroup, and gov tech i think.