How can I perform a semipartial correlation with two covariates?

21 visualizaciones (últimos 30 días)
Hello, I have fMRI functional connectivity data on which I want to test the correlation between two variables (task1 and task2 connectivity values across subjects) while controlling for the amount of 'cleaning' that was performed on the data (I have a different percentage of cleaning for task1 than for task2). I therefore thought that the correct way to control for this would be to do a semipartial correlation where I hold task1 cleaning (covariate 1) constant on the task1 connectivity values only and then task2 cleaning (covariate 2) constant on the task2 connectivity values. Can I ask how to go about performing this in matlab? Essentially it would be a semipartial correlation with two covariates but differentially holding them constant for each variable. Thank you.

Respuesta aceptada

Jeff Miller
Jeff Miller el 26 de Mzo. de 2019
Not sure if this is what you want, but maybe:
[b1,bint1,resid1] = regress(task1,covar1);
[b2,bint2,resid2] = regress(task2,covar2);
finalans = corr(resid1,resid2);
The idea is that resid1 and resid2 are the parts of task1 and task2 scores left over after you control for the covariates, and you want to see (as I understand it) whether these left-over parts are correlated.

Más respuestas (0)

Categorías

Más información sobre Statistics and Machine Learning Toolbox en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by