##### DWASS-STEEL-CRITCHLOW-FLIGNER TEST ###### 

# data$x = biomarker from df data e.g. pTau212
# data$Group should be defined based on data frame and column with grouping variable <2

data=data
PMCMRplus::dscfAllPairsTest(x ~ Group, data=data)

##### Linear models for biomarkers and pathology ######

# data$x = biomarker from df data e.g. pTau212
# Group should be defined based on data frame and column with grouping variable, e.g. Thal, CERAD 
# data$x = biomarker from df data e.g. pTau212

data = data
lm_model = lm(x ~ Group + sex + interval + age, data=data)
emeans_lm_model <- emmeans(lm_model, pairwise~Group)
emeans_lm_model 

##### ROC and AUC analysis with DeLong test #####
# data$ROC = 0 as a reference group to comparison 
#data$x = biomarker from df data e.g. pTau212
data=data
roc_x = pROC::roc(response = data$ROC, predictor = data$x, ci = T)
roc_x
## DeLong test for ROC comparison ##
x1_ROC_vs_x2_ROC <- pROC::roc.test(roc_x1, roc_x2, method=c("delong"), progress=getOption("pROCProgress")$name)
x1_ROC_vs_x2_ROC