# Regression analysis

Home Forums General Help Regression analysis

• This topic has 3 replies, 2 voices, and was last updated 4 weeks ago by Allenhew.
Viewing 4 posts - 1 through 4 (of 4 total)
• Author
Posts Yuko
Guest

Dear all,

I would like to perform a regression analysis using brain measures and behavior assessments. So, I’m wondering if the BRAPH can extract each brain measure from individual participants.

Best wishes,
Yuko

Dear Yuko,

Yes, you can extract the brain measures from the individual participants by running a script in Matlab. Only thing that you would need for this script to work is to run Braph in Matlab (so that the relevant functions can be loaded) and save your graph analysis file in .fga format (in this case the file is named trial.fga). Then, you can check the following sample code that extracts the modularity for all patients in a given group:

clear all; close all; clc;
% this code will extract the results for all subjects in a given group at
% all densities specfied as a range. The code currently extracts modularity
% measure.
% the values are extracted in the array meas_extracted
% each row is a subject in the group, while each column represents
% different density

%% specify groups for which measures can be extracted
% the groups can be checked by typing ga.cohort on the command line
group = 1;

%% specify density range
densities = 5:1:15;

%% specify the measure number
% the measure number is found by typing Graph.NAME on the command line
% 34 – modularity
measure_numbers = 34;

%% calculate the number of subjects in this group
sub_num = numel(find(ga.cohort.getGroup(group).getProp(Group.DATA)));

%% initialize the array that holds the measure
meas_extracted = zeros(sub_num,length(densities));

%% extract the measures
for d = 1:1:length(densities)

%% get all measures from the particular group
[ms_gr1,mi_gr1] = ga.getMeasures(measure_numbers,group);
% get only the values of the measure at the given density
value_gr1 = ms_gr1{densities(d)}.getProp(fMRIMeasureBUD.VALUES1);

%% put the measures at the corresponding place in the array
meas_extracted(:,d) = value_gr1;
end

Hope this helps. If you need some other specific analyses, I can try to help with that.

Best,
Mite Jeff
Guest

Hi Mite,
Can you let me know how to modify this script so that I can extract several node-level measures for each subject from a weighted graph? Ultimately, I’m interested in correlating behavioral measures with things like strength, node global efficiency, node local efficiency, etc. for each node in my weighted graph.

Thanks very much,
Jeff

Hi Jeff,

The code would be similar for weighted analysis also, however since in this case you do not consider different densities, the corresponding loop needs to be removed. Considering that you have a graph analysis (.fga) file saved, you can extract the measures from any group by the following lines:

[ms_gr1,mi_gr1] = ga.getMeasures(measure_numbers,group);
a = ms_gr1{1}.getProp(fMRIMeasureWU.VALUES1);

In this case “a” is a matrix that holds the results for the measure specified by measure_numbers and the corresponding group. The rows in “a” represent subjects in the group and each column shows the values for different brain region (they are ordered in the same way atlas is uploaded in the BrainAtlas interface).

Hope this helps you.
Best wishes,
Mite

Viewing 4 posts - 1 through 4 (of 4 total)