Closed bernard-liew closed 9 years ago
Hi Bernard,
First, apologies for the problems with the random effects (RFX) documentation.
Please find that the online documentation has been fixed. You should now be able to see the RFX figures here: http://www.spm1d.org/doc/RandomEffects.html (you might need to refresh your browser to see the changes)
The source code has also been updated (version 0.3.1.3) with the RFX examples available here:
Regarding your design and analysis:
Within-group (between-subject) variability is accounted for at stage 3. If the subjects are truly different we would expect them to have very different beta curves in stage 1 and thus the t value in stage 3 would be low. Note that, because this is a repeated-measures design, between-subject variability itself doesn't matter; only beta variability matters.
To emphasize this point consider a paired t test, where beta is the difference:
Subject | Condition A | Condition B | beta |
---|---|---|---|
1 | 105 | 95 | -10 |
2 | 530 | 520 | -10 |
... | ... | ... | ... |
8 | 4018 | 4008 | -10 |
In this example it doesn't matter if the between-subject variability is high in Condition A and Condition B, because the Condition A and Condition B values are irrelevant to the hypothesis. Only beta is relevant to the hypothesis.
Last, note that the two-sample test accounts for non-sphericity (unequal variances in the two groups) if equal_var=False
as in:
t = spm1d.stats.ttest2(YB, YA, equal_var=False)
Cheers,
Todd
Many thanks Todd,
Very clear. I assume I can also use the level two analysis method not only for t test, but also for one way Anova?
Is it also appropriate to perform random effects analysis using multivariate analysis, eg. extract beta vectors for individual subjects and then doing a Hotelling's or Manova? Can spm1d perform such a functionality?
Many thanks Todd,
regards, Bernard
Hi Bernard,
You are correct: second-level analysis can involve any design. Most often it will be a t test simply because the interpretation becomes too complicated otherwise. This is analogous to three way ANOVA, where interaction effects can be very difficult to interpret.
Two-level multivariate RFX analysis is possible in general but there is an important complication: the first- and second-level analyses can not be completely separated like they can be for univariate analysis. The basic reason is that multivariate results are rotated with respect to the original coordinate system, so to retain meaningful second-level results those rotations must be constrained at the first level. This type of analysis approaches the boundaries of current SPM theory, and I personally know of only one paper which describes how to conduct this kind of analysis, but that paper just came out in the past year. Because it is so new, two-level multivariate RFX analyses will not be supported in spm1d for some time.
For now I recommend employing repeated-measures multivariate designs (which will be supported much sooner in spm1d) or even better: formulate a more specific hypothesis prior to your experiment in order to simplify the experimental design, analysis and interpretation.
Todd
Many thanks Todd for the very clear advise. I will heed it.
Regards, Bernard
Dear Todd,
I am helping someone to perform SPM on their dataset, and couldn't really see the figures on the spm1d's section on random effects. In addition, the link to the codes does not seem to be present in my spm1d folder. I hope you can assist with the following.
Experiment: Two groups (typical (T) and non typical (NT) children) repeated measures (jog, run, sprint) running lab study. Each group has 15 children. Speed was not fixed but was categorically classified as above. So I would have within subject variation in their self-determined speed, within group (between subject) variation in their self determined speed, and between group variation.
Research Qn: How does speed influence running joint power? Is the effect of speed on joint power different from NT kids compared to T?
Analysis:
1) Do a regression for each subject (all 30) on the effects of speed on the DV, to get a beta value 2) Compile the beta values for each group (2 sets of 15) e.g. BetaT and Beta NT 3) Do a two sample t test between betaT and betaNT
Dilemma: My proposed steps do not seem to account within group variation. We think that especially in the NT kids, between subject variability may significant.
Your views are very much appreciated.
Regards, Bernard