ANOVA / GLM

17 views
Skip to first unread message

John Anderson

unread,
Apr 10, 2016, 1:36:02 PM4/10/16
to brainGraph-help
Dear Chris Watson,

Thank you so much for putting together this package!  I've started looking through the documentation & can see that two-group comparisons will be easily accommodated by this framework.  Is it possible to use this package to perform the equivalent of an ANOVA?  

Thanks in advance,

John

Chris Watson

unread,
Apr 10, 2016, 2:57:20 PM4/10/16
to brainGr...@googlegroups.com
Hi John,
Currently 2 of 3 functions that perform linear modeling do not allow for more complicated designs (NBS, and group.graph.diffs). This was partly to increase the user-friendliness of the functions, and partly for speed reasons (NBS and group.graph.diffs use the function "fastLmPure" from the "RcppEigen" package, which as far as I know only takes simpler models).

It would help to see what your use case is (possibly with either dummy data, or a few rows from your covariates table and data table, or the model you would like to use). For "get.resid", since it uses the "lm" function from base R, you should be able to supply any model you want. This is applicable with volumetric data (thickness, volume, gyrification, surface area), and I have done it with more than 2 groups. However, it is not an ANOVA per se.

So, please let me know what your use case is (DTI vs. volumetrics; NBS or difference between group graphs, i.e. using "group.graph.diffs"), and I can try to see if it would be feasible.

Chris

--
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 post to this group, send email to brainGr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brainGraph-help/c5a6c7d8-9748-4016-83ff-1f6d29e5c46a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

John Anderson

unread,
Apr 10, 2016, 3:00:19 PM4/10/16
to brainGraph-help
Hi Chris,

Thanks for your reply.  I'm working with group correlation matrices generated from resting-state fMRI.  So, I think the group.graphs.diffs function sounds most like what I need.  

John

Chris Watson

unread,
Apr 10, 2016, 3:07:21 PM4/10/16
to brainGr...@googlegroups.com
How many groups and how many covariates do you have?

--
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 post to this group, send email to brainGr...@googlegroups.com.

John Anderson

unread,
Apr 10, 2016, 3:09:00 PM4/10/16
to brainGraph-help
I'm trying to compare 3 groups using the AAL 90 regions (excluding cerebellum).  I haven't included other covariates at this stage.

Chris Watson

unread,
Apr 11, 2016, 10:08:24 AM4/11/16
to brainGr...@googlegroups.com
If you don't have any covariates, then you can use "kruskal.test" to test for a difference between all groups. I think the easiest way would be to have a data.table of your network measures of interest (in my User Guide, I usually call it something like "dt.net.meas").

If, for example, you would like to test for a between-group difference in "vertex degree" at every vertex (region), something like this should work:

dt.net.meas[, kruskal.test(degree ~ as.numeric(Group))$p.value, by=region]

If you have multiple thresholds/densities,
dt.net.meas[, kruskal.test(degree ~ as.numeric(Group))$p.value, by=.(threshold, region)]

Note that this code only returns the p-values.

Let me know if this helps you.
Chris

Chris Watson

unread,
Feb 15, 2017, 3:52:46 PM2/15/17
to brainGraph-help
Hi John et al.,
I know this post is nearly 1 year old, but I have finally addressed the issues that were present in doing group comparisons. I hope to push the updates to both Github and CRAN in the next couple of weeks.

You can see the details in Chapter 7 of the User Guide (https://www.dropbox.com/s/wmupawb39bcdho3/brainGraph_UserGuide.pdf?dl=0). The examples are meant to be similar to FSL's GLM page, showing design matrix setup.

You will be able to do a 2-way ANOVA but unfortunately I currently do not have working code for a 3-way ANOVA. However this functionality is already greatly improved over previous versions.

Chris


On Monday, April 11, 2016 at 9:08:24 AM UTC-5, Chris Watson wrote:
If you don't have any covariates, then you can use "kruskal.test" to test for a difference between all groups. I think the easiest way would be to have a data.table of your network measures of interest (in my User Guide, I usually call it something like "dt.net.meas").

If, for example, you would like to test for a between-group difference in "vertex degree" at every vertex (region), something like this should work:

dt.net.meas[, kruskal.test(degree ~ as.numeric(Group))$p.value, by=region]

If you have multiple thresholds/densities,
dt.net.meas[, kruskal.test(degree ~ as.numeric(Group))$p.value, by=.(threshold, region)]

Note that this code only returns the p-values.

Let me know if this helps you.
Chris
On Sun, Apr 10, 2016 at 3:08 PM, John Anderson wrote:
I'm trying to compare 3 groups using the AAL 90 regions (excluding cerebellum).  I haven't included other covariates at this stage.

On Sunday, April 10, 2016 at 3:07:21 PM UTC-4, Chris Watson wrote:
How many groups and how many covariates do you have?

On Sun, Apr 10, 2016 at 3:00 PM, John Anderson <johnaea...@gmail.com> wrote:
Hi Chris,

Thanks for your reply.  I'm working with group correlation matrices generated from resting-state fMRI.  So, I think the group.graphs.diffs function sounds most like what I need.  

John

On Sunday, April 10, 2016 at 1:36:02 PM UTC-4, John Anderson wrote:
Dear Chris Watson,

Thank you so much for putting together this package!  I've started looking through the documentation & can see that two-group comparisons will be easily accommodated by this framework.  Is it possible to use this package to perform the equivalent of an ANOVA?  

Thanks in advance,

John

--
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 post to this group, send email to brainGr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brainGraph-help/f591697b-3a90-459a-9519-b2655ca97f3a%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
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-help+unsubscribe@googlegroups.com.
To post to this group, send email to brainGraph-help@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages