library(readxl)
## Warning: package 'readxl' was built under R version 4.3.1
PCB_FDBs <- read_excel("Average_PCBs for Blanks.xlsx")
head(PCB_FDBs)
## # A tibble: 6 × 26
##   Sanple      `PCB-18 norm_resp` `PCB-28 norm_resp` `PCB-52 norm_resp`
##   <chr>                    <dbl>              <dbl>              <dbl>
## 1 FDBlank_Acc               1.39              0.155               3.14
## 2 FDBlank_Acc               2.11              0.207               3.89
## 3 FDBlank_Acc               1.60              0.140               2.93
## 4 FDBlank_Acc               1.62              0.190               3.50
## 5 FDBlank_Acc               1.45              0.180               3.36
## 6 FDBlank_Rec               1.16              0.117               3.00
## # ℹ 22 more variables: `PCB-74 norm_resp` <dbl>, `PCB-66 norm_resp` <dbl>,
## #   `PCB-101 norm_resp` <dbl>, `PCB-99 norm_resp` <dbl>,
## #   `PCB-87 norm_resp` <dbl>, `PCB-110 norm_resp` <dbl>,
## #   `PCB-151  norm_resp` <dbl>, `PCB-149 norm_resp` <dbl>,
## #   `PCB-118 norm_resp` <dbl>, `PCB-146 norm_resp` <dbl>,
## #   `PCB-153 norm_resp` <dbl>, `PCB-105 norm_resp` <dbl>,
## #   `PCB-138 norm_resp` <dbl>, `PCB-187 norm_resp` <dbl>, …

Create a plot of every analyte in the file

# load ggplot
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.3.1
PCB_FDBs$Sanple <- factor(PCB_FDBs$Sanple)
# Box plot for all the analytes at once 
for (column in 2:25) {
  boxplot((PCB_FDBs[[column]] ~ PCB_FDBs$Sanple), ylab = names(PCB_FDBs[column]),
          xlab = "Sample")
  print(t.test(PCB_FDBs[[column]] ~ PCB_FDBs$Sanple))
}

## 
##  Welch Two Sample t-test
## 
## data:  PCB_FDBs[[column]] by PCB_FDBs$Sanple
## t = 2.5802, df = 7.6104, p-value = 0.03398
## alternative hypothesis: true difference in means between group FDBlank_Acc and group FDBlank_Rec is not equal to 0
## 95 percent confidence interval:
##  0.04093388 0.79251219
## sample estimates:
## mean in group FDBlank_Acc mean in group FDBlank_Rec 
##                  1.631179                  1.214456

## 
##  Welch Two Sample t-test
## 
## data:  PCB_FDBs[[column]] by PCB_FDBs$Sanple
## t = 4.8375, df = 5.0534, p-value = 0.004594
## alternative hypothesis: true difference in means between group FDBlank_Acc and group FDBlank_Rec is not equal to 0
## 95 percent confidence interval:
##  0.02923853 0.09510263
## sample estimates:
## mean in group FDBlank_Acc mean in group FDBlank_Rec 
##                 0.1746150                 0.1124444

## 
##  Welch Two Sample t-test
## 
## data:  PCB_FDBs[[column]] by PCB_FDBs$Sanple
## t = 3.4075, df = 5.6588, p-value = 0.01573
## alternative hypothesis: true difference in means between group FDBlank_Acc and group FDBlank_Rec is not equal to 0
## 95 percent confidence interval:
##  0.1668769 1.0634548
## sample estimates:
## mean in group FDBlank_Acc mean in group FDBlank_Rec 
##                  3.363383                  2.748217

## 
##  Welch Two Sample t-test
## 
## data:  PCB_FDBs[[column]] by PCB_FDBs$Sanple
## t = -1.3213, df = 6.6742, p-value = 0.2299
## alternative hypothesis: true difference in means between group FDBlank_Acc and group FDBlank_Rec is not equal to 0
## 95 percent confidence interval:
##  -0.027099022  0.007794168
## sample estimates:
## mean in group FDBlank_Acc mean in group FDBlank_Rec 
##                 0.1818905                 0.1915429

## 
##  Welch Two Sample t-test
## 
## data:  PCB_FDBs[[column]] by PCB_FDBs$Sanple
## t = -1.6589, df = 7.0553, p-value = 0.1408
## alternative hypothesis: true difference in means between group FDBlank_Acc and group FDBlank_Rec is not equal to 0
## 95 percent confidence interval:
##  -0.042770765  0.007469664
## sample estimates:
## mean in group FDBlank_Acc mean in group FDBlank_Rec 
##                 0.1856801                 0.2033307

