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