Fitting models to data with different dependencies

1 visualización (últimos 30 días)
Jose Anton
Jose Anton el 3 de Mzo. de 2023
Respondida: Jasvin el 8 de Mzo. de 2023
Hello,
I am trying to fit a model to data with different dependencies.
I have measured two variables, cerebral blood perfusion with MR - Arterial spin labelling (CBS) and by other imaging means in the brain (positron emission tomography - PET). I have done it in 13 areas of the brain (i-regions) and 22 participants (j-participant). The PET measument depend on the subject and region. For each individual case ASL is proportional to the PET data. I have checked that.
I would like to model my CBF with PET to extract the proporcionaly factor dependent in the ROI and independent in the subject. A model like:
(CBF)ij = (a)j + (b)i (c)j (PET )ij
Where i-dependency to region, and j-dependency to participant.
Thanks a lot
An extract of the table I am using looks like:
286×4 table
subject region PET ASL
________ ________ _________ ________________
{'s003'} {'wm' } 9150.3 38.495
{'s003'} {'cgm' } 12150 51.26
{'s003'} {'fc' } 12056 50.56
{'s003'} {'tc' } 11351 46.886
{'s003'} {'oc' } 12754 54.487
{'s003'} {'pcc' } 12998 59.22
{'s003'} {'pacc'} 12175 52.394
{'s003'} {'cc' } 11887 44.147
{'s003'} {'hip' } 8956 41.143
{'s003'} {'th' } 11843 42.523
{'s003'} {'cau' } 9047.3 35.136
{'s003'} {'pal' } 9783.4 32.474
{'s003'} {'put' } 13895 49.26
{'s005'} {'wm' } 4908.7 30.351
{'s005'} {'cgm' } 6675 39.178
{'s005'} {'fc' } 6765.8 40.397
{'s005'} {'tc' } 6114.7 35.907
{'s005'} {'oc' } 7150.4 41.636
{'s005'} {'pcc' } 7272.9 42.079
{'s005'} {'pacc'} 6623.1 39.134
{'s005'} {'cc' } 6964.3 31.872
{'s005'} {'hip' } 5102.2 31.707
{'s005'} {'th' } 6733.7 34.544
{'s005'} {'cau' } 5733.8 29.099
{'s005'} {'pal' } 4809 25.203
{'s005'} {'put' } 8059.7 34.282
{'s006'} {'wm' } 5067.6 15.239
...

Respuestas (1)

Jasvin
Jasvin el 8 de Mzo. de 2023
Assuming that you also have the CBF observations for creating the model accurately, the problem essentially boils down to fitting a linear regression model with PET as the input and output as the CBF, the constant factor would be the intercept of the fitted model and the dependent factor would be the parameter of the fitted model.
You can use the fitlm() method (https://www.mathworks.com/help/stats/fitlm.html) for doing the fitting. I'm not sure how the regions factor into this but you can specify that as a Categorical variable.
Something similar to this,
mdl = fitlm(InputData, CBF, 'CategoricalVar',2,'Exclude', [1 4])
  • InputData = Table that you have shared above
  • CBF = CBF Observations for each row
  • 'CategoricalVar', 2 = Treat the 2nd column, i.e. region as a Categorical variable
  • 'Exclude', [1 4] = Exclude the 1st and 4th columns, i.e. subject and ASLs from the fitting process.
Use this page to understand which properties can be accessed from the fitted model object, https://www.mathworks.com/help/stats/linearmodel.html
You can find the independent and dependent factors from the property, mdl.Coefficients where mdl is the fitted model object.

Categorías

Más información sobre Linear and Nonlinear Regression en Help Center y File Exchange.

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by