This document contains the descriptive statistics (number of non-missing observations, mean, standard deviation, minimum value, maximum value and internal reliablity, where relevant) of the variables used in the current coordinated analyses. We provide the code used to generate this table, which calls upon our analysis summary objects (also provided).
Variable | N Valid | Mean | SD | Min | Max | \(\alpha\) |
---|---|---|---|---|---|---|
EAS | ||||||
age | 574 | 78.98 | 5.21 | 69.00 | 94.00 | |
edu | 574 | 14.46 | 3.33 | 3.00 | 24.00 | |
neur | 574 | 2.10 | 0.63 | 1.00 | 4.00 | 0.74 |
con | 574 | 3.81 | 0.64 | 1.00 | 5.00 | 0.79 |
extra | 574 | 3.32 | 0.63 | 1.20 | 4.90 | 0.76 |
agree | 574 | 4.05 | 0.53 | 2.00 | 5.00 | 0.72 |
open | 574 | 3.68 | 0.62 | 2.00 | 5.00 | 0.70 |
HRS | ||||||
age | 19211 | 66.26 | 11.16 | 25.00 | 105.00 | |
edu | 19211 | 12.66 | 3.13 | 0.00 | 17.00 | |
neur | 19211 | 2.07 | 0.63 | 1.00 | 4.00 | 0.71 |
con | 19211 | 3.35 | 0.49 | 1.00 | 4.00 | 0.66 |
extra | 19211 | 3.19 | 0.56 | 1.00 | 4.00 | 0.74 |
agree | 19211 | 3.52 | 0.49 | 1.00 | 4.00 | 0.78 |
open | 19211 | 2.94 | 0.57 | 1.00 | 4.00 | 0.79 |
LBC1936 | ||||||
age | 962 | 69.50 | 0.84 | 67.61 | 71.30 | |
edu | 962 | 10.77 | 1.12 | 8.00 | 14.00 | |
neur | 962 | 1.43 | 0.64 | 0.00 | 3.92 | 0.87 |
con | 962 | 2.89 | 0.50 | 0.92 | 4.00 | 0.86 |
extra | 962 | 2.25 | 0.49 | 0.50 | 3.58 | 0.79 |
agree | 962 | 2.79 | 0.44 | 1.42 | 3.92 | 0.74 |
open | 962 | 2.17 | 0.48 | 0.75 | 3.58 | 0.72 |
LBLS | ||||||
age | 898 | 64.81 | 13.19 | 30.00 | 97.00 | |
edu | 898 | 14.81 | 2.72 | 4.00 | 23.00 | |
neur | 898 | 1.75 | 0.43 | 0.46 | 3.40 | 0.89 |
con | 898 | 2.19 | 0.35 | 0.88 | 3.44 | 0.83 |
extra | 898 | 2.27 | 0.34 | 1.52 | 3.55 | 0.81 |
agree | 898 | 1.58 | 0.37 | 0.31 | 2.62 | 0.86 |
open | 898 | 2.49 | 0.35 | 1.42 | 3.56 | 0.86 |
MAP | ||||||
age | 653 | 79.69 | 7.13 | 56.14 | 96.93 | |
edu | 653 | 15.00 | 2.97 | 4.00 | 28.00 | |
neur | 653 | 2.25 | 0.59 | 1.00 | 4.75 | 0.86 |
con | 653 | 4.79 | 0.49 | 2.50 | 6.00 | 0.81 |
extra | 653 | 3.66 | 0.52 | 1.83 | 5.00 | 0.69 |
MAS | ||||||
age | 879 | 78.71 | 4.78 | 70.29 | 90.80 | |
edu | 879 | 11.74 | 3.55 | 3.00 | 24.00 | |
neur | 879 | 1.68 | 0.79 | 0.00 | 4.17 | 0.89 |
con | 879 | 2.96 | 0.51 | 1.50 | 4.75 | 0.78 |
open | 879 | 2.51 | 0.62 | 0.92 | 4.33 | 0.75 |
MIDUS | ||||||
age | 6245 | 46.84 | 12.91 | 20.00 | 75.00 | |
edu | 6245 | 6.85 | 2.48 | 1.00 | 12.00 | |
neur | 6245 | 2.24 | 0.66 | 1.00 | 4.00 | 0.75 |
con | 6245 | 3.42 | 0.44 | 1.00 | 4.00 | 0.56 |
extra | 6245 | 3.20 | 0.56 | 1.00 | 4.00 | 0.78 |
agree | 6245 | 3.49 | 0.49 | 1.00 | 4.00 | 0.81 |
open | 6245 | 3.02 | 0.53 | 1.00 | 4.00 | 0.78 |
NAS | ||||||
age | 992 | 64.57 | 7.46 | 47.00 | 85.00 | |
edu | 992 | 2.02 | 1.11 | 1.00 | 5.00 | |
neur | 992 | 4.45 | 0.94 | 1.00 | 7.30 | |
con | 992 | 6.84 | 0.93 | 2.65 | 9.00 | |
extra | 992 | 5.63 | 0.88 | 2.40 | 8.00 | |
agree | 992 | 6.82 | 0.88 | 3.10 | 9.00 | |
open | 992 | 6.12 | 0.91 | 2.75 | 8.79 | |
OATS | ||||||
age | 534 | 71.40 | 5.55 | 65.08 | 90.06 | |
edu | 534 | 11.30 | 3.42 | 2.00 | 26.00 | |
neur | 534 | 2.34 | 0.59 | 1.00 | 4.25 | 0.85 |
con | 534 | 3.85 | 0.44 | 2.00 | 5.00 | 0.81 |
extra | 534 | 3.32 | 0.47 | 1.75 | 4.73 | 0.77 |
agree | 534 | 3.87 | 0.42 | 2.42 | 5.00 | 0.75 |
open | 534 | 3.33 | 0.49 | 1.67 | 4.75 | 0.75 |
ROS | ||||||
age | 1394 | 75.95 | 7.47 | 55.78 | 102.15 | |
edu | 1394 | 18.35 | 3.30 | 3.00 | 30.00 | |
neur | 1394 | 2.39 | 0.49 | 1.00 | 4.00 | 0.80 |
con | 1394 | 3.84 | 0.42 | 1.92 | 5.00 | 0.80 |
extra | 1394 | 4.16 | 0.52 | 2.50 | 5.67 | 0.66 |
agree | 1394 | 2.22 | 0.34 | 1.08 | 3.50 | 0.67 |
open | 1394 | 2.86 | 0.45 | 1.33 | 4.75 | 0.69 |
SLS | ||||||
age | 1649 | 64.75 | 15.77 | 26.00 | 101.00 | |
edu | 1649 | 15.53 | 2.61 | 8.00 | 20.00 | |
neur | 1649 | 1.60 | 0.44 | 0.42 | 3.23 | 0.93 |
con | 1649 | 2.50 | 0.37 | 1.25 | 3.73 | 0.90 |
extra | 1649 | 2.21 | 0.40 | 0.89 | 3.53 | 0.89 |
agree | 1649 | 2.67 | 0.31 | 1.40 | 3.67 | 0.86 |
open | 1649 | 2.39 | 0.41 | 0.90 | 3.58 | 0.90 |
WLS | ||||||
age | 10711 | 53.76 | 4.53 | 33.00 | 75.00 | |
edu | 10711 | 13.69 | 2.56 | -3.00 | 21.00 | |
neur | 10711 | 3.22 | 0.98 | 1.00 | 6.00 | 0.77 |
con | 10711 | 4.83 | 0.70 | 1.50 | 6.00 | 0.65 |
extra | 10711 | 3.19 | 0.90 | 1.00 | 6.00 | 0.76 |
agree | 10711 | 2.27 | 0.75 | 1.00 | 6.00 | 0.69 |
open | 10711 | 3.62 | 0.80 | 1.00 | 6.00 | 0.60 |
study | male | female | percent female |
---|---|---|---|
EAS | 235 | 339 | 59.06 |
HRS | 7913 | 11298 | 58.81 |
LBC | 474 | 488 | 50.73 |
LBLS | 391 | 507 | 56.46 |
MAP | 160 | 493 | 75.50 |
MAS | 472 | 407 | 46.30 |
MIDUS | 2961 | 3284 | 52.59 |
NAS | |||
OATS | 187 | 347 | 64.98 |
ROS | 400 | 994 | 71.31 |
SLS | 740 | 909 | 55.12 |
WLS | 4961 | 5750 | 53.68 |
The following packages were used to generate this table:
library(papaja)
library(tidyverse)
library(knitr)
library(kableExtra)
library(here)
The files needed for this table are available at osf.io/mzfu9 in the Individual Study Output folder.
First we load the individual study analysis objects.
study.names = c("EAS", "HRS", "LBC", "LBLS", "MAP", "MAS", "MIDUS", "NAS", "OATS", "ROS", "SLS", "WLS")
lapply(here(paste0("mortality/study output/", study.names, "_survival_output.Rdata")), load, .GlobalEnv)
First we extract the Cronbach’s alpha values from the data objects. These are stored in a dataframe, with each reliability coefficient from each perosnality meausre from each study comprising a single row.
alpha.list <- data.frame()
n = 0
for(i in study.names){
n = n+1
x = get(paste0(i,"_survival_output")) # get output object
if(!is.null(x$alpha)){
y = as.data.frame(unlist(x$alpha))
y$study = i
alpha.list = rbind(alpha.list, y)
}
}
alpha.list <- alpha.list %>%
mutate(var = rownames(.),
var = gsub("[0-9]", "", var),
var = gsub("alpha_", "", var)) %>%
rename(alpha = `unlist(x$alpha)`)
We extract and wrangle the descriptive statistics (a data frame created using the describe()
function in the psych
package).
We identify the rows corresponding to each data set. We then select the minimum and maximum rows as starting and end points for grouping.
rows.EAS = which(describe.df$study == "EAS"); rows.EAS = c(min(rows.EAS), max(rows.EAS))
rows.LBC = which(describe.df$study == "LBC"); rows.LBC = c(min(rows.LBC), max(rows.LBC))
rows.LBLS = which(describe.df$study == "LBLS"); rows.LBLS = c(min(rows.LBLS), max(rows.LBLS))
rows.HRS = which(describe.df$study == "HRS"); rows.HRS = c(min(rows.HRS), max(rows.HRS))
rows.MAP = which(describe.df$study == "MAP"); rows.MAP = c(min(rows.MAP), max(rows.MAP))
rows.MAS = which(describe.df$study == "MAS"); rows.MAS = c(min(rows.MAS), max(rows.MAS))
rows.MIDUS = which(describe.df$study == "MIDUS"); rows.MIDUS = c(min(rows.MIDUS), max(rows.MIDUS))
rows.NAS = which(describe.df$study == "NAS"); rows.NAS = c(min(rows.NAS), max(rows.NAS))
rows.OATS = which(describe.df$study == "OATS"); rows.OATS = c(min(rows.OATS), max(rows.OATS))
rows.ROS = which(describe.df$study == "ROS"); rows.ROS = c(min(rows.ROS), max(rows.ROS))
rows.SLS = which(describe.df$study == "SLS"); rows.SLS = c(min(rows.SLS), max(rows.SLS))
rows.WLS = which(describe.df$study == "WLS"); rows.WLS = c(min(rows.WLS), max(rows.WLS))
Finally, we pipe the data frame into the kable()
function and additional formatting through the kableExtra
package. We remove the study column, as this becomes redundant with the grouping headers.
describe.df %>%
select(-study) %>%
kable(., booktabs = T, escape = F, digits = 2, format = "html",
col.names = c("Variable", "N Valid", "Mean", "SD", "Min", "Max", "$\\alpha$")) %>%
kable_styling(full_width = T, latex_options = c("repeat_header")) %>%
group_rows("EAS", rows.EAS[1], rows.EAS[2]) %>%
group_rows("HRS", rows.HRS[1], rows.HRS[2]) %>%
group_rows("LBC1936", rows.LBC[1], rows.LBC[2]) %>%
group_rows("LBLS", rows.LBLS[1], rows.LBLS[2]) %>%
group_rows("MAP", rows.MAP[1], rows.MAP[2]) %>%
group_rows("MAS", rows.MAS[1], rows.MAS[2]) %>%
group_rows("MIDUS", rows.MIDUS[1], rows.MIDUS[2]) %>%
group_rows("NAS", rows.NAS[1], rows.NAS[2]) %>%
group_rows("OATS", rows.OATS[1], rows.OATS[2]) %>%
group_rows("ROS", rows.ROS[1], rows.ROS[2]) %>%
group_rows("SLS", rows.SLS[1], rows.SLS[2]) %>%
group_rows("WLS", rows.WLS[1], rows.WLS[2])
The code to calculate gender breakdown is:
gender.tab <- data.frame()
n <- 0
for(i in study.names){
x <- get(paste0(i, "_survival_output"))
n <- n+1
gender.tab[n, "study"] <- i
if(!is.null(x$descriptives$gender.tab)){
table <- x$descriptives$gender.tab
gender.tab[n, "male"] <- table[which(names(table) == x$descriptives$gender.lab$male)]
gender.tab[n, "female"] <- table[which(names(table) == x$descriptives$gender.lab$female)]
gender.tab[n, "percent female"] <- gender.tab[n, "female"]/(gender.tab[n, "female"] +
gender.tab[n, "male"])*100}
}
kable(gender.tab, booktabs = T, escape = F, digits = 2, format = "html") %>%
kable_styling()