If I remember right to do this you can do it via lua using:
PedSetFaction(ped id, faction id) or PedSetFaction(ped id, faction id, true)
I never mapped out what each faction is which number since it is not the same as the factions listed elsewhere in the text based config files.