Analysis Code for Diagnostic Performance of Rectus Femoris Ultrasound for the Diagnosis of Sarcopenia in Older Adults: A Multicenter Study
Due to data privacy regulations (GDPR), the original dataset cannot be shared.
To run these scripts, your input dataset (data/analysis_data.csv) should contain the following variables:
| Object | Dimensions | Description |
|---|---|---|
Ana_all |
130 × 32 | Full analysis dataset: both centers, all ages, one row per participant |
all_old |
78 × 32 | Older cohort only (Age >= 65), used for all diagnostic accuracy analyses |
Both objects share the same 32 columns. all_old is a row subset of Ana_all.
Each row is one participant. ID is unique within each center and was used as the join key between the bioimpedance (BIA) export and the clinical dataset.
| Variable Name | Type | Description |
|---|---|---|
ID |
chr | Participant identifier, unique within center |
Age |
num | Age at assessment, years |
Sex |
Factor: male, female |
Sex, harmonised from the site-specific codes |
Height |
num | Body height, cm |
Weight |
num | Body weight, kg |
BMI |
num | Body mass index, kg/m². Provided by the Nuremberg dataset; computed as Weight / (Height/100)^2 for Antwerp |
SARCF |
num | SARC-F screening questionnaire, total score (0–10) |
SARCF_pos |
Factor: Negative, Positive |
SARC-F screen positive, defined as SARCF >= 4 |
HGSr |
num | Handgrip strength, right hand, kg |
HGSl |
num | Handgrip strength, left hand, kg |
HGS |
num | Handgrip strength used in the analysis: the higher of HGSr and HGSl, kg |
CST |
num | Five-times chair stand test, seconds. Recorded as "not possible" or 999 in the source data and set to NA here |
GS |
num | Gait speed, m/s. Nuremberg recorded gait time, which was inverted (1/GS) to give speed |
PA |
num | Whole-body bioimpedance phase angle, degrees |
ASM |
num | Appendicular skeletal muscle mass from BIA, kg (sum of the four limb segments) |
corASM |
num | Hydration-corrected ASM, kg. Antwerp: each limb segment × 0.39 / segmental water mass, then summed. Nuremberg: ASM × 74.3 / Hydration |
ASMh |
num | ASM indexed to height: 10000 × ASM / Height^2 (Height in cm), kg/m² |
ASMb |
num | ASM indexed to BMI: ASM / BMI |
MTmean |
num | Rectus femoris muscle thickness, mm. Mean of three repeated ultrasound measurements at 50% femur length |
CSAmean |
num | Rectus femoris cross-sectional area, cm². Mean of three repeated measurements |
PAmean |
num | Rectus femoris pennation angle, degrees. Mean of three repeated measurements |
FL |
num | Rectus femoris fascicle length, mm. Derived as MTmean / sin(PAmean × π / 180) |
asm_problem |
logi | Low muscle mass: ASM < 20 kg (men) or ASM < 15 kg (women) |
grip_problem |
logi | Low muscle strength: HGS < 27 kg (men) or HGS < 16 kg (women) |
cst_problem |
logi | Impaired physical performance: CST > 15 s, or CST missing |
MusLos |
Factor: No-Loss, Loss |
Reduced muscle strength / performance: cst_problem OR grip_problem |
sarcopenia |
Factor: Non-sarcopenic, Sarcopenic |
EWGSOP2 sarcopenia: asm_problem AND (grip_problem OR cst_problem) |
group3 |
Factor: Group I, Group II, Group III |
Group I = age < 65; Group II = age ≥ 65 without sarcopenia; Group III = age ≥ 65 with sarcopenia |
AgeG |
chr | Age group: "young" (< 65) or "old" (≥ 65) |
datas |
Factor: antwerpen, nuremberg |
Recruiting center |
| Criterion | Men | Women |
|---|---|---|
| Handgrip strength | < 27 kg | < 16 kg |
| Appendicular skeletal muscle mass | < 20 kg | < 15 kg |
| Chair stand test | > 15 s | > 15 s |
Missing-value coding. The source datasets use 999 as a missing-value sentinel. All numeric 999 values were converted to NA during cleaning. For handgrip strength this conversion happens before the cut-offs are applied, because 999 would otherwise be read as an extremely high grip strength.
Chair stand test. A participant unable to complete the test is treated as having impaired performance: cst_problem is TRUE when CST is missing as well as when CST > 15 s.
Factor level order. sarcopenia is coded with Non-sarcopenic as the first level and Sarcopenic as the second, and Sex with male first. This order matters: the ROC analyses pass levels = c("Non-sarcopenic", "Sarcopenic") so that the first level is treated as the control group, and the sex-stratified outputs follow the Sex level order.
group3 in all_old. Because all_old is restricted to age ≥ 65, only Group II and Group III occur. The three-group comparison (Figure 1) is therefore run on Ana_all, not on all_old.
Ultrasound measurements. All rectus femoris parameters are the mean of three repeated measurements taken at 50% of femur length. The three individual measurements are dropped during cleaning and are not present in the analysis datasets.
Exclusions. Participants with a pacemaker were excluded from the Antwerp sample, since bioimpedance analysis is contraindicated. Nuremberg participants were restricted to those flagged Include == 1, and participants missing all three ultrasound measurements were removed.
01_Data_clean_and_tidy_Sarcopenia.R- Cleans raw variables and handles missing values.02_Data_Analysis_Sarcopenia.R- Fits primary logistic regression models.