# Install remotes if not already installed
install.packages("remotes")
remotes::install_github("rmtrane/NpsychBatteryNorms")
Introduction to NpsychBatteryNorms
NpsychBatteryNorms lets you easily calculate normative scores for a wide variety of neuropsychological tests using various methods.
Installation
Disclaimer
This R package started as the backbone of the visualization tool included in the R package
NpsychAssessmentTool
, but we quickly realized it might be of use as a standalone tool for other researchers. It was therefore decided to package the most important tools and methods separately, which resulted in this package. None of the implementations here should be used in commercial products nor as standalone medical advice. Also note this package is distributed under the MIT Licence, meaning the software is provided “asis” and the authors are not liable for any claim, damages or other liabaility arising from this software. Also, note that the authors behind the T-scores implemented for some test scores request that the scores are not edited, modified, translated or otherwise part of derivative work without the prior written permission of Mayo Clinic. For more on the use of the T-scores, contact Nikki Stricker and/or see the Mayo Clinic Study of Aging website for more on data sharing.
Simple Usage
The main function in this package is std_scores
which lets us standardize raw scores. As an example, we can standardize a raw score for the MoCA of 21 for a 57 year old male patient with 15 years of education using normative data published by NACC:
library(NpsychBatteryNorms)
std_scores(
raw_scores = 21,
var_name = "MOCATOTS",
sex = "m",
age = 57,
education = 15,
method = "norms",
version = "nacc"
)
#> [1] -2.192308
We can standardize this score using various methods. For a table showing the methods implemented, use implemented_std_methods
. This shows which method/ version combos are available (1) and which are not (0):
std_methods(var_name = "MOCATOTS")
#> method version available
#> 1 norms nacc 1
#> 2 norms updated 1
#> 3 norms ravlt_trials 0
#> 4 regression nacc 1
#> 5 regression updated 1
#> 6 regression nacc_legacy 0
#> 7 T-score <NA> 0
We can also do the reverse lookup: the variables that can be standardized using regression models published by NACC:
std_methods(method = "regression", version = "nacc")
#> [1] "MOCATOTS" "CRAFTVRS" "CRAFTURS" "UDSBENTC" "DIGFORCT" "DIGFORSL"
#> [7] "DIGBACCT" "DIGBACLS" "ANIMALS" "VEG" "TRAILA" "TRAILB"
#> [13] "CRAFTDVR" "CRAFTDRE" "CRAFTCUE" "UDSBENTD" "UDSBENRS" "MINTTOTS"
#> [19] "MINTTOTW" "MINTSCNG" "MINTPCNG" "UDSVERFC" "UDSVERLC" "UDSVERTN"
#> [25] "UDSVERTE" "UDSVERTI" "trailaadj" "trailbadj"
Standardizing using the NACC published regression model, we get a slightly different normative score.
std_scores(
raw_scores = 21,
var_name = "MOCATOTS",
sex = "m",
age = 57,
education = 15,
method = "regression",
version = "nacc"
)
#> [1] -2.324629
For Analysis
In a more realistic use case, we have data on a number of patients in a data set. One such example is the NACC data that is obtainable from the NACC data website. We include a demo data set for you to explore (see ?demo_data
for more).
head(demo_data)
#> NACCID NACCAGE SEX EDUC BIRTHYR BIRTHMO VISITYR VISITMO VISITDAY RACE
#> 1 NACC030018 62 2 18 1952 10 2015 4 26 1
#> 2 NACC030018 58 2 18 1952 10 2011 1 15 1
#> 3 NACC030018 56 2 18 1952 10 2009 9 7 1
#> 4 NACC030018 67 2 18 1952 10 2019 10 5 1
#> 5 NACC051917 84 1 15 1939 1 2023 10 3 50
#> 6 NACC062221 78 1 16 1942 11 2021 3 8 1
#> HANDED CDRGLOB MOCATOTS MOCBTOTS TRAILA TRAILARR TRAILALI OTRAILA OTRLARR
#> 1 2 0.5 -4 -4 35 0 24 -4 -4
#> 2 2 0.5 28 -4 26 0 24 -4 -4
#> 3 2 0.0 23 -4 15 0 24 -4 -4
#> 4 2 1.0 -4 -4 -4 -4 -4 -4 -4
#> 5 2 0.0 -4 -4 32 1 24 -4 -4
#> 6 2 0.0 -4 -4 44 -4 -4 -4 -4
#> DIGFORCT DIGFORSL DIGBACCT DIGBACLS WAIS MINTTOTS ANIMALS VEG UDSVERTN
#> 1 -4 -4 -4 -4 49 -4 11 5 -4
#> 2 8 5 6 5 -4 32 16 6 22
#> 3 9 7 9 4 -4 30 21 9 17
#> 4 -4 -4 -4 -4 -4 -4 -4 -4 -4
#> 5 -4 -4 -4 -4 17 -4 18 16 -4
#> 6 -4 -4 -4 -4 50 -4 18 14 -4
#> UDSVERFC UDSVERLC UDSBENTC UDSBENTD CRAFTVRS CRAFTURS CRAFTDVR CRAFTDRE
#> 1 -4 -4 -4 -4 -4 -4 -4 -4
#> 2 4 12 15 12 30 22 96 0
#> 3 15 15 16 14 22 15 0 17
#> 4 -4 -4 -4 -4 -4 -4 -4 -4
#> 5 -4 -4 -4 -4 -4 -4 -4 -4
#> 6 -4 -4 -4 -4 -4 -4 -4 -4
#> REY1REC REY2REC REY3REC REY4REC REY5REC REY6REC REYDREC REYTCOR TRAILB
#> 1 -4 -4 -4 -4 -4 -4 -4 -4 86
#> 2 -4 -4 -4 -4 -4 -4 -4 -4 153
#> 3 -4 -4 -4 -4 -4 -4 -4 -4 47
#> 4 -4 -4 -4 -4 -4 -4 -4 -4 -4
#> 5 -4 -4 -4 -4 -4 -4 -4 -4 50
#> 6 -4 -4 -4 -4 -4 -4 -4 -4 996
#> TRAILBLI TRAILBRR MOCACLOC MOCACLOH MOCACLON OTRAILB OTRLBRR OTRLBLI NACCGDS
#> 1 24 0 -4 -4 -4 -4 -4 -4 1
#> 2 22 3 1 1 1 -4 -4 -4 0
#> 3 24 0 1 1 1 -4 -4 -4 2
#> 4 -4 -4 -4 -4 -4 -4 -4 -4 -4
#> 5 24 1 -4 -4 -4 -4 -4 -4 0
#> 6 -4 -4 -4 -4 -4 -4 -4 -4 0
#> CDRSUM UDSBENRS BILLS TAXES SHOPPING GAMES STOVE MEALPREP EVENTS PAYATTN
#> 1 0.0 -4 0 0 0 0 0 0 1 1
#> 2 2.5 1 3 0 0 0 0 2 1 2
#> 3 0.0 1 0 3 0 3 3 3 1 0
#> 4 0.5 -4 0 3 2 1 0 8 0 0
#> 5 0.0 -4 0 0 0 8 0 0 0 0
#> 6 0.0 -4 2 0 0 0 0 0 0 0
#> REMDATES TRAVEL REYFPOS NACCUDSD NACCMMSE BOSTON LOGIMEM MEMUNITS MEMTIME
#> 1 3 0 -4 1 26 97 16 14 16
#> 2 0 0 -4 1 -4 -4 -4 -4 -4
#> 3 0 0 -4 2 -4 -4 -4 -4 -4
#> 4 0 0 -4 4 -4 -4 -4 -4 -4
#> 5 0 0 -4 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-4 -4 -4 -4 -4 -4 -4 -4 -4 -4
#> 6 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4
#> HUNT HUNTIF HYCEPH HYCEPHIF IMPSUB IMPSUBIF MEDS MEDSIF MSA MSAIF NACCALZD
#> 1 0 8 0 7 0 7 0 8 0 8 8
#> 2 0 8 0 7 0 8 0 8 0 7 1
#> 3 0 7 0 7 0 8 0 7 0 8 1
#> 4 0 7 0 7 0 7 0 7 0 8 1
#> 5 0 7 0 8 -4 -4 0 8 -4 -4 8
#> 6 0 8 0 7 -4 -4 0 7 -4 -4 8
#> NACCALZP NACCLBDE NACCLBDP NEOP NEOPIF OTHCOGIF OTHPSYIF POSSAD POSSADIF
#> 1 1 0 1 0 8 8 8 -4 -4
#> 2 1 8 7 0 8 8 7 -4 -4
#> 3 8 8 8 0 8 7 7 -4 -4
#> 4 1 8 8 0 8 7 7 -4 -4
#> 5 8 0 8 0 8 -4 7 8 8
#> 6 7 8 7 0 7 -4 8 8 8
#> PPAPH PPAPHIF PRION PRIONIF PROBAD PROBADIF PSP PSPIF PTSDDX PTSDDXIF SCHIZOP
#> 1 -4 -4 0 8 -4 -4 0 8 0 8 0
#> 2 -4 -4 0 8 -4 -4 0 8 0 7 0
#> 3 -4 -4 0 8 -4 -4 0 7 0 8 0
#> 4 -4 -4 0 7 -4 -4 0 8 0 8 0
#> 5 0 7 0 7 8 7 0 8 -4 -4 -4
#> 6 0 8 0 8 0 8 0 7 -4 -4 -4
#> SCHIZOIF STROKE STROKIF VASC VASCIF VASCPS VASCPSIF
#> 1 7 -4 -4 -4 -4 -4 -4
#> 2 8 -4 -4 -4 -4 -4 -4
#> 3 8 -4 -4 -4 -4 -4 -4
#> 4 8 -4 -4 -4 -4 -4 -4
#> 5 -4 0 3 8 8 0 7
#> 6 -4 0 7 8 8 -4 -4
We can calculate all standardized scores in one go and have them added to the data as std_{var_name}
:
demo_data_w_std <- add_standardized_scores(demo_data)
#> 'methods' not specified. Will use the following defaults:
#> MOCATOTS: regression (nacc version)
#> OTRAILA: regression (updated version)
#> OTRAILB: regression (updated version)
#> OTRLARR: regression (updated version)
#> OTRLBRR: regression (updated version)
#> DIGFORCT: regression (nacc version)
#> DIGFORSL: regression (nacc version)
#> DIGBACCT: regression (nacc version)
#> DIGBACLS: regression (nacc version)
#> TRAILA: regression (nacc version)
#> TRAILB: regression (nacc version)
#> WAIS: T-score
#> MINTTOTS: regression (nacc version)
#> ANIMALS: regression (nacc version)
#> VEG: regression (nacc version)
#> UDSVERFC: regression (nacc version)
#> UDSVERLC: regression (nacc version)
#> UDSVERTN: regression (nacc version)
#> UDSBENTC: regression (nacc version)
#> UDSBENTD: regression (nacc version)
#> CRAFTVRS: regression (nacc version)
#> CRAFTURS: regression (nacc version)
#> CRAFTDVR: regression (nacc version)
#> CRAFTDRE: regression (nacc version)
#> REY1REC: T-score
#> REY2REC: T-score
#> REY3REC: T-score
#> REY4REC: T-score
#> REY5REC: T-score
#> REY6REC: T-score
#> REYDREC: T-score
#> NACCMMSE: regression (nacc_legacy version)
#> BOSTON: regression (nacc_legacy version)
#> LOGIMEM: regression (nacc_legacy version)
#> MEMUNITS: regression (nacc_legacy version)
#> DIGIF: regression (nacc_legacy version)
#> DIGIFLEN: regression (nacc_legacy version)
#> DIGIB: regression (nacc_legacy version)
#> DIGIBLEN: regression (nacc_legacy version)
#> [1] "Using regression (nacc) for variable MOCATOTS"
#> [1] "Using regression (updated) for variable OTRAILA"
#> [1] "Using regression (updated) for variable OTRAILB"
#> [1] "Using regression (updated) for variable OTRLARR"
#> [1] "Using regression (updated) for variable OTRLBRR"
#> [1] "Using regression (nacc) for variable DIGFORCT"
#> [1] "Using regression (nacc) for variable DIGFORSL"
#> [1] "Using regression (nacc) for variable DIGBACCT"
#> [1] "Using regression (nacc) for variable DIGBACLS"
#> [1] "Using regression (nacc) for variable TRAILA"
#> [1] "Using regression (nacc) for variable TRAILB"
#> [1] "Using T-score (NA) for variable WAIS"
#> ! For T-scores, education must be a numeric vector of values between 8 and 20. Values outside this interval has been truncated.
#> ! For T-scores, age must be a numeric vector of values between 30 and 91. Values outside this range has been truncated.
#> [1] "Using regression (nacc) for variable MINTTOTS"
#> [1] "Using regression (nacc) for variable ANIMALS"
#> [1] "Using regression (nacc) for variable VEG"
#> [1] "Using regression (nacc) for variable UDSVERFC"
#> [1] "Using regression (nacc) for variable UDSVERLC"
#> [1] "Using regression (nacc) for variable UDSVERTN"
#> [1] "Using regression (nacc) for variable UDSBENTC"
#> [1] "Using regression (nacc) for variable UDSBENTD"
#> [1] "Using regression (nacc) for variable CRAFTVRS"
#> [1] "Using regression (nacc) for variable CRAFTURS"
#> [1] "Using regression (nacc) for variable CRAFTDVR"
#> [1] "Using regression (nacc) for variable CRAFTDRE"
#> [1] "Using T-score (NA) for variable REY1REC"
#> ! For T-scores, education must be a numeric vector of values between 8 and 20. Values outside this interval has been truncated.
#> ! For T-scores, age must be a numeric vector of values between 30 and 91. Values outside this range has been truncated.
#> [1] "Using T-score (NA) for variable REY2REC"
#> ! For T-scores, education must be a numeric vector of values between 8 and 20. Values outside this interval has been truncated.
#> ! For T-scores, age must be a numeric vector of values between 30 and 91. Values outside this range has been truncated.
#> [1] "Using T-score (NA) for variable REY3REC"
#> ! For T-scores, education must be a numeric vector of values between 8 and 20. Values outside this interval has been truncated.
#> ! For T-scores, age must be a numeric vector of values between 30 and 91. Values outside this range has been truncated.
#> [1] "Using T-score (NA) for variable REY4REC"
#> ! For T-scores, education must be a numeric vector of values between 8 and 20. Values outside this interval has been truncated.
#> ! For T-scores, age must be a numeric vector of values between 30 and 91. Values outside this range has been truncated.
#> [1] "Using T-score (NA) for variable REY5REC"
#> ! For T-scores, education must be a numeric vector of values between 8 and 20. Values outside this interval has been truncated.
#> ! For T-scores, age must be a numeric vector of values between 30 and 91. Values outside this range has been truncated.
#> [1] "Using T-score (NA) for variable REY6REC"
#> ! For T-scores, education must be a numeric vector of values between 8 and 20. Values outside this interval has been truncated.
#> ! For T-scores, age must be a numeric vector of values between 30 and 91. Values outside this range has been truncated.
#> [1] "Using T-score (NA) for variable REYDREC"
#> ! For T-scores, education must be a numeric vector of values between 8 and 20. Values outside this interval has been truncated.
#> ! For T-scores, age must be a numeric vector of values between 30 and 91. Values outside this range has been truncated.
#> [1] "Using regression (nacc_legacy) for variable NACCMMSE"
#> [1] "Using regression (nacc_legacy) for variable BOSTON"
#> [1] "Using regression (nacc_legacy) for variable LOGIMEM"
#> [1] "Using regression (nacc_legacy) for variable MEMUNITS"
#> [1] "Using regression (nacc_legacy) for variable DIGIF"
#> [1] "Using regression (nacc_legacy) for variable DIGIFLEN"
#> [1] "Using regression (nacc_legacy) for variable DIGIB"
#> [1] "Using regression (nacc_legacy) for variable DIGIBLEN"
head(demo_data_w_std)
#> NACCID NACCAGE SEX EDUC BIRTHYR BIRTHMO VISITYR VISITMO VISITDAY RACE
#> 1 NACC030018 62 2 18 1952 10 2015 4 26 1
#> 2 NACC030018 58 2 18 1952 10 2011 1 15 1
#> 3 NACC030018 56 2 18 1952 10 2009 9 7 1
#> 4 NACC030018 67 2 18 1952 10 2019 10 5 1
#> 5 NACC051917 84 1 15 1939 1 2023 10 3 50
#> 6 NACC062221 78 1 16 1942 11 2021 3 8 1
#> HANDED CDRGLOB MOCATOTS MOCBTOTS TRAILA TRAILARR TRAILALI OTRAILA OTRLARR
#> 1 2 0.5 -4 -4 35 0 24 -4 -4
#> 2 2 0.5 28 -4 26 0 24 -4 -4
#> 3 2 0.0 23 -4 15 0 24 -4 -4
#> 4 2 1.0 -4 -4 -4 -4 -4 -4 -4
#> 5 2 0.0 -4 -4 32 1 24 -4 -4
#> 6 2 0.0 -4 -4 44 -4 -4 -4 -4
#> DIGFORCT DIGFORSL DIGBACCT DIGBACLS WAIS MINTTOTS ANIMALS VEG UDSVERTN
#> 1 -4 -4 -4 -4 49 -4 11 5 -4
#> 2 8 5 6 5 -4 32 16 6 22
#> 3 9 7 9 4 -4 30 21 9 17
#> 4 -4 -4 -4 -4 -4 -4 -4 -4 -4
#> 5 -4 -4 -4 -4 17 -4 18 16 -4
#> 6 -4 -4 -4 -4 50 -4 18 14 -4
#> UDSVERFC UDSVERLC UDSBENTC UDSBENTD CRAFTVRS CRAFTURS CRAFTDVR CRAFTDRE
#> 1 -4 -4 -4 -4 -4 -4 -4 -4
#> 2 4 12 15 12 30 22 96 0
#> 3 15 15 16 14 22 15 0 17
#> 4 -4 -4 -4 -4 -4 -4 -4 -4
#> 5 -4 -4 -4 -4 -4 -4 -4 -4
#> 6 -4 -4 -4 -4 -4 -4 -4 -4
#> REY1REC REY2REC REY3REC REY4REC REY5REC REY6REC REYDREC REYTCOR TRAILB
#> 1 -4 -4 -4 -4 -4 -4 -4 -4 86
#> 2 -4 -4 -4 -4 -4 -4 -4 -4 153
#> 3 -4 -4 -4 -4 -4 -4 -4 -4 47
#> 4 -4 -4 -4 -4 -4 -4 -4 -4 -4
#> 5 -4 -4 -4 -4 -4 -4 -4 -4 50
#> 6 -4 -4 -4 -4 -4 -4 -4 -4 996
#> TRAILBLI TRAILBRR MOCACLOC MOCACLOH MOCACLON OTRAILB OTRLBRR OTRLBLI NACCGDS
#> 1 24 0 -4 -4 -4 -4 -4 -4 1
#> 2 22 3 1 1 1 -4 -4 -4 0
#> 3 24 0 1 1 1 -4 -4 -4 2
#> 4 -4 -4 -4 -4 -4 -4 -4 -4 -4
#> 5 24 1 -4 -4 -4 -4 -4 -4 0
#> 6 -4 -4 -4 -4 -4 -4 -4 -4 0
#> CDRSUM UDSBENRS BILLS TAXES SHOPPING GAMES STOVE MEALPREP EVENTS PAYATTN
#> 1 0.0 -4 0 0 0 0 0 0 1 1
#> 2 2.5 1 3 0 0 0 0 2 1 2
#> 3 0.0 1 0 3 0 3 3 3 1 0
#> 4 0.5 -4 0 3 2 1 0 8 0 0
#> 5 0.0 -4 0 0 0 8 0 0 0 0
#> 6 0.0 -4 2 0 0 0 0 0 0 0
#> REMDATES TRAVEL REYFPOS NACCUDSD NACCMMSE BOSTON LOGIMEM MEMUN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4 -4 -4 -4 -2.09289010 NA
#> 4 8 -4 -4 -4 -4 -4 -4 NA NA
#> 5 -4 0 3 8 8 0 7 NA NA
#> 6 -4 0 7 8 8 -4 -4 NA NA
#> std_OTRAILB std_OTRLARR std_OTRLBRR std_DIGFORCT std_DIGFORSL std_DIGBACCT
#> 1 NA NA NA NA NA NA
#> 2 NA NA NA -0.34646363 -1.50099848 -0.8784421
#> 3 NA NA NA 0.07462293 0.03584939 0.4776355
#> 4 NA NA NA NA NA NA
#> 5 NA NA NA NA NA NA
#> 6 NA NA NA NA NA NA
#> std_DIGBACLS std_TRAILA std_TRAILB std_WAIS std_MINTTOTS std_ANIMALS
#> 1 NA -0.9491045 -0.6739601 39.15614 NA -2.4761872
#> 2 -0.3997263 -0.2788860 -2.4634975 NA 0.7114093 -1.6349515
#> 3 -1.2164899 0.6602749 0.0363553 NA -0.2458273 -0.7372263
#> 4 NA NA NA NA NA NA
#> 5 NA 0.4446749 1.3785570 23.79736 NA -0.1284373
#> 6 NA -0.9876708 NA 61.90121 NA -0.4061138
#> std_VEG std_UDSVERFC std_UDSVERLC std_UDSVERTN std_UDSBENTC std_UDSBENTD
#> 1 -3.0862793 NA NA NA NA NA
#> 2 -2.9200185 -2.8021258 -0.9309772 -1.265069 -0.70294206 -0.1893684
#> 3 -2.2146543 -0.3963294 -0.2500151 -1.900297 0.03484411 0.4316786
#> 4 NA NA NA NA NA NA
#> 5 0.9599822 NA NA NA NA NA
#> 6 0.2605915 NA NA NA NA NA
#> std_CRAFTVRS std_CRAFTURS std_CRAFTDVR std_CRAFTDRE std_REY1REC std_REY2REC
#> 1 NA NA NA NA NA NA
#> 2 0.8129834 1.0243901 NA -4.17731650 NA NA
#> 3 -0.4780968 -0.7920124 -3.494761 -0.09689839 NA NA
#> 4 NA NA NA NA NA NA
#> 5 NA NA NA NA NA NA
#> 6 NA NA NA NA NA NA
#> std_REY3REC std_REY4REC std_REY5REC std_REY6REC std_REYDREC std_NACCMMSE
#> 1 NA NA NA NA NA -2.6300699
#> 2 NA NA NA NA NA NA
#> 3 NA NA NA NA NA NA
#> 4 NA NA NA NA NA NA
#> 5 NA NA NA NA NA 0.9150078
#> 6 NA NA NA NA NA 0.7017947
#> std_BOSTON std_LOGIMEM std_MEMUNITS std_DIGIF std_DIGIFLEN std_DIGIB
#> 1 NA 0.4638865 0.2234743 -0.1649103 0.8638963 -3.613924
#> 2 NA NA NA NA NA NA
#> 3 NA NA NA NA NA NA
#> 4 NA NA NA NA NA NA
#> 5 -3.749966 -2.1100929 NA -1.1447424 0.3758585 -1.267080
#> 6 -7.974985 NA -1.0121286 -0.7889089 1.1851324 -1.429325
#> std_DIGIBLEN
#> 1 -0.2598315
#> 2 NA
#> 3 NA
#> 4 NA
#> 5 0.1681674
#> 6 1.7056781
Some scores are often summarized. For example, the MoCA clock is often summed. We can use add_derived_scores()
to add those of REYTOTAL
(sum of REY1REC
, …, REY5REC
), REYAREC
(REY AVLT Accuracy), FAS
(Functional Assessment Score summarized), and MOCACLOCK
(sum of MOCACLON
, MOCACLOC
, MOCACLOH
) that can be calculated based on the columns available.
demo_data_w_derived_scores <- add_derived_scores(
demo_data
)
demo_data_w_derived_scores_w_std <- add_standardized_scores(
demo_data_w_derived_scores,
print_messages = F
)
demo_data_w_derived_scores_w_std
includes a few extra columns compared to demo_data_w_std
(only displaying first six rows):
exclusive_cols <- setdiff(
colnames(demo_data_w_derived_scores_w_std),
colnames(demo_data_w_std)
)
head(demo_data_w_derived_scores_w_std[exclusive_cols])
#> REYTOTAL REYAREC FAS MOCACLOCK std_REYTOTAL std_REYAREC
#> 1 NA NA 2 NA NA NA
#> 2 NA NA 5 3 NA NA
#> 3 NA NA 1 3 NA NA
#> 4 NA NA 3 NA NA NA
#> 5 NA NA 0 NA NA NA
#> 6 NA NA 2 NA NA NA