We’ve addressed this before, and came down firmly against these over-simplified arguments. However, I like the way Wolfram’s Mathematica allows you to control, for variables like inflation, policy lag, etc.
In this Demonstration, you can compare what would happen if you left an investment in the stock market (represented by the Dow Jones Industrial Average), but only during those times when either a Democratic or Republican president was in office. Since economic policies can take awhile to take effect, you can choose to shift the time ranges allotted to Democrats vs. Republicans by a fixed amount from the date of the inauguration.
You can also choose whether to include the effects of inflation or dividend reinvestment.
Market Performance by Party? (No)