You can avoid starvation by having a surplus of food. Most players try to balance their food supply so that they have a small buffer for growth. Maintaining too high of a stockpile can be an inefficient use of your production capabilities but having too many farms.
[Total Casualties] = min([Missing food] * 2, [Total Population] * 0.02)
[Total military casualties] = [Military %]
[Total peasant casualties] = [Peasant %]