## 
##  Welch Two Sample t-test
## 
## data:  PCB_FDBs[[column]] by PCB_FDBs$Sanple
## t = -3.2188, df = 7.3608, p-value = 0.01371
## alternative hypothesis: true difference in means between group FDBlank_Acc and group FDBlank_Rec is not equal to 0
## 95 percent confidence interval:
##  -1.0071827 -0.1589549
## sample estimates:
## mean in group FDBlank_Acc mean in group FDBlank_Rec 
##                  3.524483                  4.107551

## 
##  Welch Two Sample t-test
## 
## data:  PCB_FDBs[[column]] by PCB_FDBs$Sanple
## t = -0.083936, df = 5.8634, p-value = 0.9359
## alternative hypothesis: true difference in means between group FDBlank_Acc and group FDBlank_Rec is not equal to 0
## 95 percent confidence interval:
##  -0.2109153  0.1970015
## sample estimates:
## mean in group FDBlank_Acc mean in group FDBlank_Rec 
##                  1.290686                  1.297643

## 
##  Welch Two Sample t-test
## 
## data:  PCB_FDBs[[column]] by PCB_FDBs$Sanple
## t = -0.14785, df = 4.8191, p-value = 0.8884
## alternative hypothesis: true difference in means between group FDBlank_Acc and group FDBlank_Rec is not equal to 0
## 95 percent confidence interval:
##  -0.1843996  0.1645552
## sample estimates:
## mean in group FDBlank_Acc mean in group FDBlank_Rec 
##                 0.8469805                 0.8569028

## 
##  Welch Two Sample t-test
## 
## data:  PCB_FDBs[[column]] by PCB_FDBs$Sanple
## t = -1.3454, df = 4.1751, p-value = 0.2469
## alternative hypothesis: true difference in means between group FDBlank_Acc and group FDBlank_Rec is not equal to 0
## 95 percent confidence interval:
##  -0.4528112  0.1539218
## sample estimates:
## mean in group FDBlank_Acc mean in group FDBlank_Rec 
##                  1.542496                  1.691941

## 
##  Welch Two Sample t-test
## 
## data:  PCB_FDBs[[column]] by PCB_FDBs$Sanple
## t = -2.0152, df = 7.0223, p-value = 0.0836
## alternative hypothesis: true difference in means between group FDBlank_Acc and group FDBlank_Rec is not equal to 0
## 95 percent confidence interval:
##  -0.035760494  0.002841874
## sample estimates:
## mean in group FDBlank_Acc mean in group FDBlank_Rec 
##                 0.1037322                 0.1201915

## 
##  Welch Two Sample t-test
## 
## data:  PCB_FDBs[[column]] by PCB_FDBs$Sanple
## t = -3.4592, df = 5.7599, p-value = 0.01439
## alternative hypothesis: true difference in means between group FDBlank_Acc and group FDBlank_Rec is not equal to 0
## 95 percent confidence interval:
##  -0.17582538 -0.02927066
## sample estimates:
## mean in group FDBlank_Acc mean in group FDBlank_Rec 
##                 0.3724263                 0.4749743

## 
##  Welch Two Sample t-test
## 
## data:  PCB_FDBs[[column]] by PCB_FDBs$Sanple
## t = -5.9295, df = 7.6816, p-value = 0.0004091
## alternative hypothesis: true difference in means between group FDBlank_Acc and group FDBlank_Rec is not equal to 0
## 95 percent confidence interval:
##  -0.05916849 -0.02586020
## sample estimates:
## mean in group FDBlank_Acc mean in group FDBlank_Rec 
##                 0.1818471                 0.2243614

## 
##  Welch Two Sample t-test
## 
## data:  PCB_FDBs[[column]] by PCB_FDBs$Sanple
## t = -5.9814, df = 5.8295, p-value = 0.001089
## alternative hypothesis: true difference in means between group FDBlank_Acc and group FDBlank_Rec is not equal to 0
## 95 percent confidence interval:
##  -0.010955622 -0.004562204
## sample estimates:
## mean in group FDBlank_Acc mean in group FDBlank_Rec 
##                0.02321549                0.03097440

## 
##  Welch Two Sample t-test
## 
## data:  PCB_FDBs[[column]] by PCB_FDBs$Sanple
## t = -6.2339, df = 7.8664, p-value = 0.000268
## alternative hypothesis: true difference in means between group FDBlank_Acc and group FDBlank_Rec is not equal to 0
## 95 percent confidence interval:
##  -0.04834874 -0.02218150
## sample estimates:
## mean in group FDBlank_Acc mean in group FDBlank_Rec 
##                 0.1204942                 0.1557594

## 
##  Welch Two Sample t-test
## 
## data:  PCB_FDBs[[column]] by PCB_FDBs$Sanple
## t = -4.4858, df = 6.7085, p-value = 0.003163
## alternative hypothesis: true difference in means between group FDBlank_Acc and group FDBlank_Rec is not equal to 0
## 95 percent confidence interval:
##  -0.014402083 -0.004401884
## sample estimates:
## mean in group FDBlank_Acc mean in group FDBlank_Rec 
##                0.04516495                0.05456694

