Data are from the Paquid cohort, which is a longitudinal study of ageing with up to 20 years of follow-up . Recruitment of 3777 participants occurred across 75 civil parishes of the Gironde and Dordogne regions of south west France. Subjects were aged 65 years and above, residing at home at the study baseline in 1988. There have been up to nine subsequent waves of data collected on participating individuals at 1, 3, 5, 8, 10, 13, 15, 17, and 20 years after the baseline assessment. At the first follow-up, only subjects from Gironde were interviewed.
The ethical committee of the Bordeaux University Teaching Hospital approved the research according to the principles embodied in the declaration of Helsinki in 1988. However, all participants and their proxies were informed by the study investigators about the ongoing research activity and left free to accept/refuse their participation. Written informed consent was obtained from participants.
Cognitive assessment and dementia diagnosis
Cognitive ability was assessed using tests of global cognitive function (the Mini-Mental State Examination – MMSE ), verbal fluency (the sum score of four trials from the Isaac’s Set Test truncated at 15 s ), abstract thinking (the sum score from the first five pairs from the Wechsler Similarities Test ), episodic memory and learning (Wechsler Paired Associate Test ), processing speed (Digit Symbol Substitution Test ), and immediate visual memory (the Benton Visual Retention Test ). The tests were administered at each wave by trained neuropsychologists.
Incident dementia was diagnosed at each wave by a trained psychologist based on the Diagnostic and Statistical Manual of Mental Disorders, third edition, revised (DSM-III-R). Individuals with suspected dementia were further examined by a neurologist to confirm the diagnosis.
The social activity and potential confounder variables were observed at the study baseline. Age was used as the continuous time-scale in the model.
Four markers of late-life engagement and self-perception of social relationships were assessed: social, intellectual and physical engagement (engagement); size of social network (network size); satisfaction with social relationships (satisfaction); and self-perception of feeling well understood (understood). Twelve questions were used to create a scale for late-life social, intellectual, and physical engagement. Seven of the questions had a binary response; the other five were measured on a four point Likert scale. The binary response questions included playing sport, travelling, visiting family and friends, looking after others e.g., grandchildren, and participation in a club, association or a ‘golden age’ club. The Likert response questions asked about the following activities: reading, watching television, knitting or doing odd jobs, playing board games, and gardening. A dichotomous response was created by combining the Likert responses “yes without difficulty” and “yes, but with difficulty” into a yes category and “no, because of difficulties” and “no, for other reasons” into a no category. A multiple correspondence analysis showed no evidence for the partition of the data into separate factors (Additional file 1: Figure S1) hence a general engagement variable was created by splitting the sum score of the twelve questions into tertile-based groups (0–4 activities, 5–7 activities, or 8–12 activities). Size of social network was dichotomised about the median into large (≥8 people) versus small (<8 people). A subject’s satisfaction with their relationships was assessed using a 4 response Likert scale, which was also dichotomised into satisfied and dissatisfied. A subject’s perception of how they feel others understand them was also split into two groups – well understood and not well understood. Categorical coding was used for adjustment covariates: Instrumental Activities of Daily Living (IADL), depression, sequelae of stroke, ischemic heart disease (IHD), diabetes (all coded “present” versus “absent”, IADL was coded as none versus any), sex, marital status (4 categories: married, divorced/separated, widowed, or single) and education (3 categories: no education up to a non-validated primary school degree; a validated primary degree up to a non-validated secondary degree; and a validated secondary degree or higher).
Excluding individuals with no cognitive data or covariate data resulted in an analysis sample of 2854 participants (see flow chart in Additional file 1: Figure S2 for details).
Longitudinal cognitive change and dementia risk
Initially, cognitive decline and time to dementia were modelled independently. Evolution of the latent general cognitive factor underlying repeated measures of six cognitive tests was assessed using a linear mixed model with a quadratic age trend to account for non-linear mean cognitive decline . Age (re-scaled by subtracting 65 years from all data points) was used as the time scale for the model. Given that a previous longitudinal analysis of cognitive decline in the Paquid cohort found no evidence for cohort effects , age at baseline was not included as a covariate. Random-effects were included to account for the individual variation in the intercept and both the linear and quadratic slopes of decline. Education and sex were considered as covariates. All the covariates included an effect on the baseline cognitive level and both the linear and quadratic slopes of decline. To remove a learning effect that has been observed in Paquid , cognitive decline was considered from first follow-up onwards . A Cox proportional hazards model investigated the associations between the social activity variables and risk of dementia. Education, sex, and age at baseline were included as covariates. Schoenfeld residuals were examined to test the proportional hazards assumption. A sensitivity analysis also included further covariate adjustment for IADLs, depression, sequelae of stroke, IHD, diabetes, and marital status.
Joint latent class model
The joint latent class mixed model  (pictured in Additional file 1: Figure S3) combines the two sub-models: the linear mixed model on the underlying latent general cognitive factor and the proportional hazard model for time-to-dementia. Change in the general cognitive factor and dementia onset are linked through unobserved latent classes, which account for heterogeneity and represent sub-populations with different shapes of cognitive decline and risks of dementia.
Three sub-populations (latent classes) of cognitive ageing were identified by running this joint model with class-specific effects of sex and education on cognitive decline and class-common effects of sex and education in the survival (time-to-dementia) model. Full details of the modelling procedures are contained in Appendix 1 of the Additional file 1. Distribution of the lifestyle activity and self-perception variables across these classes were compared a posteriori using chi-squared tests for the categorical variables and analysis of variance (ANOVA) for the continuous measures.
Data were analysed using a Fortran90 programme (http://www.isped.u-bordeaux.fr/BIOSTAT) developed by Proust-Lima et al.  and in R  using the survival package .