help > RE: Design matrix for a few repeat scans
Jan 31, 2021  01:01 AM | Andrew Zalesky
RE: Design matrix for a few repeat scans
Hi Jay,

With this design, ideally you should have repeat scans in all subjects. If you only have repeat scan in some subjects, but not others, you may want to consider a linear mixed effects model, which is a better option in this case (but a lot more complex and slower). There is an R package called NBR which implements NBS in a mixed effects model. 

If you stick with the current model, I would add a column for all subjects, not just those with repeat scans. Once again though, this is not an optimal model when not all subjects have repeat scans. 

When modeling sex, use 0 and 1, rather than 1 and 2. 

Yes - the contrast is correct. 

Andrew
Originally posted by jdc77:
Thanks for your response!

So, that means my design matrix will be:
1 1 0 0 1 24
1 0 1 0 2 18
1 0 0 1 1 35
1 0 0 1 1 42
0 1 0 0 2 16
0 0 1 0 1 18
0 0 0 1 1 29
0 0 0 1 1 32

I added a column for all subjects including those with single scans only. Or do I only add for those with 2 scans?

My contrast will be [1 0 0 0 0 0] if I wanted to compare group A vs B (A > B).

Would these be correct?

Thank you again! I appreciate your help.

Jay

Threaded View

TitleAuthorDate
jdc77 Jan 30, 2021
Andrew Zalesky Jan 30, 2021
jdc77 Jan 31, 2021
RE: Design matrix for a few repeat scans
Andrew Zalesky Jan 31, 2021
jdc77 Jan 31, 2021