
% Phil Santangelo's experiment
%--------------------------------
% Macaque	
% 1	RPG15
% 2	RSQ14
% 3	RPJ15
% 4	RQL15
% 	
% Treatment status	
% 1	IgG
% 2	a4b7
% 	
%  	
% Body section 	
% 1	Upper
% 2	Lower
% 3	Average GI
% 
% Week
% 2  2 weeks
% 3  3 weeks
% 
% Response
% SUVmean

close all force
data=[...
1	1	1	0.233	2
1	1	2	0.144	2
1	1	3	0.1885	2
2	1	1	0.268	2
2	1	2	0.176	2
2	1	3	0.222	2
3	2	1	0.17	2
3	2	2	0.11	2
3	2	3	0.14	2
4	2	1	0.1656	2
4	2	2	0.0774	2
4	2	3	0.1215	2
1	1	1	0.187	3
1	1	2	0.135	3
1	1	3	0.161	3
2	1	1	0.195	3
2	1	2	0.166	3
2	1	3	0.1805	3
3	2	1	0.15	3
3	2	2	0.1	3
3	2	3	0.125	3
4	2	1	0.12	3
4	2	2	0.06	3
4	2	3	0.09	3
];
macaque=data(:,1);  treatment=data(:,2);
section=data(:,3);  suvmean=data(:,4); week = data(:,5);

[p tab stats]=anovan(suvmean,{treatment, macaque, section, week},...
      'varnames',{'treatment', 'macaque', 'section', 'week'},...
      'nested', [0 0 0 0; 1 0 0 0; 0 1 0 0; 0 0 0 0], 'random',[2])
  
% [p tab stats]=anovan(suvmean,{treatment, macaque, week},...
%       'nested', [0 0 0; 1 0 0; 0 0 0], 'random',[2])

  
  