Following up on this.
I have read the links on contrast coding attempting to apply it to NBS() to find edges that are (1) different (2) stronger in impaired or (3) stronger in unimpaired. I have shifted from using "effects" to "dummy" for simplicity. Also, if I use "dummy" I sometimes get the error "
Error in factor(contrast, labels = tmp$con.name) :
invalid 'labels'; length 2 should be 1 or 0
" for some comparisons depending on "alternative" choice.
I think this is happening when one dimension of the contrast does not have significant results. I am unsure but based on using the dummy coding, it seems to align. My covar table looks like
data_i_table
Study.ID Age Sex Impairment
<num> <num> <fctr> <fctr>
Relevant Code
con.mat<-cbind(0,0,0,1)
rownames(con.mat) <- c('Impaired vs Unimpaired')
X_spec <- brainGraph_GLM_design(data_i_table, coding='dummy',binarize=c('Sex'))
res.nbs.two <- NBS(A=cm_Use, covars=data_i_table, contrasts=con.mat,con.type="t", X=X_spec,p.init=0.001, N=5000, alternative="two.sided")
For the most part, I think this is working but there are some checks that didnt make sense.
e.g. For a "two.sided" comparison here, shouldn't contrast of [0 0 0 1] and [0 0 0 -1] be the same? If not, what is the difference here, because NBS() returns different results? It should basically mean either u1-u2!=0 or u2-u1!=0
e.g. Shouldnt a [0 0 0 1] of a "greater" comparison be the same as a [ 0 0 0 -1] of a "less" comparison? Similarly, u1-u2>0 should convert to u2-u1<0?
Thank you,