
%  Raynaud's Phenomenon
%  Raynaud's phenomenon  is a condition resulting in a  discoloration of the fingers and/or the toes 
%  after exposure to  temperature changes or emotional events. 
%  Skin discoloration is caused by an abnormal spasm of the blood vessels diminishing blood supply to the local tissues.
%  Kahan et al (1987) investigated the efficacy of the calcium-channel blocker nicardipine in the treatment of
%  Raynaud's phenomenon. This efficacy was assessed in a prospective, double-blind, randomized, crossover trial 
%  in 20 patients. Each patient received nicardipine 20 mg or placebo three times a day for two weeks 
%  and then was crossed over for two weeks. To suppress carry-over effect, there was a one-week
%  washout period between the two treatments.
% The researchers were interested if Nicardipine significantly decreased the 
% frequency and severity of Raynaud's phenomenon as compared with placebo. The data consists
% of a number of attacks in two weeks.
% 
clear all
close all
  disp('Raynaud')
  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'} )
                      
