If you are too close, you will be gone anyway, no matter where you hide if it's a reasonably big nuke.
If you are lucky enough to be far away for surviving the initial blast, including heat and radiation, getting inside a stable structure might make sense.
The biggest danger (except of raiders and mutated geckos) for survivors of an attack will be radiation from nuclear fallout I guess.
A useful rule-of-thumb is the "rule of sevens". This rule states that for every seven-fold increase in time following a fission detonation (starting at or after 1 hour), the radiation intensity decreases by a factor of 10. Thus after 7 hours, the residual fission radioactivity declines 90%, to one-tenth its level of 1 hour. After 7*7 hours (49 hours, approx. 2 days), the level drops again by 90%. After 7*2 days (2 weeks) it drops a further 90%; and so on for 14 weeks. The rule is accurate to 25% for the first two weeks, and is accurate to a factor of two for the first six months. After 6 months, the rate of decline becomes much more rapid. The rule of sevens corresponds to an approximate t^-1.2 scaling relationship.
Assuming that a building will shield you from good parts from the radiation of the fallout (should work if its mostly alpha and beta radiation), staying inside could really improve you chances to survive.
Actually, finding a skyscraqer and setting up camp in the middle might work quite well, as you will be far away from the fallout on the streets and on the roof of the building.