If you wife had been negative most of the time or most recently would make a difference.
Some people are naturally pessimistic and focus on the negative things. That is more of a personality trait and difficult to change.
If she has become negative more recently, she may be having some personal issues and instead of dealing with them, displacing her feelings onto others (in this case you)
This may be caused by different things such as feeling depressed, hormonal changes (a hormonal panel test can detect any abnormalities) or dealing with some kind of a stressor ineffectively (instead of addressing it, focusing on other things as a way of distracting herself)
One one to address this problem with her is when you find her in a more agreeable mood to make some time just to talk about it and for you to voice your concerns. She may feel that she is being attacked personally so a good approach would be to initially inquire as to how she's been feeling, if there is anything on her mind that may be upsetting or stressing her and then point out to her your observation. Instead of telling her that she's nagging, perhaps phrase it like "you seem unhappy or dissatisfied" Ask her if there are things that she would like to change and then let her know that her statements are affecting you and that you're not sure why she may be saying things like that. You can also inquire about how she would feel if you are always focusing on the negative.