clear all
close all force
  disp('Simvastatin')
  set(0, 'DefaultAxesFontSize', 16);
  lw =2.5;  fs = 16;  msize = 10;
% Simvastatin. In a quantitative physiology lab II at Georgia Tech, students were asked to
% find a therapeutic model to test on MC3T3-E1 cell line to enhance osteoblastic growth. The
% students found a drug called Simvastatin, a cholesterol lowering drug to test on these cells.
% Using a control and three different concentrations 10?9M, 10?8M, and 10?7M, cells were
% treated with the drug. These cells were plated on four, 24 well plates with each well plate
% having a different treatment. To test for osteoblastic differentiation an assay, pNPP, was
% used to test for alkaline phosphatase activity. The higher the alkaline phosphatase activity
% the better the cells are differentiating, and become more bone like. This assay was performed
% 6 times total within 11 days. Each time the assay was performed, four wells from each plate
% were used.


AlkPh=[...
       0.062   0.055   0.055   1.028   0.607   0.067 ...
       0.517   0.054   0.059   1.067   0.104   0.093 ...
       0.261   0.056   0.062   1.128   0.163   0.165 ...
       0.154   0.063   0.062   0.855   0.109   0.076 ...
           0.071   0.055   0.067   0.075   0.068   0.347  ...
           0.472   0.060   1.234   0.076   0.143   0.106  ...
           0.903   0.057   1.086   0.090   0.108   0.170  ...
           0.565   0.056   0.188   1.209   0.075   0.097  ...
        0.068   0.059   0.092   0.091   0.098   0.115 ...
        0.474   0.070   0.096   0.218   0.122   0.085 ...
        0.063   0.090   0.123   0.618   0.837   0.076 ...
        0.059   0.064   0.091   0.093   0.142   0.085 ...
           0.066   0.447   0.086   0.248   0.108   0.290  ...
           0.670   0.091   0.076   0.094   0.105   0.090  ...
           0.076   0.079   0.082   0.215   0.093   0.518  ...
           0.080   0.071   0.080   0.401   0.580   0.071];
       
         Time = [ 1 2 3 4 5 6    1 2 3 4 5 6     1 2 3 4 5 6     1 2 3 4 5 6  ...    
                       1 2 3 4 5 6    1 2 3 4 5 6     1 2 3 4 5 6     1 2 3 4 5 6  ...
                       1 2 3 4 5 6    1 2 3 4 5 6     1 2 3 4 5 6    1 2 3 4 5 6  ...
                       1 2 3 4 5 6    1 2 3 4 5 6     1 2 3 4 5 6    1 2 3 4 5 6 ];
                 
            Concentration = [1 1 1 1 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 2 2 2 2 ...
                                      3 3 3 3 3 3  3 3 3 3 3 3   3 3 3 3 3 3   3 3 3 3 3 3 ...
                                      4 4 4 4 4 4  4 4 4 4 4 4   4 4 4 4 4 4   4 4 4 4 4 4];
       figure;    
       varnames ={'Time', 'Concentration'};
       [p,table,stats] = anovan(AlkPh,{Time, Concentration}, ...
             'model','interaction','varnames',varnames)
         %%
       figure(3)
       multcompare(stats,'dimension',1)
       figure(4)
       multcompare(stats,'dimension',2)
   
       %%    
       AlkPhd11=AlkPh(Time==6); Concentration6=Concentration(Time==6);
       [p, table, stats]=anova1(AlkPhd11, Concentration6)
       %%
       AlkPhcD=AlkPh(Concentration==4); Time4=Time(Concentration==4);
       [p, table, stats]=anova1(AlkPhcD, Time4)
