Hi AndersonModelling linear and quadratic effects directly in EVs rather than in contrasts does seem like a better approach. Using this model could I not now also model individual differences (ID) (demeaned) related to the linear and quadratic trends in the contrasts as follows?C1 Positive linear: [0 0 0 ... 0 0 0 1 0]C2 Negative linear: [0 0 0 ... 0 0 0 -1 0]
C3 U-shape quadratic: [0 0 0 ... 0 0 0 0 1]C4 inverted-U-shape quadratic ID: [0 0 0 ... 0 0 0 0 -1]
C5 Positive linear ID: [IQsubj1 IQsubj2 IQsubj3 ... IQsubj22 IQsubj23 IQsubj 1 0]C6 Negative linear ID: [IQsubj1 IQsubj2 IQsubj3 ... IQsubj22 IQsubj23 IQsubj -1 0]
C7 U-shape quadratic ID: [IQsubj1 IQsubj2 IQsubj3 ... IQsubj22 IQsubj23 IQsubj 0 1]C8 inverted-U-shape quadratic ID: [IQsubj1 IQsubj2 IQsubj3 ... IQsubj22 IQsubj23 IQsubj 0 -1]
Also, am I right in thinking that an f-test between C1 and C3 would tell me where positive/negative linear/quadratic response occurred and that, provided it shows significance, I should be looking at contrasts to identify specific response functions/directions?
With this approach could I still include measures that are scan-specific (not subject-specific) in EV columns modifying the contrasts, as you mentioned in the previous email?C9 [0 0 0 ... 0 0 0 0 0 1]C10 [0 0 0 ... 0 0 0 0 0 -1](a 0 would be added to each contrast above)
Thanks again for your input.Chris########################PS: Btw, you mention n-shaped, which I think you mean a cubic relationship. It's possible to add yet another EV (the EV27), that would be the same EV25, but cubed (so, -8 -1 0 1 8). Then add one more contrast as [0 0 0 ... 0 0 0 0 0 1] and include it in the F-test.On 19 February 2015 at 07:25, Anderson M. Winkler <[log in to unmask]> wrote:Hi Chris,
Please, see below:On 18 February 2015 at 15:45, Christophe de Bezenac <[log in to unmask]> wrote:Hi Anderson,Thanks for your reply. I was thinking of including subject-specific variables of interest (as opposed to nuisance variables). For instance, I wanted to include individuals’ performance on a behavioural task (demeaned) to examine how activation within contrasts of interest (linear/quadratic) is modulated by performance. Would this be possible/make sense in this context?To test a subject-specific variable, then using the same design you have, the subject-specific measure can be coded in the contrast. For instance: you have the 24 subjects of your design, with EV1-EV24 for the subject-specific effects, and would like to test, say, whether IQ is associated with the imaging data. The contrast is then:[IQsubj1 IQsubj2 IQsubj3 ... IQsubj22 IQsubj23 IQsubj24 0 0 0 0]Note that in this model it's not possible to test interactions, as the variable being tested (IQ in this example) is the same across all levels.If, however, you'd like a measurement that isn't subject-specific, but that is specific for each scan (i.e., level within condition, such as if the performance at a certain fMRI task relates to the BOLD response), then it's much simpler: just add one extra column for the variable of interest, and modify the contrast so that it's tested. In this case, interactions are possible, as there are multiple measurements per subject.Regarding the reference level, am I right in thinking that the results would be with L1 as reference instead of L5?The results won't really change, particularly for the F-tests. I only mentioned because in the design you labelled the contrast as with reference to L1. Which is the one used as reference doesn't really matter that much, so no worries.To make sure that I understand the logic, do the contrasts below look right?positive linear: [0 0 0 … 0 0 0 -48 -24 0 24]negative linear: [0 0 0 … 0 0 0 48 24 0 -24]n-shape quadratic [0 0 0 … 0 0 0 -48 24 48 24]u-shape quadratic [0 0 0 … 0 0 0 48 -24 -48 -24]The linear are fine, but the quadratic is not. The problem is that the GLM is "linear" in that the effects are treated as linear combinations of the regressors and regression coefficients. Coding a test as this with the contrast is fine as long as the hypothesised effect remains linear. To get around this, you'd have to change the design a bit:- EV1-EV24: subject-specific EVs, just as you already have- EV25: use a sequence of values in an arithmetic progression to represent the 5 levels (e.g., -2 -1 0 1 2)- EV26: square the values from the previous EV for quadratic effects (in this example, 4 1 0 1 4)For the contrasts, use:C1: [0 0 0 ... 0 0 0 1 0] F1C2: [0 0 0 ... 0 0 0 0 1] F1
(that is, define an F-test that includes C1 and C2).In fact, the same design can be used for the linear effects too (just the C1 above), and it may be more powerful than the other that codes it with the contrast and has fewer degrees of freedom.Hope this helps.All the best,
Anderson<design.png>
Hi AndersonModelling linear and quadratic effects directly in EVs rather than in contrasts does seem like a better approach. Using this model could I not now also model individual differences (ID) (demeaned) related to the linear and quadratic trends in the contrasts as follows?C1 Positive linear: [0 0 0 ... 0 0 0 1 0]C2 Negative linear: [0 0 0 ... 0 0 0 -1 0]C3 U-shape quadratic: [0 0 0 ... 0 0 0 0 1]C4 inverted-U-shape quadratic ID: [0 0 0 ... 0 0 0 0 -1]C5 Positive linear ID: [IQsubj1 IQsubj2 IQsubj3 ... IQsubj22 IQsubj23 IQsubj 1 0]C6 Negative linear ID: [IQsubj1 IQsubj2 IQsubj3 ... IQsubj22 IQsubj23 IQsubj -1 0]C7 U-shape quadratic ID: [IQsubj1 IQsubj2 IQsubj3 ... IQsubj22 IQsubj23 IQsubj 0 1]C8 inverted-U-shape quadratic ID: [IQsubj1 IQsubj2 IQsubj3 ... IQsubj22 IQsubj23 IQsubj 0 -1]Also, am I right in thinking that an f-test between C1 and C3 would tell me where positive/negative linear/quadratic response occurred and that, provided it shows significance, I should be looking at contrasts to identify specific response functions/directions?With this approach could I still include measures that are scan-specific (not subject-specific) in EV columns modifying the contrasts, as you mentioned in the previous email?C9 [0 0 0 ... 0 0 0 0 0 1]C10 [0 0 0 ... 0 0 0 0 0 -1](a 0 would be added to each contrast above)Thanks again for your input.Chris########################PS: Btw, you mention n-shaped, which I think you mean a cubic relationship. It's possible to add yet another EV (the EV27), that would be the same EV25, but cubed (so, -8 -1 0 1 8). Then add one more contrast as [0 0 0 ... 0 0 0 0 0 1] and include it in the F-test.On 19 February 2015 at 07:25, Anderson M. Winkler <[log in to unmask]> wrote:Hi Chris,
Please, see below:On 18 February 2015 at 15:45, Christophe de Bezenac <[log in to unmask]> wrote:Hi Anderson,Thanks for your reply. I was thinking of including subject-specific variables of interest (as opposed to nuisance variables). For instance, I wanted to include individuals’ performance on a behavioural task (demeaned) to examine how activation within contrasts of interest (linear/quadratic) is modulated by performance. Would this be possible/make sense in this context?To test a subject-specific variable, then using the same design you have, the subject-specific measure can be coded in the contrast. For instance: you have the 24 subjects of your design, with EV1-EV24 for the subject-specific effects, and would like to test, say, whether IQ is associated with the imaging data. The contrast is then:[IQsubj1 IQsubj2 IQsubj3 ... IQsubj22 IQsubj23 IQsubj24 0 0 0 0]Note that in this model it's not possible to test interactions, as the variable being tested (IQ in this example) is the same across all levels.If, however, you'd like a measurement that isn't subject-specific, but that is specific for each scan (i.e., level within condition, such as if the performance at a certain fMRI task relates to the BOLD response), then it's much simpler: just add one extra column for the variable of interest, and modify the contrast so that it's tested. In this case, interactions are possible, as there are multiple measurements per subject.Regarding the reference level, am I right in thinking that the results would be with L1 as reference instead of L5?The results won't really change, particularly for the F-tests. I only mentioned because in the design you labelled the contrast as with reference to L1. Which is the one used as reference doesn't really matter that much, so no worries.To make sure that I understand the logic, do the contrasts below look right?positive linear: [0 0 0 … 0 0 0 -48 -24 0 24]negative linear: [0 0 0 … 0 0 0 48 24 0 -24]n-shape quadratic [0 0 0 … 0 0 0 -48 24 48 24]u-shape quadratic [0 0 0 … 0 0 0 48 -24 -48 -24]The linear are fine, but the quadratic is not. The problem is that the GLM is "linear" in that the effects are treated as linear combinations of the regressors and regression coefficients. Coding a test as this with the contrast is fine as long as the hypothesised effect remains linear. To get around this, you'd have to change the design a bit:- EV1-EV24: subject-specific EVs, just as you already have- EV25: use a sequence of values in an arithmetic progression to represent the 5 levels (e.g., -2 -1 0 1 2)- EV26: square the values from the previous EV for quadratic effects (in this example, 4 1 0 1 4)For the contrasts, use:C1: [0 0 0 ... 0 0 0 1 0] F1C2: [0 0 0 ... 0 0 0 0 1] F1
(that is, define an F-test that includes C1 and C2).In fact, the same design can be used for the linear effects too (just the C1 above), and it may be more powerful than the other that codes it with the contrast and has fewer degrees of freedom.Hope this helps.All the best,
Anderson<design.png>