The Rules of Shadowrun 4th Ed
Guidelines for determining typical opposition are provided in the Grunts section detailing Professionalism Ratings starting on p281 of SR4Anniversary Edition. Sample groups, their tactics and gear, as well as their reactions under fire are provided. The default assumuption appears to be that these groups exist, the characters are able to inform themselves of what threats exist, and therefore can choose to engage or not, or at least how to engage.
What I mean by this is rather than the GM deciding that the group should run into a group of gangers, the GM and the players are aware of where in the city groups of gangers normally hang out. If the players cross those zones, they know what they are risking, and can be prepared accordingly. Likewise, if they choose to go up against corporate guards, or they know that a corp might hire a hit squad if they get wind of runners sniffing around, they have a sense of what that means.
Run Playtests, Track the results with the players
I don't think you can find clear-cut threat ratings for opposition in the game. While you can generate your own guidelines by carefully tracking what your PCs are capable of getting their hands on, and track the statistics of what numbers of similarly equipped opponents they can handle easily, with difficulty, or only with great sacrifices, you might need to consider another approach.
If you prefer to use a rubric to determine threat ratings, and given the wide variety of options open in the game, experimenting to inform both yourself and the players about the effects these different options can contribute, their average performance with the stats and gear they have, and the limitations of equipment, spell, and skill combinations is a good use of time so that each person has an effective in-universe perspective on what a typical combat will be like.
If nothing else, this will let you become accustomed to setting appropriate die pools for planned and unplanned encounters which won't produce any unwanted outcomes, such as butchering the players by accidentally outclassing them. Once this is done, even if your calculations of a threat are a little off, the players will have enough combat experience to make better tactical decisions - including breaking off the engagement if they notice that the fecal matter is being randomly deployed by an oscillation device.
Allow the players to make informed choices
Information is the real weapon for any successful group of runners. Approach the design of the play environment as you would any other sandbox setting and stat things out according to what makes sense. How many guards does Renraku put in patrol units in their holdings? What gear would they assign? What conventional and runner threats do they normally face and how does this reflect their numbers and loadout? The same holds true for the gangers. What kind of gear can their resources realistically access in the setting you are building? How do they support themselves? How many individuals can those resources support? How famous is this gang, and what are they known for?
Provide information about regions in the city to the characters who are from there. Remind them of it as they cross into those territories so that they know to be as prepared for threats as their characters would be just by virtue of having lived there. Give them the information that they need to choose a threat or choose to walk away, to obtain the specialized gear they might need to neutralize a threat, or to opt for extreme stealth.
In short, set potential encounters, determine the amount of intel that can exist about the threats surrounding those encounters. Make the common knowledge and common sense about the encounter truly common in the player group. Let the group choose to act or not.
Surprise encounters can still happen
Outside of runs and planned encounters, the determination of opposition can still be handled without using published threat ratings, or needing to go beyond those provided in the core book.
If events in the session dictate that something should happen, such as an out of the frying-pan and into the fire kind of event, you can run a seat-of-the-pants encounter by focusing on the characters in it. Build the location for this surprise encounter to allow for interesting and effective tactical choices, including retreat. Remember the pain and shock of injury and possible death can totally demoralize untrained or unprepared groups and make surrender, retreat, or crazed scattering seem like a good idea.
Have a reason for any encounter to take place, and make sure that both you and the players can evaluate the importance of completing their run versus staying in an unexpected firefight 'til the bitter end. Why are the gangers in that territory? Where are they going and why? From where? Who sent them? If they are on their own turf and the PCs intrude, why don't the PCs know about them? What violent and non-violent options are open to both sides?
This is not so much about threat rating as it is about internal consistency in the setting, and the ability of characters to operate realistically within it.
That would be misleading as there is no correlation between CR and PC level.
However, there is a guideline in page 283 of the Dungeon Master's Guide under "Monsters with Classes". It doesn't help very much, honestly, and I ended up having to:
1.) Modify a Monster
Page 273 of the DMG gives us an idea of simply taking stats from an existing creature in the Monster Manual and modifying it to our needs. This is, by far, the easiest way to make a monster. For your case, I would choose an Evil Mage Stat Block and add Sorcerer levels to it. This would have the following effects to it:
- It gains Hit Dice of its normal type (d4 for tiny, d6 for Small, d8 for Medium and so on...) for each level you add to it.
- It gains Sorcerer features of your choice, the benefits to this are not reliably quantified so you should judge for yourself if the class level added would increase the creature's CR.
What I found while tinkering with adding PC classes to NPCs is that for each relevant class level added, you increase the CR by 1. (I found an answer supporting this, but although it is for Pathfinder, it should give you an idea of how CR increases in relation to adding Class levels). For example, adding 3 levels of Barbarian(a relevant class) to my Bugbear NPC (CR 1) made him CR 4, pitting him and a few of his lackeys to balance out the encounter made for a fun challenge for my group.
Caveat: A sorcerer level would most likely not increase an Evil Mage's CR by a full 1, play testing and additional calculations will be needed. The reason for this is because an Evil Mage already has "Spellcasting", which reduces the "added value" of a Sorcerer level to be limited only to the Sorcerer's features until she gains more Sorcerer levels than her current spellcasting ability.
2.) Give her Legendary Actions
The downfall of solo creatures versus a party is that one side is limited to the number of actions per round it can do and in the case of the poor solo, he gets 1 Action while the players have as many Actions as they have players. This is why page 82 of the DMG raises the budgeted XP for an encounter for every creature pitted against a party. So it is a good idea to give a solo creature Legendary Actions.
Legendary Actions are a specific set of Actions a creature can take in between another creature's turn, giving more Actions (usually, 2-3 more) to the poor solo-creature.
Caveat: Legendary Actions count when calculating DPR for your OCR, adjust accordingly.
3.) Give her Legendary Resistance
Another problem for a solo creature is that it will get debuffed by a PC, and once one debuff lands, it's basically at the PC's mercy (which tends to be not a lot). Legendary Resistance gives the creature the option to succeed on a failed Saving Throw which increases its survivability against a full party with spells flinging left and right against her. Legendary Resistance increases a creature's Effective HP for each use depending on the CR as shown in DMG page 280.
When taken all together, your Evil Mage should be ready take on a party of 4 by her lonesome.
Best Answer
Use the encounter building guidelines in the Dungeon Master's Guide
Encounter building tools can be found in the Dungeon Master's Guide, page 81 on. They can also be found in DnD Beyond (which can also do the math for you).
For example, an encounter against ten homunculi would have an adjusted XP value of (2.5 × 10 × 10XP) = 250XP, where 2.5 is the multiplier for 7-10 hostiles, 10 is the number of the homunculi, and 10XP is the experience value of a single homunculus. For four level 1 PCs, this encounter would qualify as Medium.
To get the XP value for monsters in an encounter, you can use the CR to XP table on Monster Manual page 9. Each monster's XP value is also included in its stat block. CR 0 monsters are worth 0 or 10 XP depending on whether they have a proper attack or not.
The slightly modified encounter building scheme of Xanathar's Guide to Everything (also available in DnD Beyond) presents a simpler, not quite equivalent form:
Remember that while the encounter difficulty calculation is a useful tool in normal situations, it's always the best to weigh the output against the strengths and weaknesses of the particular party you are placing the encounter against.