Remember that the above link is a guideline, mostly for experience from an encounter, not necessarily how well the party will do in the encounter. Finding the balance can be difficult. Wading through goblins is fun, but the best gaming stories are those the players feel their characters barely survived. And CR doesn't always cover it.
Things the book says that I take into consideration:
1. Player experience and cleverness. An experienced player can handle higher CR, and an inexperienced player can get pounded by an equal CR.
Creature/NPC Intelligence/Wisdom. If the creatures/NPCs are adults, and they've survived that long in the wild/dungeon/city, they've seen things, faced threats, and survived. They know don't focus all your attention on the big armored guy, they'll run & hide to come back later, or they've seen magic before, and either specifically target or avoid those who have it.
My rule of thumb is, Int/wis of 8-10 is a human level mind, act it. And if the creature has a higher int/wis than some of the players, then it can out-think them and even partially predict their actions. If it's grossly higher, then it'll likely be able to predict the characters choice of actions. Though you can make Int/Wis rolls for that if you like.
Give your players a simple little adventure to test them out before you jump them into the campaign you worked so hard on.