Differences between revisions 1 and 13 (spanning 12 versions)
Revision 1 as of 2008-12-02 16:15:48
Size: 2532
Editor: crash
Comment:
Revision 13 as of 2026-06-11 16:59:50
Size: 2276
Editor: DougGreve
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Two Groups (One Factor/Two Levels), One Covariates [[FsgdExamples|Back to FSGD Examples]]
Line 3: Line 3:
This models the input as two lines. If DODS, then each line has its
own intercept and slope. If DOSS, then each line has its
own intercept but they share a slope.
~+'''One Group, One Covariate'''+~
Line 7: Line 5:
FSGD File: example3.fsgd This models the input as a single line (ie, an intercept and a slope).
factor (eg, Age). Because there is only one group, this will be the
same for both DODS and DOSS.

<<TableOfContents>>

= FSGD File (g1v1.fsgd) =
Line 11: Line 15:
Class Group1
Class Group2
Variable Age
Input subject1 Group1 30
Input subject2 Group2 40
Class Main
Contrast intercept 1 0
Contra
st slope 0 1
Variables Age
Input subject1 Main 30
Input subject2 Main 40
Line 18: Line 23:
Nclasses = 2
Nvariables = 1
Nclasses = 1 <<BR>>
Nvariables = 1 <<BR>>
Line 21: Line 26:
DODS =================================================
Regressors:
Nregressors = Nclasses*(Nvariables+1) = 2*(1+1) = 4
Regressor1: ones for subjects in Group 1, 0 otherwise. Codes intercept/mean for Group 1
Regressor2: ones for subjects in Group 2, 0 otherwise. Codes intercept/mean for Group 2
Regressor3: age for subjects in Group 1, 0 otherwise. Codes age slope for Group 1
Regressor4: age for subjects in Group 2, 0 otherwise. Codes age slope for Group 2
= Regressors =
Line 29: Line 28:
Contrasts: NregressorsDODS = Nclasses*(Nvariables+1) = 1*(1+1) = 2 <<BR>>
NregressorsDOSS = Nclassesd + Nvariables = 1+1 = 2 <<BR>>
Regressor1: All ones. Codes intercept/mean for Main <<BR>>
Regressor2: age for each subject. Codes age slope for Group 1 <<BR>>
Line 31: Line 33:
Contrast1: ------------
Null Hypothesis: is there a difference between the group intercepts?
= Contrasts =
Line 34: Line 35:
Contrast File: g1-g2.intercept.mtx
--------------- cut here --------------
1 -1 0 0
--------------- cut here --------------
The number of columns in each contrast matrix must be the same as the
number of regressors (Nregressors). If there is only one row in the
contrast matrix, then the result will be a t-test and will have a
sign. Reversing the signs in the contrast matrix will only change the
sign of the output, not its magnitude. If there is more than one row,
the result will be an F-test and will be unsigned.
Line 39: Line 42:
Since this is a t-test, the output will be signed, with Group1>Group2
being positive (red/yellow). Reversing the sign will only change the
sign of the output, not its magnitude.
= mri_glmfit command =
Line 43: Line 44:
Contrast2: ------------ This is an example invocation of mri_glmfit. Depending upon your
application, you may have other options as well.
Line 45: Line 47:
Null Hypothesis: is there a difference between the group slopes? Note:
this is an interaction between group and age. Note: not possible to
test with DOSS
{{{
mri_glmfit \
  --glmdir g1v1 \
  --y y.mgh \
  --fsgd g1v1.fsgd \
}}}
Line 49: Line 54:
Contrast File: g1-g2.slope.mtx
--------------- cut here --------------
0 0 1 -1
--------------- cut here --------------
Above, contrasts were embedded in the FSGD, which is convenient. You can also create contrast files as below.
Note if contrasts are specified in the FSGD file, then you cannot pass them on the command line. It is either
one or the other
Line 54: Line 58:
Since this is a t-test, the output will be signed, with Group1>Group2
being positive (red/yellow). Reversing the sign will only change the
sign of the output, not its magnitude.
== Contrast 1 (intercept.mtx) ==
Null Hypothesis: is the intercept equal to 0?
Line 58: Line 61:
Contrast3: ------------
Null Hypothesis: does Group1 differ from Group2 in intercept or slope?
{{{
1 0
}}}
Line 61: Line 65:
Contrast File: g1-vs-g2.mtx
--------------- cut here --------------
1 -1 0 0
0 0 1 -1
--------------- cut here --------------
Note: this is an F-test (and hence unsigned).
This is a t-test with the intercept>0 being positive (red/yellow).
Line 68: Line 67:
Contrast4: ------------
Null Hypothesis: does mean of group intercepts differ from 0?
== Contrast 2 (slope.mtx) ==
Line 71: Line 69:
Contrast File: g1g2.intercept.mtx
--------------- cut here --------------
0.5 0.5 0 0
--------------- cut here --------------
Null Hypothesis: is the slope equal to 0?
Line 76: Line 71:
Contrast5: ------------
Null Hypothesis: does mean of group slopes differ from 0?
{{{
0 1
}}}
Line 79: Line 75:
Contrast File: g1g2.intercept.mtx
--------------- cut here --------------
0 0 0.5 0.5
--------------- cut here --------------
This is a t-test with the slope>0 being positive (red/yellow).

