
clear all
close all
  disp('Nicardipine')
  set(0, 'DefaultAxesFontSize', 16);
  lw =2.5;  fs = 16;  msize = 10;




Attacks =         [16 26  8 37  9 41 52 10 11 30 ...
                           12  4 37 58  2 18 44 14 30  4 ...
                          12 19 20 44 25 36 36 11 20 27 ...
                          18 12 46 51 28 29 51 46 18 44];
Subject = [1 2 3 4 5 6 7 8 9 10 ...
               11 12 13 14 15 16 17 18 19 20 ...
               1 2 3 4 5 6 7 8 9 10 ...
               11 12 13 14 15 16 17 18 19 20];              
Drug =  [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
                2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2];
% Drug = 1 for Nicardipine
% Drug = 2 for Placebo
Period = [1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 ...
                  2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1];
%
[p, anovatable, stats] = anovan(Attacks,  {Subject,Drug, Period},...
                      'model', 'linear', 'varnames',{'Subject','Drug','Period'} )

                  
                  
                  