STUDY OBJECTIVES: To examine the cognitive function in a large, ongoing cohort study of older men, and to identify associations with social and lifestyle factors. DESIGN: A cross sectional study of cognitive function was conducted within the Caerphilly Prospective Study of Heart Disease and stroke. SETTING: The Caerphilly Study was originally set up in 1979-83 when the men were 45-59 years of age. Extensive data are available on a wide range of lifestyle and other factors of possible relevance to cognitive decline. Associations between some of these and cognitive function are reported. PARTICIPANTS: A representative sample of 1870 men aged 55-69 years. MAIN RESULTS: Age, social class, medication, and mood were found to be powerful determinants of performance. Self report data on the involvement of the men in leisure pursuits were examined by factor analysis. This indicated that the more intellectual leisure pursuits are the most strongly linked with performance. A measure of social contact showed a weak positive association with the test scores. Current cigarette smokers gave lower test cognitive function scores than either men who had never smoked, or ex-smokers. There was however no evidence of any gradient in function with the total lifetime consumption of tobacco. The disparity between these two data sets suggests that there had been prior selection of men who had originally started to smoke, but more particularly selection of those who later quit smoking. There was no significant association between alcohol consumption and cognitive function, though ex-drinkers had markedly lower test scores than either current drinkers or men who had never drunk alcohol. This seemed probably to be a consequence of an high prevalence of illness among the ex-drinkers. CONCLUSIONS: Age and social class show strong associations with cognitive function. Leisure persuits and social contact are also both positively associated. Neither tobacco smoking nor the drinking of alcohol seem to be associated with cognitive function, though there is evidence suggestive of self selection of both men who had never smoked and ex-smokers.