The explanations below are correct. I would just add that it was the custom to change the "M" in rhyming nicknames for women to "P". So not only does
Peggy come from Margaret/Meggie, but
Polly comes from Mary/Molly and
Patty and
Patsy came from Martha/Matty.
Patricia was not used as a name in English until the 19th century, but there were plenty of women called
Patty or
Patsy before then -- they were officially "
Martha".