/* Predictive value of hand grip strength, calf circumference, and the SARC-F questionnaire for institutionalization and mortality in patients with hip fracture L. Matias Pehkonen MD*, Matias Blomqvist MD*, Sari Stenholm PhD, Maria S. Nuotio, MD, PhD *the first authorship is shared with equal contribution All analyses were conducted using SAS software version 9.4 (SAS Institute Inc., Cary, North Carolina, United States). This file contains the code used to generate the results presented in the manuscript submitted for publication in Aging Clinical and Experimental Research (Online ISSN 1720-8319) Dataset preparation was performed in a separate script. Further information is available upon reasonable request. Corresponding author: Matias Blomqvist, MD maerbl@utu.fi *\ /**********************************************************************************/ /* BASELINE CHARACTERISTICS /**********************************************************************************/ proc freq data=dataset; tables low_hgs low_cc sarcf_positive; run; %macro ttestmacro(dataset, myvariable, myclass); proc univariate data=&dataset. normal; where &myvariable. > 0; var &myvariable.; class &myclass.; run; proc ttest data=&dataset.; where &myvariable. > 0; var &myvariable.; class &myclass.; run; %mend; %macro wilcoxonmacro(dataset, myvariable, myclass); proc univariate data=&dataset. normal; where &myvariable. > 0; var &myvariable.; class &myclass.; run; proc npar1way data=&dataset. wilcoxon; class &myclass.; var &myvariable.; run; %mend; %macro chisqmacro(dataset, myvariable, myclass); proc freq data=&dataset.; table &myvariable.*&myclass. /chisq; run; %mend; proc univariate data=dataset; var age2; histogram /normal; run; proc univariate data=dataset normal; var gripstrength_kg; histogram gripstrength_kg/normal; run; proc univariate data=dataset; var leg_circ; histogram leg_circ/normal; run; proc univariate data=dataset; var sarcf_sum_base; histogram sarcf_sum_base/normal; run; proc univariate data=dataset; var mna_sum_base; histogram mna_sum_base /normal; run; %ttestmacro(dataset, age2, low_hgs); %wilcoxonmacro(dataset, gripstrength_kg, low_hgs); %ttestmacro(dataset, leg_circ, low_hgs); %wilcoxonmacro(dataset, sarcf_sum_base, low_hgs); %wilcoxonmacro(dataset, mna_sum_base, low_hgs); %ttestmacro(dataset, age2, low_cc); %wilcoxonmacro(dataset, gripstrength_kg, low_cc); %ttestmacro(dataset, leg_circ, low_cc); %wilcoxonmacro(dataset, sarcf_sum_base, low_cc); %wilcoxonmacro(dataset, mna_sum_base, low_cc); %ttestmacro(dataset, age2, sarcf_positive); %wilcoxonmacro(dataset, gripstrength_kg, sarcf_positive); %ttestmacro(dataset, leg_circ, sarcf_positive); %wilcoxonmacro(dataset, sarcf_sum_base, sarcf_positive); %wilcoxonmacro(dataset, mna_sum_base, sarcf_positive); %chisqmacro(dataset, sex, low_hgs); %chisqmacro(dataset, sex, low_cc); %chisqmacro(dataset, sex, sarcf_positive); %chisqmacro(dataset, memory_category, low_hgs); %chisqmacro(dataset, memory_category, low_cc); %chisqmacro(dataset, memory_category, sarcf_positive); %chisqmacro(dataset, asa_category, low_hgs); %chisqmacro(dataset, asa_category, low_cc); %chisqmacro(dataset, asa_category, sarcf_positive); %chisqmacro(dataset, living_arr_recoded, low_hgs); %chisqmacro(dataset, living_arr_recoded, low_cc); %chisqmacro(dataset, living_arr_recoded, sarcf_positive); /**********************************************************************************/ /* TRANSITION TO LTCF /**********************************************************************************/ proc freq data=dataset; tables low_hgs low_cc sarcf_positive; where 4 > livingarr_baseline > . and in_ltcf_12mo > .; run; proc freq data=dataset; tables in_ltcf_12mo*low_hgs in_ltcf_12mo*low_cc in_ltcf_12mo*sarcf_positive; where 4 > livingarr_baseline > . and in_ltcf_12mo > . and death_event=0; run; proc freq data=dataset; tables in_ltcf_12mo; where 4 > livingarr_baseline > . and in_ltcf_12mo > . and death_event=0; run; /* Model 1 - adjusted for age and sex */ title 'Transitioned to LTCF at 12 mo - HGS - Model 1'; proc logistic data=dataset; where 4 > livingarr_baseline > .; class sex; model in_ltcf_12mo (event='1') = low_hgs sex age2; run; title 'Transitioned to LTCF at 12 mo - CC - Model 1'; proc logistic data=dataset; where 4 > livingarr_baseline > .; class sex; model in_ltcf_12mo (event='1') = low_cc sex age2; run; title 'Transitioned to LTCF at 12 mo - SARC-F - Model 1'; proc logistic data=dataset; where 4 > livingarr_baseline > .; class sex; model in_ltcf_12mo (event='1') = sarcf_positive sex age2; run; /* Model 2 - adjusted for age, sex, MNA, ASA-score category, cognitive disorder status */ title 'Transitioned to LTCF at 12 mo - HGS - Model 2'; proc logistic data=dataset; where 4 > livingarr_baseline > .; class sex asa_category memory_category; model in_ltcf_12mo (event='1') = low_hgs sex age2 asa_category memory_category mna_sum_base; run; title 'Transitioned to LTCF at 12 mo - CC - Model 2'; proc logistic data=dataset; where 4 > livingarr_baseline > .; class sex asa_category memory_category; model in_ltcf_12mo (event='1') = low_cc sex age2 asa_category memory_category mna_sum_base; run; title 'Transitioned to LTCF at 12 mo - SARC-F - Model 2'; proc logistic data=dataset; where 4 > livingarr_baseline > .; class sex asa_category memory_category; model in_ltcf_12mo (event='1') = sarcf_positive sex age2 asa_category memory_category mna_sum_base; run; /**********************************************************************************/ /* MORTALITY /**********************************************************************************/ proc univariate data=dataset; var timetoevent; run; proc freq data=dataset; table death_event death_event*low_hgs death_event*low_cc death_event*sarcf_positive; run; /******************************************************************/ /* KAPLAN-MEIER ***************************************************/ /******************************************************************/ proc lifetest data=dataset outsurv=km_data_hgs; time timetoevent*death_event(0); strata low_hgs; run; proc sort data=km_data_hgs; by low_hgs timetoevent; run; proc export data=km_data_hgs outfile="" dbms=xlsx replace; run; proc lifetest data=dataset outsurv=km_data_cc; time timetoevent*death_event(0); strata low_cc; run; proc sort data=km_data_cc; by low_cc timetoevent; run; proc export data=km_data_cc outfile="" dbms=xlsx replace; run; proc lifetest data=dataset outsurv=km_data_sarcf; time timetoevent*death_event(0); strata sarcf_positive; run; proc sort data=km_data_sarcf; by sarcf_positive timetoevent; run; proc export data=km_data_sarcf outfile="" dbms=xlsx replace; run; /* COX */ /* Model 1 - adjusted for age and sex */ proc phreg data=dataset; class low_hgs (ref='0') sex; model timetoevent*death_event(0) = low_hgs sex age2 /rl; run; proc phreg data=dataset; class low_cc (ref='0') sex; model timetoevent*death_event(0) = low_cc sex age2 /rl; run; proc phreg data=dataset; class sarcf_positive (ref='0') sex; model timetoevent*death_event(0) = sarcf_positive sex age2 /rl; run; /* Model 2 - adjusted for age, sex, MNA, ASA-score category, cognitive disorder status */ proc phreg data=dataset; class low_hgs (ref='0') sex asa_category memory_category; model timetoevent*death_event(0) = low_hgs sex age2 asa_category memory_category mna_sum_base/rl; run; proc phreg data=dataset; class low_cc (ref='0') sex asa_category memory_category; model timetoevent*death_event(0) = low_cc sex age2 asa_category memory_category mna_sum_base/rl; run; proc phreg data=dataset; class sarcf_positive (ref='0') sex asa_category memory_category; model timetoevent*death_event(0) = sarcf_positive sex age2 asa_category memory_category mna_sum_base/rl; run; /* Schoenfeld residuals */ proc phreg data=dataset; where low_hgs > .; class low_hgs(ref='0'); model timetoevent*death_event(0) = low_hgs sex age2 asa_category memory_category mna_sum_base/ rl; output out=cox_output ressch=low_hgs_res sex_res age2_res asa_category_res memory_category_res mna_sum_base_res; run; proc corr data=cox_output pearson; var low_hgs_res age2_res sex_res asa_category_res memory_category_res mna_sum_base_res; with timetoevent; run; proc phreg data=dataset; where low_cc > .; class low_cc(ref='0'); model timetoevent*death_event(0) = low_cc sex age2 asa_category memory_category mna_sum_base/ rl; output out=cox_output ressch=low_cc_res sex_res age2_res asa_category_res memory_category_res mna_sum_base_res; run; proc corr data=cox_output pearson; var low_cc_res age2_res sex_res asa_category_res memory_category_res mna_sum_base_res; with timetoevent; run; proc phreg data=dataset; where sarcf_positive > .; class sarcf_positive(ref='0'); model timetoevent*death_event(0) = sarcf_positive sex age2 asa_category memory_category mna_sum_base/ rl; output out=cox_output ressch=sarcf_positive_res sex_res age2_res asa_category_res memory_category_res mna_sum_base_res; run; proc corr data=cox_output pearson; var sarcf_positive_res age2_res sex_res asa_category_res memory_category_res mna_sum_base_res; with timetoevent; run; /**********************************************************************************/ /* SUPPLEMENT 1 : REPRESENTATION /**********************************************************************************/ %ttestmacro(dataset, age2, all_measured); %chisqmacro(dataset, sex, all_measured); %chisqmacro(dataset, living_arr_recoded, all_measured); %chisqmacro(dataset, asa_category, all_measured); %chisqmacro(dataset, memory_category, all_measured); %wilcoxonmacro(dataset, mna_sum_base, all_measured); proc freq data=dataset; table mna_missing*all_measured /missprint; run;