0todd0000 / spm1d

One-Dimensional Statistical Parametric Mapping in Python
GNU General Public License v3.0
61 stars 21 forks source link

Data "normalization" #239

Closed KevinGiordano closed 1 year ago

KevinGiordano commented 1 year ago

I am seeking your advice on accounting for variables in SPM regression, specifically “mass normalizing.” I am currently working on a paper attempting to predict a dependent variable of shoulder torque during pitching and would like to calculate results after accounting for varying body mass. Standard in the field is to divide torque by kg body mass to get a “normalized torque” measurement, which is not an appropriate way to handle that (Curran 2013; Allison 1995; Hirsch 2022). In regression, without time series data, I would perform this by comparing the models torque ~ kg and torque ~ kg + IV to determine the effects of the independent variable. Is there a way to perform this with SPM?

0todd0000 commented 1 year ago

One way to do this is with a covariance model via the spm1d.stats.glm function, as illustrated in this example. You can include any number of covariates you like, including body mass, then compare the results to the identical model without that covariate.

spm1d does not support direct model comparison but I expect that a qualitative comparison of the models' results would be sufficient. Another limitation is that spm1d only supports t-contrasts (not F-contrasts) so full ANCOVA is not yet possible.

KevinGiordano commented 1 year ago

Very helpful, thank you!