pangea icon indicating copy to clipboard operation
pangea copied to clipboard

Contrast Codes

Open MattDKeller opened this issue 7 years ago • 2 comments

First of All: Thanks very much for such a useful tool!

Issue: If I have a crossed random stimulus factor in my design with more than 2 levels, it matters how I scale my contrast. Keeping all parameters at the same levels, but changing the scale of the contrast code, results in different power assumptions.

Example Design: 1 random factor (participant), 1 fixed factor (stimulus) with 3 levels; Everything is crossed. --> The contrast (1 | -1 | 0) results in a higher power assumptions than the contrast (2 | -2 | 0)

Best, Matt

MattDKeller avatar Jan 18 '18 09:01 MattDKeller

Definitely a bug. Note that it works as expected (i.e., results are invariant to the scale of the contrast) in the single-random-factor case, but then adding the crossed random factor breaks that invariance for some reason.

As an interim workaround, I believe that manually scaling your contrast codes so that the population variance/SD (i.e., using N rather than N-1 in the denominator) across the contrast values is equal to 1 should produce the mathematically correct results -- although I've yet to concretely verify that hunch.

jake-westfall avatar Jan 19 '18 21:01 jake-westfall

I believe tentatively that this is now fixed in the live version of PANGEA. But I'm not closing the issue yet (and haven't pushed to GitHub yet) because I still need to check a few things and, if it all looks good, document the changes. In the meantime, please try this out again and see what you think.

jake-westfall avatar Mar 25 '18 04:03 jake-westfall