I'm trying to create an animal companion (first time ever!) in Pathfinder. The GM has said I can have a hedgehog at level 4, even though it's not on the standard list. My problem is that I can't figure out how to apply the Animal Companion Base Statistics Table to the Bestiary entry in order to customize my companion. Is there a step-by-step guide similar to this 3.5e answer, but for Pathfinder? If not, perhaps someone can help walk me through the process, because I'm finding all sorts of information from multiple different sources and can't seem t put it all together into a coherent whole...
The best way to approach this is to look at other animal companions that are roughly where you want to end up. A common example is the wolf:
AC 14, hp 13 (2d8+4) Fort +5, Ref +5, Will +1 Speed 50 ft. Melee bite +2 (1d6+1 plus trip) Str 13, Dex 15, Con 15, Int 2, Wis 12, Cha 6 Base Atk +1; CMB +2; CMD 14 (18 vs. trip)
So, you're shooting for 2 HD, +1 BAB, total attribute bonuses of roughly +6 (excluding Int and Cha), a single attack at +2 for about 1d6+1 damage, and one special ability. Now that you know your target, find something already close that fits the theme you're looking for.
You want a hedgehog, which has no natural attacks and is more in the "familiar" territory than an animal companion. That presents some challenges, but hedgehogs defend themselves with quills, as do porcupines. Looking at the giant porcupine, it has the following stats:
AC 13, hp 22 (3d8+9) Fort +6, Ref +6, Will +2 Speed 40 ft. Melee tail slap +6 (2d6+4) Str 17, Dex 12, Con 16, Int 2, Wis 13, Cha 5 Base Atk +2; CMB +5; CMD 16 (20 vs. trip)
Comparing with the wolf, you've got 1 extra HD, +1 higher BAB, +1 on all saves, +4 higher attack, over twice the damage, -10 ft movement, and 2 higher stat bonuses. Most of the problem can be solved by dropping one HD, two points from Str, and two points from Con. Since hedgehogs don't have tails that could reasonably inflict damage, swap that attack for a slam. You end up with the following stat block:
N Medium animal
Init +1; Senses low-light vision; Perception +5
AC 13, touch 11, flat-footed 12 (+1 Dex, +2 natural)
hp 13 (2d8+4)
Fort +5, Ref +6, Will +1
Defensive Abilities quills
Speed 40 ft.
Melee slam +3 (1d6+1)
Str 13, Dex 12, Con 14, Int 2, Wis 13, Cha 5
Base Atk +1; CMB +2; CMD 13 (17 vs. trip)
Feats Lightning Reflexes, Weapon Focus (tail slap)
Skills Climb +5, Perception +5
Quills (Ex) Any creature attacking a giant porcupine with light or one-handed melee weapons, natural weapons, or an unarmed strike takes 1d3 points of piercing damage. A creature that grapples a giant porcupine takes 2d4 points of piercing damage each round it does so.
At 4th level, advance the statistics to be that of the giant porcupine listed in the Bestiary 1, with the tail slap -> slam substitution. Otherwise, advance as normal for animal companions.