From data to ANOVA

I did an experiment in which I used electrical stimulations. The stimulation is defined by 2 parameters, pulse and frequency. I used 3 different frequencies (20, 70, 120) and 4 different pulses (100, 200, 300, 400).

Each pulse/frequency combination was given 3 times in randomized order to the subject.

I have 16 subjects involved in the study.

My null hypothesis is that there is not difference among different combinations.

I cannot find a way to implement it by hand (also using a software would be ok), it looks like an ANOVA with repeated measurements.

Do you have any hints?

• Any information on the nature of the dependend variable? Which software is accessible to you? – Bernhard Nov 21 '16 at 14:40
• Hi Bernhard,Unfortunately this is all the information that I've got. As a software, I can use SPSS statistics and Matlab. – Andrea Nov 21 '16 at 15:40

You can use a 3x4 ANOVA, using as factors 'frequencies' [levels: 20, 70, 120], and 'pulse' [levels: 100, 200, 300, 400]. You may want to specify to your software (MatLab is good for this, but also more GUI software like Statistica) that you are using repeated measures; and you may want to specify if you need the interaction between 'pulse' and 'frequencies'.

First, create a variable 'data' which is a vector containing all the data...it should be long 192 datapoints (192 = 16x3x4). Then, create three 192 x 1 cell variables which contains, in each row, the specifier of frequencies (label_f), pulse (label_p), and subject (label_sub).

Use anovan to obtain output tables and variables; be sure to specify the correct model -> [1 0 0; 0 1 0; 0 0 1; 1 1 0] to have also the interaction frequencies X pulse. Specify also " 'random' , 3" to tell MatLab that label_sub is for the repeated measures.

[p,table,stats] = anovan( data , {label_f, label_p, label_sub} , 'model' , [1 0 0; 0 1 0; 0 0 1; 1 1 0] , 'random' , 3 )

Be sure to check the function 'multcompare', then. For example, it should be useful for you to type something like

multcompare(stats,'dimension',[1 2])

Simone

• Hi Simone, this definitely helps. Could you guide me through the Matlab code for doing this? – Andrea Nov 21 '16 at 15:42
• You should use the function anovan. – smndpln Nov 21 '16 at 16:29
• See my answer for detalis. Let me know – smndpln Nov 21 '16 at 16:41
• Interactions? Be carefully at only n=16 probands. – Bernhard Nov 21 '16 at 16:48