= mri_glmfit command =

This is an example invocation of mri_glmfit. Depending upon your
application, you may have other options as well.

{{{
mri_glmfit \
  --glmdir g1v1 \
  --y y.mgh \
  --fsgd g1v1.fsgd \
  --C intercept.mtx \
  --C slope.mtx
}}}

Back to FSGD Examples

One Group, One Covariate

This models the input as a single line (ie, an intercept and a slope). factor (eg, Age). Because there is only one group, this will be the same for both DODS and DOSS.

FSGD File (g1v1.fsgd)

GroupDescriptorFile 1
Title OSGM
Class Main
Contrast intercept 1 0
Contrast slope     0 1
Variables Age
Input subject1 Main 30
Input subject2 Main 40

Nclasses = 1
Nvariables = 1

Regressors

NregressorsDODS = Nclasses*(Nvariables+1) = 1*(1+1) = 2
NregressorsDOSS = Nclassesd + Nvariables = 1+1 = 2
Regressor1: All ones. Codes intercept/mean for Main
Regressor2: age for each subject. Codes age slope for Group 1

Contrasts

The number of columns in each contrast matrix must be the same as the number of regressors (Nregressors). If there is only one row in the contrast matrix, then the result will be a t-test and will have a sign. Reversing the signs in the contrast matrix will only change the sign of the output, not its magnitude. If there is more than one row, the result will be an F-test and will be unsigned.

mri_glmfit command

This is an example invocation of mri_glmfit. Depending upon your application, you may have other options as well.

mri_glmfit \
  --glmdir g1v1 \
  --y y.mgh \
  --fsgd g1v1.fsgd \

Above, contrasts were embedded in the FSGD, which is convenient. You can also create contrast files as below. Note if contrasts are specified in the FSGD file, then you cannot pass them on the command line. It is either one or the other

Contrast 1 (intercept.mtx)

Null Hypothesis: is the intercept equal to 0?

1 0

This is a t-test with the intercept>0 being positive (red/yellow).

Contrast 2 (slope.mtx)

Null Hypothesis: is the slope equal to 0?

0 1

This is a t-test with the slope>0 being positive (red/yellow).

mri_glmfit command

This is an example invocation of mri_glmfit. Depending upon your application, you may have other options as well.

mri_glmfit \
  --glmdir g1v1 \
  --y y.mgh \
  --fsgd g1v1.fsgd \
  --C intercept.mtx \
  --C slope.mtx

Fsgdf1G1V (last edited 2026-06-11 16:59:50 by DougGreve)