Challenge rating is only a guidepost that indicates at what level that monster becomes an appropriate challenge.
Challenge Rating of a monster is a very useful guide for judging the difficulty of an encounter.
Formula to calculate challenge rating.

This formula apply to the other levels except level 10, 14-16, 18, and 19 where the monster one CR lower than APL still yields a Medium encounter.
APL is the average level party.
Example:
Suppose your APL is 5, calculate the challenge rating.

Therefore, the challenge rating is 4.