# How to find out the degrees of freedom in an AFNI file?

Suppose we have an output file in brain volume or surface format from a statistical analysis. For simplification, let us call it myFile+tlrc, and assume that sub-brick #3 is *F*-statistic and sub-brick #9 is *t*-statistic. There are three ways to find out the degrees of freedom for a specific statistical sub-brick: (1) 3dinfo, (2) AFNI viewer, and (3) 3dAttribute.

The first method is to use 3dinfo:

3dinfo -verb myFile+tlrc | less

On the screen you can find the header information about sub-brick #3 (*F*-statistic):

-- At sub-brick #3 'GroupXTime F' datum type is short: 0 to 32767 [internal]

[* 0.00198733] 0 to 65.1187 [scaled]

statcode = fift; statpar = 3 57

The two numbers under 'statpar' (statistic parameters), 3 and 57, on the third line are the degrees of freedom for this *F*-statistic.

Further down you should be able to locate the other *t*-statistic sub-brick (#9):

-- At sub-brick #9 'Patients-Control t' datum type is short: -25895.7 to 32767 [internal]

[* 0.000402042] -10.4112 to 13.1737 [scaled]

statcode = fitt; statpar = 9

And the degrees of freedom in this case is 9.

Alternatively if myFile+tlrc is loaded as OverLay (OverLay) on the AFNI viewer (GUI), go through the following buttons: Define Datamode -> and Misc, and then select ULay Info (or OLay Info). You should be able to find the same information on a new window as shown above with 3dinfo.

Lastly you can use 3dAttribute. For example, for the same sub-brick #3 above, run the following command:

3dAttribute BRICK_STATAUX myFile+tlrc'[3]'

and you should get five numbers on the screen:

0 4 2 3 57

The last two are the degrees of freedom for the *F*-statistic.

Do the same for the t-statistic sub-brick:

3dAttribute BRICK_STATAUX myFile+tlrc'[9]'

and you will see:

0 3 1 9

Again the last number is the degrees of freedom for the *t*-statistic.

Last modified 2012-11-15 16:52