-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PLS code #5
Comments
Hi @docni , Thanks for asking. The two columns in the The code you quote:
Is correlating the predicted scores for the two pls components (We actually do that again more explicitly in the code below)
But back to the point. If the PLS component is negatively correlated with the The reason we do this step is to help interpret the components. The direction is essentially arbitrary but if the components are aligned it helps to see if they have opposing effects (for example). |
Thanks so much Kirstie, this is very helpful! bw Peter From: Kirstie Whitaker notifications@github.com Hi @docnihttps://github.com/docni , Thanks for asking. Actually, the two columns in the PLS_calculate_stats.mhttps://github.com/KirstieJane/NSPN_WhitakerVertes_PNAS2016/blob/master/SCRIPTS/PLS_calculate_stats.m code relate to the two PLS components (in this code we only ask for the first 2 components using dim=2. You could easily change that number to see what how many PLS components made sense for your analysis.) The code you quote: %align PLS components with desired direction% Is correlating the predicted scores for the two pls components XS(:,1) and XS(:,2) and correlating them with the input MRIdata. (It's actually somewhat redundant with the code below) %calculate correlations of PLS components with MRI variables But back to the point. If the PLS component is negatively correlated with the MRIdata then we flip the sign of the component (by multiplying by -1). The reason we do this step is to help interpret the components. The direction is essentially arbitrary but if the components are aligned it helps to see if they have opposing effects (for example). You are receiving this because you were mentioned. |
To do for @KirstieJane:
|
Dear Kirstie,
Can I check regarding the PLS_calculate_stats matlab code.
For the line;
[R1,p1]=corr([XS(:,1),XS(:,2)],MRIdata);
if R1(1,2)<0
XS(:,1)=-1_XS(:,1);
end
if R1(2,4)<0
XS(:,2)=-1_XS(:,2);
end
I am assuming this is running the analysis looking for how MT and dMT explain the variance in gene expression, as there are the 2nd and 4th variable in the csv file.
Thus if I only had two mri variables in my spread sheet I would change to?;
[R1,p1]=corr([XS(:,1),XS(:,2)],MRIdata);
if R1(1,1)<0
XS(:,1)=-1_XS(:,1);
end
if R1(2,2)<0
XS(:,2)=-1_XS(:,2);
end
And if I wanted to look at three response variables, how would I alter it?
Thanks again for all your help.
bw
Peter
The text was updated successfully, but these errors were encountered: