top of page

Welcome
to NumpyNinja Blogs

NumpyNinja: Blogs. Demystifying Tech,

One Blog at a Time.
Millions of views. 

The Quiet Damage — What Cognitive Decline in Type 2 Diabetes does to Aging Brain

Image generated by Author
Image generated by Author

Type 2 Diabetes doesn't make headlines like cancer or heart disease, yet it quietly affects more people than both combined.


What is Type 2 Diabetes?

Type 2 Diabetes occurs when the body fails to produce or effectively use insulin — the hormone that allows sugar to enter cells for energy. Without it, sugar accumulates in the bloodstream, demanding lifelong management and quietly damaging the eyes, kidneys, nerves, and heart over time. And beyond these well-known complications, it reaches deeper still — compromising the blood-brain barrier and disrupting the brain's ability to regulate its own metabolism and circulation.


Dataset Description

Working on a recent data analysis project brought this into sharp focus. The Cerebromicrovascular Disease in Elderly with Diabetes dataset on PhysioNet offered a detailed look into how Type 2 Diabetes affects cerebral circulation, cognitive function, and mobility in older adults — and exploring it only deepened my understanding of just how far reaching this disease truly is. And if I am being honest, Type 2 Diabetes is not a stranger in my family.

The dataset captures observations from 69 diabetic and control participants aged 55 to 75, including continuous cerebral blood flow measurements via transcranial Doppler and MRI, alongside heart rate, blood pressure, respiratory parameters, balance, and walking data. 41 participants completed a two year follow up.

Cognitive tests serve as the critical clinical endpoint — measuring whether structural brain damage from Type 2 Diabetes translates into real world cognitive decline. Given that diabetic patients face significantly higher risks of dementia and mild cognitive impairment, these tests help identify complications early, often before severe damage occurs.


Cognitive Fields in the Dataset:


Cognitive Field

Description

DS: # digits correct forward

It is a cognitive test score that measures attention and short-term memory capacity. The score represents the maximum length of number sequence the person can correctly recall forward without errors.

DS: backward # digits correct

Number of digits correct is a cognitive test that measures working memory and executive function. The score is the maximum number of digits correctly repeated in reverse order without mistakes.

DS: Total

It refers to the combined score of Digit Span Forward + Digit Span Backward.

HVLT: Total Recall

Hopkins Verbal Learning Test – Total Recall measures verbal learning and memory ability. It represents the total number of words correctly remembered across all learning trials after being read a word list multiple times.

HVLT: Delayed Recall

(Hopkins Verbal Learning Test) – Delayed Recall measures long-term verbal memory retention.It tests how many words a person can remember after a delay (usually 20–25 minutes) without seeing the list again.

HVLT: Delayed Recall T-score

A standardized score that compares a person's delayed verbal memory performance against a normative population of the same age group. Derived from raw HVLT Delayed Recall scores, it uses a T-score scale with a mean of 50 and standard deviation of 10.

HVLT: Retention %

It measures how well a person retains learned information over time.It shows the percentage of words remembered in the delayed recall phase compared to the best learning performance (usually Total Recall).

RCFT: Total Correct

The Rey–Osterrieth Complex Figure (ROCF) test used to assess the visuo-constructional ability and visual memory of neuropsychiatric disorders, including copying and recall tests by drawing the complex figure.

VF: FAS Total

Combined score of a phonemic verbal fluency (VF) test where a person names as many words as possible starting with F, A, and S within 60 seconds per letter. Measures executive function, word retrieval speed, and language capabilities — influenced by age and education.

VF: # animals t-score

The animal verbal fluency test, which measures semantic memory by counting unique animal names generated in one minute, uses specific cut-off scores to screen for cognitive impairment. T score indicates it is age adjusted and sometimes education adjusted too.

TM: Part A Time (sec)

The Trail Making Test Part A (TMT-A) measures processing speed and visual scanning by requiring the connection of 25 numbered circles in ascending order, with results recorded as total time in seconds.

