Overview
The RAADS-R scoring engine implements the validated clinical scoring algorithm for the Ritvo Autism Asperger Diagnostic Scale-Revised. The implementation includes dual scoring engines for cross-validation and comprehensive test coverage.Core Scoring Functions
Item Scoring
Each question item is scored based on the response index (0-3) and whether it’s a normative or symptom item.Scoring Logic
The scoring algorithm differentiates between two types of items:Items where higher response frequency indicates stronger autistic traits.Formula:
score = 3 - responseIndex- “True now and when I was young” (index 0) → 3 points
- “True only now” (index 1) → 2 points
- “True only when I was younger than 16” (index 2) → 1 point
- “Never true” (index 3) → 0 points
Items where lower response frequency indicates stronger autistic traits. Scoring is reversed.Formula:
score = responseIndex- “True now and when I was young” (index 0) → 0 points
- “True only now” (index 1) → 1 point
- “True only when I was younger than 16” (index 2) → 2 points
- “Never true” (index 3) → 3 points
The dataset contains 17 normative items out of 80 total items. Normative items are distributed across domains: Social (14), Language (1), and Sensory (2). The Interests domain has no normative items.
Total Score Computation
ThecomputeResults function aggregates individual item scores into domain and total scores:
scoring.ts:18
Algorithm Steps
- Map Creation: Build a lookup map of item ID → item object for O(1) access
- Domain Scoring: For each domain, iterate through its item IDs:
- Retrieve the item and response
- Score using
scoreItem(response, item.isNormative) - Sum all item scores for the domain
- Cutoff Evaluation: Compare domain score against cutoff using strict
>operator - Total Score: Sum all domain scores (maximum possible: 240)
- Total Cutoff: Evaluate against total cutoff (65)
Domain Structure
Dual Engine Validation
The codebase implements two mathematically equivalent scoring engines to ensure correctness:- Primary Engine (
scoring.ts): Uses arithmetic formula3 - responseIndex - Alternative Engine (
scoring-alt.ts): Uses lookup tablesSYMPTOM_SCORESandNORMATIVE_SCORES
Cutoff Interpretation
This is clinically significant and validated through boundary tests insrc/__tests__/scoring.test.ts:212-238.
Implementation Files
- Primary Engine:
src/engine/scoring.ts - Alternative Engine:
src/engine/scoring-alt.ts - Type Definitions:
src/data/dataset.schema.ts - Validation Tests:
src/__tests__/scoring.test.ts