extract {lwc2022} | R Documentation |
Extract Key Cognitive Measures from Dataset
Description
This function extracts specific cognitive measures from a dataset, including immediate and delayed word recall, serial subtraction, and backwards counting, along with household and person identifiers.
Usage
extract(data)
Arguments
data |
A dataframe containing the full dataset from which specific variables will be selected. |
Details
The function selects key cognitive test results and identifiers from the dataset.
It uses dplyr::select()
to retrieve:
Immediate and delayed word recall variables (those starting with "SD182M" and "SD183M").
Serial subtraction results (
SD142
toSD146
).Backwards counting variables (
SD124
,SD129
).
Value
A dataframe with the following variables:
-
HHID
: Household ID. -
PN
: Person number (individual identifier). Immediate and delayed word recall variables (columns starting with
"SD182M"
and"SD183M"
).Serial subtraction variables (
SD142
toSD146
).Backwards counting variables (
SD124
,SD129
).
Examples
# Assuming `cog_data` is a dataframe with the relevant columns
extract(cog_data)