TM: Part B Time (sec)

The Trail Making Test Part B (TMT-B) (sec) is a neurocognitive score measuring the total time in seconds an individual takes to complete the second part of the Trail Making Test. It is a key indicator of cognitive flexibility, executive function, and psychomotor speed.

Clock: Total Score

The Clock Drawing Test (CDT) is a test that evaluates a patient's visuospatial, praxis, and executive functions by scoring the accuracy of a drawn clock face, numbers, and hands. Lower scores indicate cognitive impairment.

WTAR: Raw Score

The Wechsler Test of Adult Reading (WTAR) . Total number of correctly pronounced words from a 50-word list of irregular, non-phonetic spellings. Used in diabetes research to estimate a patient's premorbid intelligence — their cognitive baseline before the onset of decline.

NIS Self-Report Form Total Response

The Neuropsychological Impairment Scale (NIS) . A self-report questionnaire screening for brain related issues such as those caused by dementia, head injury, or alcohol related damage — capturing symptoms a patient may not volunteer in a standard interview. Rated on a 0 (None) to 4 (Extreme) scale.

BADS Total Responses

The Behavioral Assessment of the Dysexecutive Syndrome (BADS) is a 6-test battery used to assess executive function and is designed to identify deficits in planning, organization, and inhibition.

GDS Total Response

The Geriatric Depression Scale (GDS) is a widely used 30-item or 15-item self-report questionnaire assessing depression in older adults, using "Yes/No" answers to describe feelings over the past week.

IADL

Instrumental Activities of Daily Living test. A standardized assessment tool — commonly the Lawton & Brody scale — measuring an individual's ability to perform complex daily tasks necessary for independent living, including finances, medication management, and transportation.

MMSE Total

Mini- Mental State Examination is a broad screening tool which is a quick, 10-minute, 30-point questionnaire used to screen for dementia and track cognitive changes over time.

Cognitive Screening Score:


Source: Thresholds adapted from the cognitive assessment battery used in the PhysioNet CDED dataset and based on established cutoffs from the corresponding neuropsychological tests. These values were used as screening thresholds for identifying possible cognitive impairment.
Source: Thresholds adapted from the cognitive assessment battery used in the PhysioNet CDED dataset and based on established cutoffs from the corresponding neuropsychological tests. These values were used as screening thresholds for identifying possible cognitive impairment.

Out of the 19 available parameters, these cognitive screening tests were used to calculate the cognitive screening score. Each test has a specific threshold value — scores meeting or breaching these limits signal cognitive concern. The combined assessment across all 10 tests produces the final score used in the analysis.

To calculate the cognitive score for each individual patients I created a calculated column for each of the 10 tests. Unlike measures, calculated columns store results at the row level — making them the right choice for patient level analysis across multiple visits.


Flag_DS =

IF(

    Fact_Clinical[DS_Digits_Correct_Forward] <= 7

    && Fact_Clinical[DS_Backward_Digits_Correct] <= 5,

    1, 0

)

 

Flag_HVLT = 

IF(Fact_Clinical[HVLT_Total_Recall] <= 14, 1, 0)

 

Flag_RCFT =

IF(Fact_Clinical[RCFT] <= 71, 1, 0)

 

Flag_VF =

IF( Fact_Clinical[VF_FAS] < 42 || Fact_Clinical[VF_Animal_Score] < 42, 1, 0 )

 

Flag_TM = IF(

    (Fact_Clinical[TM_Part_A] > 42

    || Fact_Clinical[TM_Part_B]>101), 1,0)

 

Flag_Clock = IF(

    ISBLANK(Fact_Clinical[Clock_Score]) || Fact_Clinical[Clock_Score] = 0,

    BLANK(),

    IF(Fact_Clinical[Clock_Score] <= 4, 1, 0)

)

 

