help > RE: Design matrix and contrast for 2 way ANOVA, and f-value
Dec 6, 2019  12:12 AM | Andrew Zalesky
RE: Design matrix and contrast for 2 way ANOVA, and f-value
Hi Davide,

The interaction column of your design matrix appears to have some errors. The interaction column should be the multiplication of the two main effects columns. For example, the interaction column should have a value of 1 for the last row of the design matrix because -1 * -1 = 1, but the current design matrix has a -1 here. 

1. You should add a column of 1's. However, another alternative is to model the repeated measures aspect of your design. If you want to model the repeated measures, you would not include a column of 1's, but instead include a new column for each subject. Each such column would have two 1's and 0's every else. In particular, you would place 1's in the two measurements for each subject and 1's elsewhere. Crucially, you will need to remove the first column (main effect of drugs) if you use repeated measures. This is because the main effect of drugs is fixed between the two conditions (does not change between conditions). So if you decide to model the repeated measures, your design matrix would have 18 columns: main effect of condition + interaction + 1 column for each subject. You can send me your new design matrix and I would be happy to have a look at it.

2. I suggest using a t-test and separately considering a contrast of -1 and 1.

3. 5000-10000 should be enough.

Andrew


Originally posted by davideit7:
Hi Dr. Zalesky

Thanks for this really usefull toolbox. I've just started to use it and I'm still quite insecure relatively to the definition of the design matrix.
I think this is the adeguate place to post my question.
I have 16 subjects equally divided in 2 groups (placebo & treatment) and each of the subjects participate in 2 different condition (inclusion & exclusion), I suppose I should design a 2 way between subjects anova.
I've define the design matrix and contrast that you can find attached, I'm wondering if this is correct or not. Furthermore I have some other question:

1- Should I also add a column of 1's as first column?
2- What would be better to use a t-test or an f-test?
3- How many permutation should I set?

Thanks for your attention.
Davide

Threaded View

TitleAuthorDate
Woomi Ban May 30, 2019
davideit7 Dec 5, 2019
RE: Design matrix and contrast for 2 way ANOVA, and f-value
Andrew Zalesky Dec 6, 2019
davideit7 Dec 6, 2019
Andrew Zalesky Dec 7, 2019
davideit7 Jan 20, 2020
Andrew Zalesky Jan 21, 2020
davideit7 Jan 22, 2020
Andrew Zalesky Jan 23, 2020
Woomi Ban Jun 10, 2019
Andrew Zalesky Jun 10, 2019
Andrew Zalesky Jun 1, 2019