That sort of observation is really tough to untangle from potential confounding variables though. Seems to me that the causation could go in the other direction just as easily - maybe people who generally have an optimistic outlook on things are more likely to overlook their own flaws and rate their abilities more highly, and vice-versa for depressive types?