Flag_WTAR = IF(

    ISBLANK(Fact_Clinical[WTAR]) || Fact_Clinical[WTAR] = 0,

    BLANK(),

    IF(Fact_Clinical[WTAR] <= 20, 1, 0)

)

 

Flag_GDS =

IF(Fact_Clinical[GDS] >= 15, 1, 0)

 

Flag_IADL =

IF(Fact_Clinical[IADL] <= 14, 1, 0)

 

Flag_MMSE = IF(

    ISBLANK(Fact_Clinical[MMSE]) || Fact_Clinical[MMSE] = 0,

    BLANK(),

    IF(Fact_Clinical[MMSE] <= 23, 1, 0)

)


Next we need to combine the all the individual test score to calculate the cognitive screening score.


Cognitive_Screening_Score =

CALCULATE(

    SUM(Fact_Clinical[Flag_Clock]) +

    SUM(Fact_Clinical[Flag_DS]) +

    SUM(Fact_Clinical[Flag_GDS]) +

    SUM(Fact_Clinical[Flag_HVLT]) +

    SUM(Fact_Clinical[Flag_IADL]) +

    SUM(Fact_Clinical[Flag_MMSE]) +

    SUM(Fact_Clinical[Flag_RCFT]) +

    SUM(Fact_Clinical[Flag_TM]) +

    SUM(Fact_Clinical[Flag_VF]) +

    SUM(Fact_Clinical[Flag_WTAR]),

    ALLEXCEPT(Fact_Clinical, Fact_Clinical[PatientID])

)


Participants were classified into Normal, Mild, Moderate, and Severe Cognitive Decline based on the number of cognitive tests falling outside the recommended screening thresholds. These severity categories were created for analytical purposes and do not represent a clinical diagnosis.


Cognitive_Decline_Category =

SWITCH(

    TRUE(),

    ISBLANK(Fact_Clinical[Cognitive_Screening_Score]), "Unknown",

    Fact_Clinical[Cognitive_Screening_Score] > 7, "Severe Cognitive Decline",

    Fact_Clinical[Cognitive_Screening_Score] > 4, "Moderate Cognitive Decline",

    Fact_Clinical[Cognitive_Screening_Score] > 2, "Mild Cognitive Decline",

    "Normal"

)

With the above calculations in place, the following visuals were created in Power BI Desktop.


Image created by Author in Power BI Desktop
Image created by Author in Power BI Desktop

Image created by Author in Power BI Desktop
Image created by Author in Power BI Desktop

Note: Cognitive decline categories were derived by aggregating individual test threshold flags and are intended for analytical purposes rather than clinical diagnosis.


The cognitive screening analysis revealed that 89% of participants exhibited some level of cognitive decline, with only 10% classified as cognitively normal. Mild and Moderate Cognitive Decline were the most common categories, each accounting for 33% of the cohort, while 22.1% of participants showed Severe Cognitive Decline. The high number of impairment flags in the RCFT, Verbal Fluency, and Trail Making Tests suggests that visuospatial memory, executive functioning, and language fluency were the most affected cognitive domains


The numbers tell a story that is hard to ignore. With 89% of participants showing some level of cognitive decline, this dataset makes one thing unmistakably clear — Type 2 Diabetes is far more than a blood sugar problem. It reaches into memory, executive function, language, and the very way the brain processes the world.

What started as a data analysis project turned into something far more meaningful. Building these measures, mapping these thresholds, and visualizing the decline across cognitive domains was a reminder that behind every data point is a real person navigating a condition that medicine is still working to fully understand.


Early detection matters. The cognitive tests in this dataset exist precisely because catching decline before it becomes irreversible can change outcomes. If this analysis contributes even a small part to that conversation — it was worth every calculated column.


Thank You for Reading.


References:


+1 (302) 200-8320

NumPy_Ninja_Logo (1).png

Numpy Ninja Inc. 8 The Grn Ste A Dover, DE 19901

© Copyright 2025 by Numpy Ninja Inc.

  • Twitter
  • LinkedIn
bottom of page