#####################
# GETTING THE DATA: #
#####################

# BrdU+ cells percentage:
BrdU.Control <- c(0.3095740936, 0.3141836174, 0.367597368, 0.3710631495)
BrdU.Aphidicolin <- c(0.1576029004, 0.1680945853, 0.1308075221, 0.1854532296)

BrdU.Percentage <- data.frame(BrdU.Control, BrdU.Aphidicolin)

# Cell density per um^3
CellDensity.Control <- c(8.96E-004, 1.06E-003, 9.63E-004, 7.72E-004)
CellDensity.Aphidicolin <- c(1.02E-003, 8.08E-004, 7.01E-004, 8.19E-004)

CellDensity <- data.frame(CellDensity.Control, CellDensity.Aphidicolin)

# Length of the rudiment (in um)
RudimentLength.Control <- c(1120.5, 940.4, 1147.7, 1843.0)
RudimentLength.Aphidicolin <- c(1112.5, 1048.7, 1386.8, 1669.0)

RudimentLength <- data.frame(RudimentLength.Control, RudimentLength.Aphidicolin)

# Absolute number of cells in the rudiment

CellNumber.Control <- c(4247.0, 1919.0, 3805.0, 6255.0)
CellNumber.Aphidicolin <- c(2849.0, 4031.0, 2899.0, 3573.0)

CellNumber <- data.frame(CellNumber.Control, CellNumber.Aphidicolin)

# DATA ANALYSIS

# I. BrdU percentage:
  # (a) Running a t-test
t.test(BrdU.Percentage$BrdU.Control, BrdU.Percentage$BrdU.Aphidicolin)
# Welch Two Sample t-test
# 
# data:  BrdU.Percentage$BrdU.Control and BrdU.Percentage$BrdU.Aphidicolin
# t = 8.9246, df = 5.3204, p-value = 0.0002127
# alternative hypothesis: true difference in means is not equal to 0
# 95 percent confidence interval:
#   0.1291616 0.2310684
# sample estimates:
#   mean of x mean of y 
# 0.3406046 0.1604896 

  # (b) Drawing a boxplot
boxplot(BrdU.Percentage)

# II. Cell density:
  # (a) Running a t-test:
 t.test(CellDensity$CellDensity.Control, CellDensity.Aphidicolin)
# Welch Two Sample t-test
# 
# data:  CellDensity$CellDensity.Control and CellDensity.Aphidicolin
# t = 0.95352, df = 5.946, p-value = 0.3775
# alternative hypothesis: true difference in means is not equal to 0
# 95 percent confidence interval:
#   -0.0001347863  0.0003062863
# sample estimates:
#   mean of x  mean of y 
# 0.00092275 0.00083700 
 
 # (b) Drawing a boxplot:
 boxplot(CellDensity)
 
 # III. Rudiment length:
  # (a) T-test
 t.test(RudimentLength$RudimentLength.Control, RudimentLength$RudimentLength.Aphidicolin)
 
 # Welch Two Sample t-test
 # 
 # data:  RudimentLength.Control and RudimentLength.Aphidicolin
 # t = -0.16928, df = 5.4293, p-value = 0.8717
 # alternative hypothesis: true difference in means is not equal to 0
 # 95 percent confidence interval:
 #   -654.6174  571.9174
 # sample estimates:
 #   mean of x mean of y 
 # 1262.90   1304.25 
 
  # (b) Drawing a boxplot:
 boxplot(RudimentLength)
 
# IV. Absolute number of cells in the rudiment:
  # (a) Running a t-test:
 t.test(CellNumber$CellNumber.Control, CellNumber$CellNumber.Aphidicolin)
 
 # Welch Two Sample t-test
 # 
 # data:  CellNumber$CellNumber.Control and CellNumber$CellNumber.Aphidicolin
 # t = 0.76924, df = 3.6046, p-value = 0.489
 # alternative hypothesis: true difference in means is not equal to 0
 # 95 percent confidence interval:
 #   -1990.962  3427.962
 # sample estimates:
 #   mean of x mean of y 
 # 4056.5    3338.0 
 
  # (b) Drawing a boxplot:
 boxplot(CellNumber)
 
 
save.image(file="Environment.RData")
