My guess is that she does it to get attention. When you step back and look at the facts....I see you have a 3 month old as well. Chances are that your 2 year old was getting all the attention until the baby came along.....and now she has to share her home, her time and her mommy! This is confusing to a 2 year old, but she lacks the verbal skills to discuss it with you! She has discovered that her screaming gets you to drop everything and deal with her! Even a spanking, which is negative attention, is still attention. It is hard to ignore a screaming child, especially in public, but that's exactly what you have to do. Pay her no attention whatsoever. When she's NOT screaming, give her lots and lots of love and attention. If she does it in public, take her outside if you have to...but don't even look at her or acknowledge her when she is behaving that way. You need to send a loud and clear message....through your actions, not just words....that screaming is not the way to get your attention and in fact will have the opposite effect. If you're home, walk away from her when she starts to scream (of course be sure she is safe).
Also, if you can, try to find a way to have someone else take care of the baby for an hour or so, so that you and your 2 year old can have some one-on-one time together. Take her to the playground or beach, or take a swimming class together....something where she gets you all to herself. What she needs most right now is to feel loved, because in her little world, the love was cut in half when she had a sister! Of course that is not true, but she cannot understand that. Make sure you praise her for her good qualities and for being a big girl. Even let her help you take care of the baby a little bit....let her see that being the big sister is actually a good position to be in!