Actually, there have been a couple studies that have shown pretty blatantly that IQ and Religiosity tend to be inversely proportionate. Which is to say that you are more likely to find Atheists/Agnostics among more intelligent people. I would daresay that Education would return a similar result.
There are plenty of exceptions, of course, but I believe these to be mostly the result of a 3rd and more important variable: Indoctrination. If they get it into you young and then bring you up in a religion-intensive environment (church community, mormons, etc), of course it would take an enormous force of will to break free.