Hi Ram, >it is my understanding that each column of the design matrix is demeaned as >well. (based on this thread: >http://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=ind02&L=fsl&D=0&I=-1&P=13070 >). however, i cannot think of a way to calculate the mean of each regressor >without the error terms of each regression. Yes, the design matrix is demeaned (design matrix rules: http://www.fmrib.ox.ac.uk/fsl/feat5/ dm.html). But, since I already demeaned the filtered_func_data, don't need to estimate the mean of each regressor. I'm actually trying to calculate the residuals so that I can verify that my model is correct. When I subtract the model from the raw data, I don't get the same sigma_squareds as FSL gets. So, one possibility is that there is a bug in my code. Another is that I haven't accounted for some factor that FSL applies to the design matrix before writing the values to design.mat. I wanted to make sure it's not the latter before I spend another sleepless night being totally frustrated! >perhaps the fmrib wizards have a potion we can use ? Perhaps a sleeping potion...? jack