In [58]:
%matplotlib inline
import pandas as pd
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
import seaborn as sns

In [73]:
slide5 = pd.read_csv('/Users/alex/Projects/AtheyLab/Visualize/BoxAndWhisker/data/Wiley_Slide5_c0_114.csv')
slide6_1 = pd.read_csv('/Users/alex/Projects/AtheyLab/Visualize/BoxAndWhisker/data/Wiley_Slide6_1_c0_114.csv')
slide6_2 = pd.read_csv('/Users/alex/Projects/AtheyLab/Visualize/BoxAndWhisker/data/Wiley_Slide6_2_c0_114.csv')
slide7 = pd.read_csv('/Users/alex/Projects/AtheyLab/Visualize/BoxAndWhisker/data/Wiley_Slide7_c0_114.csv')
slide8 = pd.read_csv('/Users/alex/Projects/AtheyLab/Visualize/BoxAndWhisker/data/Wiley_Slide8_c0_114.csv')
#names = ['Acute Vehicle', 'Acute Cortisol', 'Chronic Vehicle', 'Chronic Cortisol']
names = ['AV', 'AC', 'CV', 'CC']

In [74]:
slide5 = slide5.drop('Case', axis = 1)
slide5.describe()


Out[74]:
AvgMeanCurvature ComputeArea Volume ShapeIndex Curvedness FractalDimension
count 32.000000 32.000000 32.000000 32.000000 32.000000 32.000000
mean 0.055823 9987.189298 74979.575784 0.385635 0.043157 2.115318
std 0.029795 2695.299225 25768.035855 0.058676 0.037890 0.012441
min 0.041324 630.369140 1063.250100 0.227446 0.023915 2.094642
25% 0.045321 9286.978750 69466.248000 0.356474 0.028078 2.106407
50% 0.049421 10511.920500 80554.935000 0.393551 0.034608 2.113758
75% 0.053262 11646.985000 93725.610500 0.422565 0.041656 2.119882
max 0.212942 14085.702000 104754.850000 0.475025 0.239579 2.145438

In [75]:
print('Slide 6_1: ' + str(slide6_1.shape))
print('Slide 6_2: ' + str(slide6_2.shape))
slide6 = slide6_1.append(slide6_2)
slide6 = slide6.drop('Case', axis = 1)
slide6.describe()


Slide 6_1: (15, 7)
Slide 6_2: (24, 7)
Out[75]:
AvgMeanCurvature ComputeArea Volume ShapeIndex Curvedness FractalDimension
count 39.000000 39.000000 39.000000 39.000000 39.000000 39.000000
mean 0.058999 10193.740546 72140.782813 0.347925 0.047348 2.111893
std 0.037556 2456.019782 19365.970186 0.038426 0.044329 0.012929
min 0.040861 517.545800 674.665700 0.268259 0.023744 2.097419
25% 0.050576 9123.056000 63300.295000 0.329583 0.036654 2.102536
50% 0.053169 9857.319000 71195.820000 0.341648 0.041389 2.108881
75% 0.057022 11142.781500 78241.905000 0.359142 0.044672 2.116646
max 0.285594 16539.904000 109497.055000 0.456598 0.312084 2.151785

In [76]:
slide7 = slide7.drop('Case', axis = 1)
slide7.describe()


Out[76]:
AvgMeanCurvature ComputeArea Volume ShapeIndex Curvedness FractalDimension
count 25.000000 25.000000 25.000000 25.000000 25.000000 25.000000
mean 0.053031 10933.591944 84031.843508 0.373990 0.039430 2.111102
std 0.022461 2752.515093 23028.424040 0.052255 0.025555 0.011143
min 0.042283 1188.189600 2508.961700 0.259692 0.024044 2.096473
25% 0.045355 9442.126000 71373.930000 0.342279 0.028503 2.104786
50% 0.048187 11665.649000 93606.370000 0.364148 0.033516 2.108617
75% 0.051123 12851.096000 101137.100000 0.420529 0.041715 2.113317
max 0.158785 15288.597000 105198.670000 0.440725 0.156224 2.153800

In [77]:
slide8 = slide8.drop('Case', axis = 1)
slide8.describe()


Out[77]:
AvgMeanCurvature ComputeArea Volume ShapeIndex Curvedness FractalDimension
count 23.000000 23.000000 23.000000 23.000000 23.000000 23.000000
mean 0.093407 8537.061579 60150.395639 0.348881 0.065973 2.127057
std 0.073389 5389.841630 44509.671110 0.065560 0.058957 0.043515
min 0.041494 405.261350 564.810060 0.235359 0.023815 2.091249
25% 0.046242 2465.449600 7336.001800 0.303299 0.029124 2.104369
50% 0.047944 11517.772000 88128.960000 0.359760 0.033989 2.111432
75% 0.117100 12384.948500 97053.940000 0.406136 0.077033 2.132704
max 0.249118 16498.934000 109089.760000 0.471845 0.200680 2.299253

In [78]:
volumes = [slide5['Volume'], slide6['Volume'], slide7['Volume'], slide8['Volume']]
sns.boxplot(volumes, color = "pastel", names = names, label = 'Volume');



In [79]:
for vol in volumes:
    vol = vol[~((vol - vol.mean()).abs() > 3 * vol.std())]
    print(vol.shape)
sns.boxplot(volumes, color="pastel", names = names, label = 'Volume');


(32,)
(38,)
(24,)
(23,)

Comparing Chronic conditions: Vehicle vs Cortisol


In [94]:
cols = slide5.columns.values
cutoff = 0.05
for col in cols:
    pVal = stats.mannwhitneyu(slide7[col], slide8[col], use_continuity = True)[1]
    if pVal < cutoff:
        print('p-value for ' + col + ': ' + str(pVal))

Comparing Acute conditions: Vehicle vs Cortisol


In [95]:
for col in cols:
    pVal = stats.mannwhitneyu(slide5[col], slide6[col], use_continuity = True)[1]
    if pVal < cutoff:
        print('p-value for ' + col + ': ' + str(pVal))


p-value for AvgMeanCurvature: 0.0112340420534
p-value for ShapeIndex: 0.000347225473488
p-value for Curvedness: 0.0169788919254
p-value for FractalDimension: 0.0409983669399

Comparing Vehicle conditions: Acute vs Chronic


In [96]:
for col in cols:
    pVal = stats.mannwhitneyu(slide5[col], slide7[col], use_continuity = True)[1]
    if pVal < cutoff:
        print('p-value for ' + col + ': ' + str(pVal))


p-value for Volume: 0.0419241075627

Comparing Cortisol conditions: Acute vs Chronic


In [98]:
for col in cols:
    pVal = stats.mannwhitneyu(slide6[col], slide8[col], use_continuity = True)[1]
    if pVal < cutoff:
        print('p-value for ' + col + ': ' + str(pVal))

In [ ]: