Assuming you have calculated small worldness either through the
"analysis_random_graphs" function (which returns, as one of the list elements, a
table containing small world coefficients) or separately with the "small.world"
function.
I assume that, following the User Guide, these values are in the variable
"small.dt". I also assume that you have subject-level graphs in a nested list
called "g", in which for example "g.list[[1]]" is for Group 1, "g.list[[1]][[1]]" is for
the first threshold, and "g.list[[1]][[1]][[1]]" is the first subject of Group 1 at
the first threshold. Furthermore, I assume the thresholds are in the vector
"thresholds", and the group names are in the vector "groups".
You could do it like the following.
subjects <- vector('list', length=length(groups))
for (i in seq_along(g.list)) {
subjects[[i]] <- covars[Group == groups[i], Study.ID]
for (j in seq_along(g.list[[i]])) {
for (k in seq_along(g.list[[i]][[j]])) {
g.list[[i]][[j]][[k]]$sigma <- small.dt[Study.ID == subjects[[i]][k] & threshold == thresholds[j], sigma]
}
}
}
I do not know if this will work without error, so you may have to adjust the
code to work with your dataset.
Please let me know if you have any questions/issues.
Chris
> date: Thu, Jan 30 04:54 PM -08:00 2020
> subject: Re: [brainGraph-help] MTPC on small-worldness
>
> I have been able to apply MTPC on regular graph/vertex attributes according
> to the manual. Could you show me the command line to add small-world
> coefficients, such as sigma and omega, into the g.list that will be fed
> into MTPC function?
>
> Yadi
>
> 在 2020年1月31日星期五 UTC+8上午12:52:11,Chris Watson写道:
>>
>> You could, but you would have to assign a graph attribute to every subject
>> containing the small-world coefficient, or whatever values you want to
>> compare.
>>
>> Chris
>>
>> On Thu, Jan 30, 2020 at 10:42 AM, yd li <
flys...@126.com <javascript:>>
>> wrote:
>>
>> > from: yd li <
flys...@126.com <javascript:>>
>> > date: Thu, Jan 30 08:42 AM -08:00 2020
>> > to: brainGraph-help <
brainGr...@googlegroups.com <javascript:>>
>> > reply-to:
brainGr...@googlegroups.com <javascript:>
>> > subject: [brainGraph-help] MTPC on small-worldness
>> >
>> > Hi Chris,
>> > Can we use MTPC function to analyze the difference of small-world
>> > attributes between groups?
>> >
>> > Thanks,
>> > Yadi
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups "brainGraph-help" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> an email to
brainGr...@googlegroups.com <javascript:>.
> --
> You received this message because you are subscribed to the Google Groups "brainGraph-help" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
brainGraph-he...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/brainGraph-help/4befdbe8-8194-4a35-b383-be60ab378c43%40googlegroups.com.