User Tools

Site Tools


r:composites

How to make a composite score

In practice

An example with ADNI data

library("ADNIMERGE")
dxmci=dxsum[dxsum[, "DXMDUE"] == "MCI due to Alzheimer's Disease" & !is.na(dxsum$DXMDUE) & dxsum[, "DXMDES"] == "MCI - Memory features (amnestic)" & !is.na(dxsum$DXMDES),]
mcimerged0 <- merge(dxmci, adnimerge, by=c("RID", "VISCODE"))
neurom <- merge(adas, neurobat, by=c("RID", "VISCODE"))
mcineuro <- merge(mcimerged0, neurom, by=c("RID", "VISCODE"))
mcidata <- data.frame(mcineuro$RID, mcineuro$VISCODE, mcineuro$AGE, mcineuro$PTGENDER, mcineuro$PTEDUCAT, mcineuro$APOE4, mcineuro$FDG, mcineuro$AV45, mcineuro$Hippocampus, mcineuro$ICV, mcineuro$Years, mcineuro$AVDEL30MIN, mcineuro$Q4SCORE, mcineuro$DX.bl, mcineuro$DX, mcineuro$DXMDUE, mcineuro$DXMDES)

for just amyloid burden

mciav45 <- data.frame(mcineuro$RID, mcineuro$VISCODE, mcineuro$AGE, mcineuro$PTGENDER, mcineuro$PTEDUCAT, mcineuro$APOE4, mcineuro$AV45, mcineuro$Years, mcineuro$AVDEL30MIN, mcineuro$Q4SCORE, mcineuro$DX.bl, mcineuro$DX, mcineuro$DXMDUE, mcineuro$DXMDES)
datac <- mciav45[complete.cases(mciav45),]
datac$cAGE = datac$mcineuro.AGE + datac$mcineuro.Years
r/composites.txt · Last modified: 2020/08/04 10:58 (external edit)