help > principal component decomposition question
Showing 1-4 of 4 posts
Display:
Results per page:
May 10, 2017  02:05 PM | Jenna Traynor - McMaster University
principal component decomposition question
Hi Alfonso,

I have a question regarding how to do a PCA decomposition on 6 covariates in my analysis. To give you some background, this was my original question:
I am running a within-group bivariate correlation analysis looking at the association between functional connectivity and 6 different behavioural scores, using Conn V.17.My experimental question is: is there an association between FC and each of my behavioural scores?
When I set up the findings to look for any effect among my behavioural variables 1-6, I select my patient group and the six variables and set up the contrast as so: [0 1 0 0 0 0 0; 0 0 1 0 0 0 0; 0 0 0 1 0 0 0; 0 0 0 0 1 0 0; 0 0 0 0 0 1 0; 0 0 0 0 0 0 1]. I then select all of my seeds and enter into results explorer, which shows that there is no significant effect at all.

However, if while in the second level results window, I select the simple main effect of each of my behavioural scores separately i.e. [0 1], and all of my seeds, and then enter into results explorer, I get an abundance of significant values for each behavioural score.
You suggested that entering my 6 covariates as well as all of my ROIs into the analysis simultaneously was resulting in a severely under powered analysis.

You suggested to first do a PCA decomposition of my 6 covariates and then enter only the first few component scores into my second level analysis in order to increase the power of my study. However, I am unsure how to do this on my 6 covariates. I understand that you can do this on ROIs in the setup option (i.e., extract principle decomposition), but how would I do this on my covariates?

Would I extract a principal decomposition from my ROIs first in the set up option? And if so, how many PC's do I want from each ROI? Or would I do this a completely different way and do a group-PCA on all my subjects, and then go back and use only the most significant components in my analysis?
Thank you as always for your help!
Jenna
May 24, 2017  04:05 AM | Alfonso Nieto-Castanon - Boston University
RE: principal component decomposition question
Hi Jenna,

Sorry that I was not too clear, what I was suggesting was to try reducing the dimensionality of your 6 behavioral scores into perhaps just one or two factors, and then using those 1 or 2 factor component scores instead of your original 6 variables in your connectivity/behavior correlations. For example you may do that by:

1) in Setup.CovariatesSecondLevel select your 6 behavior variables and click on 'covariate tools' and 'export covariate data to file' to save these vales into a file (e.g. save it into a .mat format myvariables.mat file). 

2) from Matlab command-line type: (note: the following code assumes that your covariates already contain 0's for all of the non-patient subjects)
  load myvariables.mat data;
  validsubjects = any(data~=0,2);
  x = data(validsubjects,:);
  x = detrend(x, 'constant');
  x = x * diag(1./sqrt(sum(x.^2)));
  [Q,D]=svd(x);
  disp('cumulative percent variance by the first N factors:');
  disp(cumsum(diag(D).^2)/sum(diag(D).^2));
  R=zeros(size(data));
  R(validsubjects,:)=Q(:,1:size(data,2));

3) back in CONN's Setup.CovariatesSecondLevel tab, create a new covariate named 'factors', then in the 'values' field enter "R" (without the quotes), and answer 'Yes' to the question about expanding this covariate into multiple variables. 

4) in CONN's second-level results tab, select your patient group and factors_1 and enter a contrast [0 1] (or select the patient group, factors_1, and factors_2 and enter a contrast [0 1 0; 0 0 1]) to explore the connectivity-behavior correlations using your low-dimensional factors instead of the original behavioral covariates

Hope this helps
Alfonso

EDIT: fixes to code-snippet above

Originally posted by Jenna Traynor:
Hi Alfonso,

I have a question regarding how to do a PCA decomposition on 6 covariates in my analysis. To give you some background, this was my original question:
I am running a within-group bivariate correlation analysis looking at the association between functional connectivity and 6 different behavioural scores, using Conn V.17.My experimental question is: is there an association between FC and each of my behavioural scores?
When I set up the findings to look for any effect among my behavioural variables 1-6, I select my patient group and the six variables and set up the contrast as so: [0 1 0 0 0 0 0; 0 0 1 0 0 0 0; 0 0 0 1 0 0 0; 0 0 0 0 1 0 0; 0 0 0 0 0 1 0; 0 0 0 0 0 0 1]. I then select all of my seeds and enter into results explorer, which shows that there is no significant effect at all.

However, if while in the second level results window, I select the simple main effect of each of my behavioural scores separately i.e. [0 1], and all of my seeds, and then enter into results explorer, I get an abundance of significant values for each behavioural score.
You suggested that entering my 6 covariates as well as all of my ROIs into the analysis simultaneously was resulting in a severely under powered analysis.

You suggested to first do a PCA decomposition of my 6 covariates and then enter only the first few component scores into my second level analysis in order to increase the power of my study. However, I am unsure how to do this on my 6 covariates. I understand that you can do this on ROIs in the setup option (i.e., extract principle decomposition), but how would I do this on my covariates?

Would I extract a principal decomposition from my ROIs first in the set up option? And if so, how many PC's do I want from each ROI? Or would I do this a completely different way and do a group-PCA on all my subjects, and then go back and use only the most significant components in my analysis?
Thank you as always for your help!
Jenna
Jul 12, 2017  09:07 PM | Jenna Traynor - McMaster University
RE: Principal component decomposition questio
Hi Alfonso, 

Thank you so much for your helpful response. I have done as you suggested and all went well with the code, however when I went back into the second level covariates tab in setup and entered R into the values section, I was not presented with a question asking me if I wanted to expand the covariate into multiple variables. When I entered R into the values section, a number of different values came up but the question about expanding was not presented to me.

I then went to the second level results section, but am only able to select my patient group and the "factors" covariate that I created (probably because I didn't expand it into multiple variables). This does produce some very significant results in the results explorer, but I am unsure what these results represent.

Is there a way to expand the covariate? And once I expand it and select for example, factor_1 and factor_2, how do I know what these factors represent, behaviourally? 

I have attached a picture of what happened when I entered R into the values section.

Thank you as always for your help, 

Jenna
Jul 17, 2017  03:07 PM | Jenna Traynor - McMaster University
PCA decompositon on behavioural scores
Hi Alfonso, 

Sorry for a second message - After performing a PCA decomposition on my behavioural scores, I figured out how to expand my factors into multiple covariates. I am unsure how to interpret the results though and was wondering if you could direct me.

In second-level results I select my patient group and "factor_1" and "factor_2" and enter [010;001] into my contrast. After looking at results explorer, I found a significant effect (when looking for any effect among factor 1 and 2) and then used Tools --> Calculator to find out where that effect was coming from. It is coming from factor_2, but I am unsure what this means. I have a few questions:

1) how do I know what these factors represent, behaviourally? (i.e., each of my 6 original behavioural scores represent a specific symptom)
2) how do I know how much percentage of the variance each factor explains? (i.e., so I can justify looking at factor_1 and factor_2)

Thank you!

Jenna