Re: [Freesurfer] FreeSurfer analyses in MatLab

2020-01-24 Thread Graduate Imaging
External Email - Use Caution

On Fri, Jan 24, 2020 at 10:32 AM Greve, Douglas N.,Ph.D. <
dgr...@mgh.harvard.edu> wrote:

>
>
> On 1/22/2020 2:13 PM, Graduate Imaging wrote:
>
> External Email - Use Caution
>
>
> On Tue, Jan 21, 2020 at 10:40 AM Greve, Douglas N.,Ph.D. <
> dgr...@mgh.harvard.edu> wrote:
>
>>
>>
>> On 1/17/2020 10:39 AM, Graduate Imaging wrote:
>>
>> External Email - Use Caution
>>
>>> Hello,
>>>
>>> I recently ran a vertex wise analysis on two different projects the
>>> first had three groups with three co-variates that looked at if group
>>> membership was associated with brain volume. The second project had two
>>> groups with three co-variates looking at psychiatric x BMI interaction
>>> effect on brain volume. I'm interested in running ROI analyses in matlab to
>>> ensure the same matrices were used.
>>>
>>> To run the ROI analyses I'm going to important the design matrix from
>>> the vertex wise analysis and use the fast_glmfit and fast_fratio commands
>>> as shown below:
>>> X = load('Xg.dat');
>>> C = load('C.dat');
>>> y = load('ROI.dat'); text file containing participant ROI values from
>>> the DKT atlas.
>>> [beta rvar] = fast_glmfit(y,X);
>>> [F pvalues] = fast_fratio(beta,X,rvar,C
>>>
>>> My first question is the beta values that are calculated from
>>> fast_glmfit are unstandardized is there anyway way to have it compute
>>> standardized values?
>>>
>>> I think this is how you would compute that
>>> betastddev = sqrt(rvar*diag(inv(X'*X)));
>>> betastandard = beta./betastddev;
>>>
>> When I try running this in Matlab I get the Error using  ***  incorrect
>> dimensions for matrix multiplication message.
>>
>> That means that the number of items in y (ie, number of subjects in
>> ROI.dat) is different than the number of rows in X (number of subjects in
>> the fsgd). What are the sizes of y and X?
>>
> That's what I suspected as well however, X = 102x12 and Y= 102x5. I ran
> [betastddev = sqrt(rvar*diag(inv(X'*X))); betastandard = beta./betastddev]
> after running successfully running [[beta rvar] = fast_glmfit(Y,X); [F
> pvalues] = fast_fratio(beta,X,rvar,C)] so its odd that the the dimensions
> wouldn't be matching.
>
> Also when using fast_glmfit and fast_fratio via Matlab for ROI analyses
> what are the appropriate papers to cite? In the Matlab files in fsfast
> there is reference to Worsley, K.J. and Friston, K.J. Analysis of fMRI
> Time-Series Revisited - Again. Neuroimage 2, 173-181, 1995. Would this be
> the correct citation?
>
> The GLM is so old I would not know what to cite. If you feel you need to
> cite something, that Worsley paper is fine.
>
Thanks. For DODS looking at an interaction term for the previously
mentioned 2 group 4 co-variate analysis it produces the beta weights for
each of the 10 regressors. Am I correct is assuming the way the analysis
works is that it creates interaction terms for the class with each of the
co-variates? If so the analysis could be summarized by Y = B0 + B1*X1 +
B2*X2 + B3*X3 + B4X4 + B5X5 + B6*X1*X2 + B7*X1*X3 + B8*X1*X4 + B9*X1*X5 +
e. Where X1= Class, X2= BMI, X3=ICV, X4= Age and X5=sex (I've since
incorporated this to be apart of class but want to continue with this
example). If that is the case to get an overall interaction term I should
be able to manually create these interaction terms and put them into a
matrix then for the contrast just regress out all of the effects except for
the BMI*class (B6*X1*X2). However, when I do this the p value is not the
same (far more significant) than using the DODS analysis with the 0 0 1 -1
0 0... contrast.




>
>>> My second question is when I ran the ROI analyses looking at the
>>> diagnosis x BMI interaction effect it outputs an array of beta values for
>>> each regressor. In addition to each groups beta value (for BMI) I'm
>>> interested in the beta value of the interaction (ie diagnosis x BMI). I was
>>> wondering how do i go about obtaining this? Would I have to create a new
>>> matrix with the interaction term included in it?
>>>
>>> If so would the analysis essentially be one group with the diagnosis x
>>> BMI interaction term plus the three co-variates?
>>>
>>> If you are using an FSGD file and have used DODS, then you can create an
>>> interaction contrast. Send me your fsgd file if you want further help
>>>
>> Yes I was using DODS approach for this analysis, I've attached my FSGD
>> file to this email.
>>
>>
>> You have 2 groups and 4 coviariates so 10 regressors. The dx BMI
>> interaction would need a contrast matrix
>> 0 0 1 -1 0 0 ... the rest 0s
>> BTW, sex should not be a covariate. You really need to have four groups,
>> P-male, P-female, HC-male, and HC-female (which would change the contrast
>> above)
>> Also, I would normalize the age and ICV
>>
>> Thanks for the correction I'll update my matrix accordingly to four
> groups and normalize the variables! The contrast matrix I ran was actually
> the same you suggested however it pastes an array 

Re: [Freesurfer] FreeSurfer analyses in MatLab

2020-01-24 Thread Greve, Douglas N.,Ph.D.


On 1/22/2020 2:13 PM, Graduate Imaging wrote:

External Email - Use Caution


On Tue, Jan 21, 2020 at 10:40 AM Greve, Douglas N.,Ph.D. 
mailto:dgr...@mgh.harvard.edu>> wrote:


On 1/17/2020 10:39 AM, Graduate Imaging wrote:

External Email - Use Caution

Hello,

I recently ran a vertex wise analysis on two different projects the first had 
three groups with three co-variates that looked at if group membership was 
associated with brain volume. The second project had two groups with three 
co-variates looking at psychiatric x BMI interaction effect on brain volume. 
I'm interested in running ROI analyses in matlab to ensure the same matrices 
were used.

To run the ROI analyses I'm going to important the design matrix from the 
vertex wise analysis and use the fast_glmfit and fast_fratio commands as shown 
below:
X = load('Xg.dat');
C = load('C.dat');
y = load('ROI.dat'); text file containing participant ROI values from the DKT 
atlas.
[beta rvar] = fast_glmfit(y,X);
[F pvalues] = fast_fratio(beta,X,rvar,C

My first question is the beta values that are calculated from fast_glmfit are 
unstandardized is there anyway way to have it compute standardized values?
I think this is how you would compute that
betastddev = sqrt(rvar*diag(inv(X'*X)));
betastandard = beta./betastddev;
When I try running this in Matlab I get the Error using  *  incorrect 
dimensions for matrix multiplication message.
That means that the number of items in y (ie, number of subjects in ROI.dat) is 
different than the number of rows in X (number of subjects in the fsgd). What 
are the sizes of y and X?
That's what I suspected as well however, X = 102x12 and Y= 102x5. I ran 
[betastddev = sqrt(rvar*diag(inv(X'*X))); betastandard = beta./betastddev] 
after running successfully running [[beta rvar] = fast_glmfit(Y,X); [F pvalues] 
= fast_fratio(beta,X,rvar,C)] so its odd that the the dimensions wouldn't be 
matching.

Also when using fast_glmfit and fast_fratio via Matlab for ROI analyses what 
are the appropriate papers to cite? In the Matlab files in fsfast there is 
reference to Worsley, K.J. and Friston, K.J. Analysis of fMRI Time-Series 
Revisited - Again. Neuroimage 2, 173-181, 1995. Would this be the correct 
citation?
The GLM is so old I would not know what to cite. If you feel you need to cite 
something, that Worsley paper is fine.

My second question is when I ran the ROI analyses looking at the diagnosis x 
BMI interaction effect it outputs an array of beta values for each regressor. 
In addition to each groups beta value (for BMI) I'm interested in the beta 
value of the interaction (ie diagnosis x BMI). I was wondering how do i go 
about obtaining this? Would I have to create a new matrix with the interaction 
term included in it?

If so would the analysis essentially be one group with the diagnosis x BMI 
interaction term plus the three co-variates?
If you are using an FSGD file and have used DODS, then you can create an 
interaction contrast. Send me your fsgd file if you want further help
Yes I was using DODS approach for this analysis, I've attached my FSGD file to 
this email.

You have 2 groups and 4 coviariates so 10 regressors. The dx BMI interaction 
would need a contrast matrix
0 0 1 -1 0 0 ... the rest 0s
BTW, sex should not be a covariate. You really need to have four groups, 
P-male, P-female, HC-male, and HC-female (which would change the contrast above)
Also, I would normalize the age and ICV

Thanks for the correction I'll update my matrix accordingly to four groups and 
normalize the variables! The contrast matrix I ran was actually the same you 
suggested however it pastes an array of beta values for each 10 regressors. 
However, I was interested in obtaining a beta value that represents the 
interaction.



___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer



___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer



___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

Re: [Freesurfer] FreeSurfer analyses in MatLab

2020-01-22 Thread Graduate Imaging
External Email - Use Caution

On Tue, Jan 21, 2020 at 10:40 AM Greve, Douglas N.,Ph.D. <
dgr...@mgh.harvard.edu> wrote:

>
>
> On 1/17/2020 10:39 AM, Graduate Imaging wrote:
>
> External Email - Use Caution
>
>> Hello,
>>
>> I recently ran a vertex wise analysis on two different projects the first
>> had three groups with three co-variates that looked at if group membership
>> was associated with brain volume. The second project had two groups with
>> three co-variates looking at psychiatric x BMI interaction effect on brain
>> volume. I'm interested in running ROI analyses in matlab to ensure the same
>> matrices were used.
>>
>> To run the ROI analyses I'm going to important the design matrix from the
>> vertex wise analysis and use the fast_glmfit and fast_fratio commands as
>> shown below:
>> X = load('Xg.dat');
>> C = load('C.dat');
>> y = load('ROI.dat'); text file containing participant ROI values from the
>> DKT atlas.
>> [beta rvar] = fast_glmfit(y,X);
>> [F pvalues] = fast_fratio(beta,X,rvar,C
>>
>> My first question is the beta values that are calculated from fast_glmfit
>> are unstandardized is there anyway way to have it compute standardized
>> values?
>>
>> I think this is how you would compute that
>> betastddev = sqrt(rvar*diag(inv(X'*X)));
>> betastandard = beta./betastddev;
>>
> When I try running this in Matlab I get the Error using  ***  incorrect
> dimensions for matrix multiplication message.
>
> That means that the number of items in y (ie, number of subjects in
> ROI.dat) is different than the number of rows in X (number of subjects in
> the fsgd). What are the sizes of y and X?
>
That's what I suspected as well however, X = 102x12 and Y= 102x5. I ran
[betastddev = sqrt(rvar*diag(inv(X'*X))); betastandard = beta./betastddev]
after running successfully running [[beta rvar] = fast_glmfit(Y,X); [F
pvalues] = fast_fratio(beta,X,rvar,C)] so its odd that the the dimensions
wouldn't be matching.

Also when using fast_glmfit and fast_fratio via Matlab for ROI analyses
what are the appropriate papers to cite? In the Matlab files in fsfast
there is reference to Worsley, K.J. and Friston, K.J. Analysis of fMRI
Time-Series Revisited - Again. Neuroimage 2, 173-181, 1995. Would this be
the correct citation?

>
>> My second question is when I ran the ROI analyses looking at the
>> diagnosis x BMI interaction effect it outputs an array of beta values for
>> each regressor. In addition to each groups beta value (for BMI) I'm
>> interested in the beta value of the interaction (ie diagnosis x BMI). I was
>> wondering how do i go about obtaining this? Would I have to create a new
>> matrix with the interaction term included in it?
>>
>> If so would the analysis essentially be one group with the diagnosis x
>> BMI interaction term plus the three co-variates?
>>
>> If you are using an FSGD file and have used DODS, then you can create an
>> interaction contrast. Send me your fsgd file if you want further help
>>
> Yes I was using DODS approach for this analysis, I've attached my FSGD
> file to this email.
>
>
> You have 2 groups and 4 coviariates so 10 regressors. The dx BMI
> interaction would need a contrast matrix
> 0 0 1 -1 0 0 ... the rest 0s
> BTW, sex should not be a covariate. You really need to have four groups,
> P-male, P-female, HC-male, and HC-female (which would change the contrast
> above)
> Also, I would normalize the age and ICV
>
> Thanks for the correction I'll update my matrix accordingly to four groups
and normalize the variables! The contrast matrix I ran was actually the
same you suggested however it pastes an array of beta values for each 10
regressors. However, I was interested in obtaining a beta value that
represents the interaction.

>
>> ___
>> Freesurfer mailing 
>> listfreesur...@nmr.mgh.harvard.eduhttps://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>>
>>
>> ___
>> Freesurfer mailing list
>> Freesurfer@nmr.mgh.harvard.edu
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>
>
> ___
> Freesurfer mailing 
> listfreesur...@nmr.mgh.harvard.eduhttps://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>
>
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

Re: [Freesurfer] FreeSurfer analyses in MatLab

2020-01-21 Thread Greve, Douglas N.,Ph.D.


On 1/17/2020 10:39 AM, Graduate Imaging wrote:

External Email - Use Caution

Hello,

I recently ran a vertex wise analysis on two different projects the first had 
three groups with three co-variates that looked at if group membership was 
associated with brain volume. The second project had two groups with three 
co-variates looking at psychiatric x BMI interaction effect on brain volume. 
I'm interested in running ROI analyses in matlab to ensure the same matrices 
were used.

To run the ROI analyses I'm going to important the design matrix from the 
vertex wise analysis and use the fast_glmfit and fast_fratio commands as shown 
below:
X = load('Xg.dat');
C = load('C.dat');
y = load('ROI.dat'); text file containing participant ROI values from the DKT 
atlas.
[beta rvar] = fast_glmfit(y,X);
[F pvalues] = fast_fratio(beta,X,rvar,C

My first question is the beta values that are calculated from fast_glmfit are 
unstandardized is there anyway way to have it compute standardized values?
I think this is how you would compute that
betastddev = sqrt(rvar*diag(inv(X'*X)));
betastandard = beta./betastddev;
When I try running this in Matlab I get the Error using  *  incorrect 
dimensions for matrix multiplication message.
That means that the number of items in y (ie, number of subjects in ROI.dat) is 
different than the number of rows in X (number of subjects in the fsgd). What 
are the sizes of y and X?

My second question is when I ran the ROI analyses looking at the diagnosis x 
BMI interaction effect it outputs an array of beta values for each regressor. 
In addition to each groups beta value (for BMI) I'm interested in the beta 
value of the interaction (ie diagnosis x BMI). I was wondering how do i go 
about obtaining this? Would I have to create a new matrix with the interaction 
term included in it?

If so would the analysis essentially be one group with the diagnosis x BMI 
interaction term plus the three co-variates?
If you are using an FSGD file and have used DODS, then you can create an 
interaction contrast. Send me your fsgd file if you want further help
Yes I was using DODS approach for this analysis, I've attached my FSGD file to 
this email.

You have 2 groups and 4 coviariates so 10 regressors. The dx BMI interaction 
would need a contrast matrix
0 0 1 -1 0 0 ... the rest 0s
BTW, sex should not be a covariate. You really need to have four groups, 
P-male, P-female, HC-male, and HC-female (which would change the contrast above)
Also, I would normalize the age and ICV




___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer



___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

Re: [Freesurfer] FreeSurfer analyses in MatLab

2020-01-17 Thread Graduate Imaging
External Email - Use Caution

>
> Hello,
>
> I recently ran a vertex wise analysis on two different projects the first
> had three groups with three co-variates that looked at if group membership
> was associated with brain volume. The second project had two groups with
> three co-variates looking at psychiatric x BMI interaction effect on brain
> volume. I'm interested in running ROI analyses in matlab to ensure the same
> matrices were used.
>
> To run the ROI analyses I'm going to important the design matrix from the
> vertex wise analysis and use the fast_glmfit and fast_fratio commands as
> shown below:
> X = load('Xg.dat');
> C = load('C.dat');
> y = load('ROI.dat'); text file containing participant ROI values from the
> DKT atlas.
> [beta rvar] = fast_glmfit(y,X);
> [F pvalues] = fast_fratio(beta,X,rvar,C
>
> My first question is the beta values that are calculated from fast_glmfit
> are unstandardized is there anyway way to have it compute standardized
> values?
>
> I think this is how you would compute that
> betastddev = sqrt(rvar*diag(inv(X'*X)));
> betastandard = beta./betastddev;
>
When I try running this in Matlab I get the Error using  ***  incorrect
dimensions for matrix multiplication message.

>
> My second question is when I ran the ROI analyses looking at the diagnosis
> x BMI interaction effect it outputs an array of beta values for each
> regressor. In addition to each groups beta value (for BMI) I'm interested
> in the beta value of the interaction (ie diagnosis x BMI). I was wondering
> how do i go about obtaining this? Would I have to create a new matrix with
> the interaction term included in it?
>
> If so would the analysis essentially be one group with the diagnosis x BMI
> interaction term plus the three co-variates?
>
> If you are using an FSGD file and have used DODS, then you can create an
> interaction contrast. Send me your fsgd file if you want further help
>
Yes I was using DODS approach for this analysis, I've attached my FSGD file
to this email.

>
> ___
> Freesurfer mailing 
> listfreesur...@nmr.mgh.harvard.eduhttps://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>
>
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


BMI.FSGD
Description: Binary data
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

Re: [Freesurfer] FreeSurfer analyses in MatLab

2020-01-16 Thread Greve, Douglas N.,Ph.D.


On 1/15/2020 3:08 PM, Graduate Imaging wrote:

External Email - Use Caution

Hello,

I recently ran a vertex wise analysis on two different projects the first had 
three groups with three co-variates that looked at if group membership was 
associated with brain volume. The second project had two groups with three 
co-variates looking at psychiatric x BMI interaction effect on brain volume. 
I'm interested in running ROI analyses in matlab to ensure the same matrices 
were used.

To run the ROI analyses I'm going to important the design matrix from the 
vertex wise analysis and use the fast_glmfit and fast_fratio commands as shown 
below:
X = load('Xg.dat');
C = load('C.dat');
y = load('ROI.dat'); text file containing participant ROI values from the DKT 
atlas.
[beta rvar] = fast_glmfit(y,X);
[F pvalues] = fast_fratio(beta,X,rvar,C

My first question is the beta values that are calculated from fast_glmfit are 
unstandardized is there anyway way to have it compute standardized values?
I think this is how you would compute that
betastddev = sqrt(rvar*diag(inv(X'*X)));
betastandard = beta./betastddev;

My second question is when I ran the ROI analyses looking at the diagnosis x 
BMI interaction effect it outputs an array of beta values for each regressor. 
In addition to each groups beta value (for BMI) I'm interested in the beta 
value of the interaction (ie diagnosis x BMI). I was wondering how do i go 
about obtaining this? Would I have to create a new matrix with the interaction 
term included in it?

If so would the analysis essentially be one group with the diagnosis x BMI 
interaction term plus the three co-variates?
If you are using an FSGD file and have used DODS, then you can create an 
interaction contrast. Send me your fsgd file if you want further help



___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

[Freesurfer] FreeSurfer analyses in MatLab

2020-01-15 Thread Graduate Imaging
External Email - Use Caution

Hello,

I recently ran a vertex wise analysis on two different projects the first
had three groups with three co-variates that looked at if group membership
was associated with brain volume. The second project had two groups with
three co-variates looking at psychiatric x BMI interaction effect on brain
volume. I'm interested in running ROI analyses in matlab to ensure the same
matrices were used.

To run the ROI analyses I'm going to important the design matrix from the
vertex wise analysis and use the fast_glmfit and fast_fratio commands as
shown below:
X = load('Xg.dat');
C = load('C.dat');
y = load('ROI.dat'); text file containing participant ROI values from the
DKT atlas.
[beta rvar] = fast_glmfit(y,X);
[F pvalues] = fast_fratio(beta,X,rvar,C

My first question is the beta values that are calculated from fast_glmfit
are unstandardized is there anyway way to have it compute standardized
values?

My second question is when I ran the ROI analyses looking at the diagnosis
x BMI interaction effect it outputs an array of beta values for each
regressor. In addition to each groups beta value (for BMI) I'm interested
in the beta value of the interaction (ie diagnosis x BMI). I was wondering
how do i go about obtaining this? Would I have to create a new matrix with
the interaction term included in it?

If so would the analysis essentially be one group with the diagnosis x BMI
interaction term plus the three co-variates?
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

Re: [Freesurfer] Freesurfer analyses in MATLAB

2019-11-20 Thread Greve, Douglas N.,Ph.D.
sorry, I don't know what it is you are doing here. what are beta2 and 
X2? what is DV? what are you plotting against what?

On 11/14/19 3:25 PM, cody samth wrote:
>
> External Email - Use Caution
>
> Hi I'm interested in running some analyses in matlab using freesurfer 
> commands. I'm running an interaction effect, however I'm having issues 
> residualizing the brain values to plot.
>
> For running interaction effects I'm running it by inputting:
>
> X=load('Xg.dat')
> Y=load('ROI.dat')
> C=load('C.dat')
> [beta rvar]=fast_glmfit(y,x)
> [F pvalues]=fast_fratio(beta,X.rvar.C)
>
> Which works correctly, then to residualize the values to plot against 
> my DV I was inputting:
>
> X=load('Xg.dat')
> Y=load('ROI.dat')
> beta=inv(X'*X)*(X'*Y)
> beta2=load('beta.txt) ; nuisance beta coefficients removed
> X2=load('X2.dat') ; nuisance columns removed
> yhat=X2*beta2
>
> However the issue I'm having is when plotting the yhat against my 
> variable of interest is that yhat is perfectly predicted by my DV. 
> This is the case for any ROI I test which makes me suspect i have an 
> error in the matrix somewhere. I've attached a graph and can send the 
> .dat files if needed.
> Screen Shot 2019-11-14 at 3.08.37 PM.png
>
> Thanks,
> Cody
>
>
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

[Freesurfer] Freesurfer analyses in MATLAB

2019-11-14 Thread cody samth
External Email - Use Caution

Hi I'm interested in running some analyses in matlab using freesurfer
commands. I'm running an interaction effect, however I'm having issues
residualizing the brain values to plot.

For running interaction effects I'm running it by inputting:

X=load('Xg.dat')
Y=load('ROI.dat')
C=load('C.dat')
[beta rvar]=fast_glmfit(y,x)
[F pvalues]=fast_fratio(beta,X.rvar.C)

Which works correctly, then to residualize the values to plot against my DV
I was inputting:

X=load('Xg.dat')
Y=load('ROI.dat')
beta=inv(X'*X)*(X'*Y)
beta2=load('beta.txt) ; nuisance beta coefficients removed
X2=load('X2.dat') ; nuisance columns removed
yhat=X2*beta2

However the issue I'm having is when plotting the yhat against my variable
of interest is that yhat is perfectly predicted by my DV. This is the case
for any ROI I test which makes me suspect i have an error in the matrix
somewhere. I've attached a graph and can send the .dat files if needed.
[image: Screen Shot 2019-11-14 at 3.08.37 PM.png]

Thanks,
Cody
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer