0todd0000 / spm1dmatlab

One-Dimensional Statistical Parametric Mapping in Matlab.
GNU General Public License v3.0
27 stars 13 forks source link

Missing parameters to calculate effect size for 0D statistical analysis #63

Closed NicolasFlores14 closed 6 years ago

NicolasFlores14 commented 6 years ago

Hello Todd,

I would like to compute an effect size for my data.

I need some information to compute the omega squared as: ω² = [df effect × (MSeffect − MSerror)] / [SStotal + MSerror]

In my case, I performed anova2rm with both SPM 0D and nSPM 0D procedures depending on the normality test results.

1) For the SPM 0D procedure, into FFi.SPMs{1,1}, FFi.SPMs{1,2} , FFi.SPMs{1,3}, for my factors A, B, AB respectively, I found the SS and MS objects with two values in each one. What do these two values mean?

2) For the nSPM 0D procedure, I did not find the SS and MS objects. How can I obtain these values?

3) According to the equation above for the omega squared, can I obtain the terms 'MSeffect', 'MSerror' and 'SStotal' in the SPM 0D and nSPM 0D procedures, and where please?

Thanks for your help, Best regards.

Nicolas

0todd0000 commented 6 years ago

Hi Nicolas,

I found the SS and MS objects with two values in each one. What do these two values mean?

Effect and error, respectively. For example, the F statistic is MSeffect / MSerror.

For the nSPM 0D procedure, I did not find the SS and MS objects. How can I obtain these values?

They are the same as in the parametric procedure. spm1d uses permutation for non-parametric inferences and does not redefine test statistics. Since the test statistic is not redefined, effect sizes are identical for parametric and non-parametric procedures.

According to the equation above for the omega squared, can I obtain the terms 'MSeffect', 'MSerror' and 'SStotal' in the SPM 0D and nSPM 0D procedures, and where please?

MSeffect and MSerror are the two MS values saved in each SPM{F} object as described above. In spm1d it is currently not possible to obtain SStotal for repeated-measures designs because spm1d does not save all necessary SS terms; it only saves the SS terms necessary for computing F statistics.

For between-subjects designs you can obtain SStotal like this:

spmlist = spm1d.stats.anova2(y, A, B);
spmA = spmlist(1);  %main effect A
spmB = spmlist(2); %main effect B
spmAB = spmlist(3);  %interaction effect AB

ssA = fA.SS(1);   %sum-of-squares, effect A
ssB = fB.SS(1);   %sum-of-squares, effect B
ssAB = fAB.SS(1);   %sum-of-squares, interaction effect AB

r = fA.residuals;   %model residuals (identical in all SPM{F} objects)
sswithin = sum(r.^2);   %sum-of-squares (within)

sstotal  = sswithin + ssA + ssB + ssAB;   %sum-of-squares (total)

Future versions of spm1d will directly support effect size calculations. Apologies that this feature is not yet available.

Todd

NicolasFlores14 commented 6 years ago

Hello Todd,

Thanks for your answer, it is clear. I am looking forward to use the effect size calculations in the future package!

Nicolas