## 
##  Welch Two Sample t-test
## 
## data:  PCB_FDBs[[column]] by PCB_FDBs$Sanple
## t = -2.0689, df = 7.3823, p-value = 0.07528
## alternative hypothesis: true difference in means between group FDBlank_Acc and group FDBlank_Rec is not equal to 0
## 95 percent confidence interval:
##  -0.044872454  0.002759884
## sample estimates:
## mean in group FDBlank_Acc mean in group FDBlank_Rec 
##                0.08905079                0.11010707

## 
##  Welch Two Sample t-test
## 
## data:  PCB_FDBs[[column]] by PCB_FDBs$Sanple
## t = -1.9112, df = 7.5208, p-value = 0.09469
## alternative hypothesis: true difference in means between group FDBlank_Acc and group FDBlank_Rec is not equal to 0
## 95 percent confidence interval:
##  -0.0053452329  0.0005298545
## sample estimates:
## mean in group FDBlank_Acc mean in group FDBlank_Rec 
##               0.009825979               0.012233668

## 
##  Welch Two Sample t-test
## 
## data:  PCB_FDBs[[column]] by PCB_FDBs$Sanple
## t = -0.53205, df = 7.3029, p-value = 0.6105
## alternative hypothesis: true difference in means between group FDBlank_Acc and group FDBlank_Rec is not equal to 0
## 95 percent confidence interval:
##  -0.009986595  0.006292816
## sample estimates:
## mean in group FDBlank_Acc mean in group FDBlank_Rec 
##               0.006758695               0.008605584

## 
##  Welch Two Sample t-test
## 
## data:  PCB_FDBs[[column]] by PCB_FDBs$Sanple
## t = 1.9506, df = 7.9901, p-value = 0.08695
## alternative hypothesis: true difference in means between group FDBlank_Acc and group FDBlank_Rec is not equal to 0
## 95 percent confidence interval:
##  -0.0006313637  0.0075528962
## sample estimates:
## mean in group FDBlank_Acc mean in group FDBlank_Rec 
##               0.006217942               0.002757176

## 
##  Welch Two Sample t-test
## 
## data:  PCB_FDBs[[column]] by PCB_FDBs$Sanple
## t = NaN, df = NaN, p-value = NA
## alternative hypothesis: true difference in means between group FDBlank_Acc and group FDBlank_Rec is not equal to 0
## 95 percent confidence interval:
##  NaN NaN
## sample estimates:
## mean in group FDBlank_Acc mean in group FDBlank_Rec 
##                         0                         0

## 
##  Welch Two Sample t-test
## 
## data:  PCB_FDBs[[column]] by PCB_FDBs$Sanple
## t = -0.94375, df = 7.9277, p-value = 0.3732
## alternative hypothesis: true difference in means between group FDBlank_Acc and group FDBlank_Rec is not equal to 0
## 95 percent confidence interval:
##  -0.0010313667  0.0004330106
## sample estimates:
## mean in group FDBlank_Acc mean in group FDBlank_Rec 
##              0.0006579875              0.0009571655

## 
##  Welch Two Sample t-test
## 
## data:  PCB_FDBs[[column]] by PCB_FDBs$Sanple
## t = NaN, df = NaN, p-value = NA
## alternative hypothesis: true difference in means between group FDBlank_Acc and group FDBlank_Rec is not equal to 0
## 95 percent confidence interval:
##  NaN NaN
## sample estimates:
## mean in group FDBlank_Acc mean in group FDBlank_Rec 
##                         0                         0

## 
##  Welch Two Sample t-test
## 
## data:  PCB_FDBs[[column]] by PCB_FDBs$Sanple
## t = 0.087571, df = 7.7474, p-value = 0.9324
## alternative hypothesis: true difference in means between group FDBlank_Acc and group FDBlank_Rec is not equal to 0
## 95 percent confidence interval:
##  -0.0007432559  0.0008015886
## sample estimates:
## mean in group FDBlank_Acc mean in group FDBlank_Rec 
##              0.0009863319              0.0009571655

## 
##  Welch Two Sample t-test
## 
## data:  PCB_FDBs[[column]] by PCB_FDBs$Sanple
## t = -0.86313, df = 7.9618, p-value = 0.4133
## alternative hypothesis: true difference in means between group FDBlank_Acc and group FDBlank_Rec is not equal to 0
## 95 percent confidence interval:
##  -0.013861905  0.006315793
## sample estimates:
## mean in group FDBlank_Acc mean in group FDBlank_Rec 
##               0.005059054               0.008832109