Mon Apr 22 09:58:21 2013
The long term goal is to discover structure that is meaningful in terms of treatment outcomes.
C-data (time_series_cc200_20130402): C is for connectome, which just refers, in this case, to the fMRI data. The 197 regions are obtained from the 'all voxel' data via parsing voxels into regions. We already know the function relating the 197 to the all voxels case, because we wrote it.
P-data (NEO2012.csv): P is short for phenotype, in this case, it is the 5 factor model, which are the 5 factors: ENOAC (sometimes ordered differently and called OCEAN).
NEO2012.csv has 42 subjects and the following columns: ParticipantID,Sex,Age,E,N,O,A,C the last 5 are the “5 factors”
NEO2012_linkage.csv has 42 subjects and 2 columns: the first is the ParticipantID, which is listed in the other file, the second is the file name. so it maps participant id to file, which we need.
ScaledScales.xls: this is the file that had the original data that i extracted NEO2012.csv from. you shouldn't need it, but it is the raw data, so i didn't want to discard it.
print(load("outC.Rbin"))
## [1] "outC"
attach(outC)
dim(ts[[1]])
## [1] 194 197
plotmat(ts[[1]])
distC <- normalize(dissmat)
dim(distC)
## [1] 42 42
outP <- doPdata()
attach(outP)
plotmat(as.matrix(pdat))
distP <- dmat
distP <- normalize(distP)
dim(distP)
## [1] 42 42
## form omnibus matrix
meanD <- (distC + distP)/2
omni <- rbind(cbind(distC, meanD), cbind(t(meanD), distP))
dim(omni)
## [1] 84 84
## embed
n2 <- n * 2
mds <- cmdscale(omni, n2 - 1)
# w <- 0.01 W1 <- matrix(w,n,n) W2 <- matrix(0,n,n) diag(W2) <- 1-w W <-
# rbind(cbind(W1,W2),cbind(t(W2),W1)) mds <-
# smacofSym(omni,n2-1,weightmat=W)$conf
elbow <- getElbows(mds, 3)
dat <- mds[, 1:elbow[2]]
## cluster
cl <- Mclust(dat)
summary(cl)
## ----------------------------------------------------
## Gaussian finite mixture model fitted by EM algorithm
## ----------------------------------------------------
##
## Mclust VVI (diagonal, varying volume and shape) model with 2 components:
##
## log.likelihood n df BIC
## 2264 84 69 4222
##
## Clustering table:
## 1 2
## 48 36
plot(cl, "BIC")
table(cluster = cl$class, data = lab)
## data
## cluster C P
## 1 6 42
## 2 36 0
adjustedRandIndex(cl$class, as.numeric(lab))
## [1] 0.7315