tested hypotheses

Test to see whether field observations of stemflow concentrations are greater that forest throughfall concentrations (or vice-versa). Samples are paired across 3 locations and 18 different sampling dates. Therefore 54 observations for each of 32 chemicals. However, many samples are non-detected.

Non-parametric Wilcoxon Rank Sum test implemented. Permutation tests also possible. Test requiring distribution assumptions (e.g., t-test) not practical due to non-detects and data skewness.

This page is published at: http://rpubs.com/puruckertom/glinski_stemflow2

figures needed

possible additional things to do

general configuration

Install and load supporting libraries.

##          nodename 
## "DZ2626UTPURUCKE"
## [1] "R version 3.3.2 (2016-10-31)"
## Warning: package 'ggplot2' was built under R version 3.3.3
## [1] "list of loaded packages: "
##  [1] "ggplot2"   "knitr"     "dplyr"     "rmarkdown" "stats"    
##  [6] "graphics"  "grDevices" "utils"     "datasets"  "methods"  
## [11] "base"

import experimental exposure and dehydration data

Load csv file with experimental dehydration data. The below may return false but still be OK if rstudio does not have privileges to data directory (e.g., attached drive).

## [1] "Root directory location: k:/git/glinski_stemflow/"
## [1] "check to see if R can access files OK: FALSE"

tifton data structure

Check out structure of imported data sets. sf v tf (32 chemicals, 3 paired sites, 52 storm events), pondwater (10 samples * 12 months)

summary(tifton)
##  Type           Site                Date                Compound   
##  SF:1728   Min.   : 1.000   1/17/2016 : 512   2-Phenylphenol: 228  
##  TF:1728   1st Qu.: 3.000   10/8/2015 : 512   Acetochlor    : 228  
##  TP:3840   Median : 4.000   11/8/2015 : 512   Alachlor      : 228  
##            Mean   : 5.105   12/17/2015: 512   Anthraquione  : 228  
##            3rd Qu.: 7.000   5/22/2015 : 512   Atrazine      : 228  
##            Max.   :10.000   6/23/2015 : 512   Benfluralin   : 228  
##                             (Other)   :4224   (Other)       :5928  
##       Conc            Volume      
##  Min.   : 0.010   Min.   : 0.132  
##  1st Qu.: 0.170   1st Qu.: 2.000  
##  Median : 0.260   Median : 5.000  
##  Mean   : 0.454   Mean   : 9.266  
##  3rd Qu.: 0.400   3rd Qu.:16.000  
##  Max.   :10.500   Max.   :25.000  
##  NA's   :6502     NA's   :4416
colnames(tifton)
## [1] "Type"     "Site"     "Date"     "Compound" "Conc"     "Volume"
chems <- unique(tifton$Compound)
chems
##  [1] Metolachlor                  Tebuconazole                
##  [3] 2-Phenylphenol               Flutolanil                  
##  [5] Biphenyl                     Atrazine                    
##  [7] Metalaxyl                    Acetochlor                  
##  [9] Alachlor                     Anthraquione                
## [11] Endosulfan Lactone           DEA                         
## [13] Endosulfan ether             Cyprodinil                  
## [15] Triadimefon                  Chlorothalonil              
## [17] Diphenylamine                Fipronil                    
## [19] Myclobutanil                 Oxyfluorfen                 
## [21] Bifenthrin                   Fludioxonil                 
## [23] Endosulfan sulfate           Ethalfluralin               
## [25] Pendimethalin                Benfluralin                 
## [27] Diazinon                     Malathion                   
## [29] Oxadiazon                    Piperonyl butoxide          
## [31] Propyzamide                  THPI (Tetrahydrophthalimide)
## 32 Levels: 2-Phenylphenol Acetochlor Alachlor Anthraquione ... Triadimefon
media <- unique(tifton$Type)
media
## [1] TP SF TF
## Levels: SF TF TP
#coerce concentrations to numeric because NAs
tifton$Conc <- as.numeric(tifton$Conc)
min(tifton$Conc,na.rm=TRUE)
## [1] 0.01
max(tifton$Conc,na.rm=TRUE)
## [1] 10.5
colnames(rainwater)
## [1] "event"         "amount_inches"
colnames(rainwater)[1] <- 'Date'

summary(rainwater)
##          Date    amount_inches  
##  1/17/2016 : 1   Min.   :0.150  
##  10/8/2015 : 1   1st Qu.:1.123  
##  11/8/2015 : 1   Median :1.927  
##  12/17/2015: 1   Mean   :2.137  
##  3/18/2015 : 1   3rd Qu.:2.556  
##  4/16/2015 : 1   Max.   :6.760  
##  (Other)   :12
#chem_merge <- merge(chem_merge, rainwater, by="Date")

wilcox stat testing

Run Wilcoxon rank sum test on throughfall versus stemflow for each individual chemical that has detected values. There are three different commands in R that calculate the Wilcoxon signed-rank test; wilcox.test, wilcox.exact, and wilcoxsign_test. They will each yield a different p-value.

The nonparametric Wilcoxon signed-rank test seems to be the most appropriate test for these data. There are two different methods to calculate the signed-rank test. The first is by Wilcoxon (1945), who discards any tied data and then calculates the signed ranks. The second method incorporates tied values in the ranking procedure (see J.W. Pratt, 1959, Remarks on zeros and ties in the Wilcoxon signed rank procedure: Journal of the American Statistical Association, Vol. 54, No. 287, pp. 655-667). There are two commands in R that calculate the original method by Wilcoxon, wilcox.test and wilcoxsign_test (make sure to include the argument “zero.method = c(”Wilcoxon“)”). There are two other commands in R that incorporate ties in the signed-rank test, wilcox.exact and wilcoxsign_test (make sure to include the argument“zero.method = c(”Pratt“)”).

  1. wilcox.test() in the stats package This function automatically switches to using a Normal approximation when there are ties in the data:

wilcox.test(x, y, paired=TRUE)$p.value

(You can suppress the warning (due to ties) by specifying the argument ‘exact=FALSE’.)

This function also uses a continuity correction unless told not to:

wilcox.test(x, y, paired=TRUE, correct=FALSE)$p.value

  1. wilcox.exact() in pkg exactRankTests This function can handle ties (using the “Wilcoxon” method) with an ‘exact’ calculation:

wilcox.exact(x, y, paired=TRUE)$p.value

If we want the Normal approximation:

wilcox.exact(x, y, paired=TRUE, exact=FALSE)$p.value

  1. wilcoxsign_test() in pkg coin This is the most comprehensive of these functions. It is also the only one that offers the “Pratt” method of handling ties. It will default to this method and a Normal approximation:

pvalue(wilcoxsign_test(x ~ y))

pvalue(wilcoxsign_test(x ~ y, zero.method=“Pratt”, distribution=“asympt”))

You can get the results from wilcox.exact() with

pvalue(wilcoxsign_test(x ~ y, zero.method=“Wilcoxon”, distribution=“asympt”))

and

pvalue(wilcoxsign_test(x ~ y, zero.method=“Wilcoxon”, dist=“exact”))

For the moment we are using wilcox.test with ties (paired = TRUE, alternative = ‘greater’, exact = FALSE) but the test is not being run unless there are at least 4 detected values for a chemical.

chemical level analyses

chems_we_care_about <- c('Metolachlor', 'Tebuconazole', '2-Phenylphenol', 'Atrazine', 'Biphenyl', 'DEA', 'Flutolanil')
for(chem in chems_we_care_about){
  print('=======================================================')
  print(chem)
  chem_data <- tifton[which(tifton$Compound==chem),]
  chem_sf <- chem_data[which(chem_data$Type=='SF'),]
  chem_tf <- chem_data[which(chem_data$Type=='TF'),]
  chem_tp <- chem_data[which(chem_data$Type=='TP'),]
  #merge on site, date, compound
  chem_merge <- merge(chem_sf,chem_tf,by=c("Compound","Site","Date"))
  chem_merge <- merge(chem_merge, rainwater, by="Date")
  #1 plot by rainfall (metolachlor and tebuconazole)
  plot(chem_merge$amount_inches, chem_merge$Conc.x, main=paste(chem,'stemflow'))
  #1 plot by date (all together, with 3 different symbols/colors for site and filled/not filled for sf v tf)
  plot(chem_merge$Date, chem_merge$Conc.y, title=paste(chem,'throughfall'))
  plot(chem_merge$Date, chem_merge$Conc.x, main='stemflow')
  #1 stacked barplots by month for all sites for tifton ponds
  
  #conc.x is sf; conc.y is tf
  #we want to test if stemflow is greater than throughfall (x > y)
  x_nas <- sum(is.na(chem_merge$Conc.x))
  y_nas <- sum(is.na(chem_merge$Conc.y))
  x_n <- length(is.na(chem_merge$Conc.x))
  y_n <- length(is.na(chem_merge$Conc.y))
  x_dets <- x_n - x_nas
  y_dets <- y_n - y_nas
  if(x_dets>0){
    if(x_nas==0){
      x_min <- min(chem_merge$Conc.x,na.rm=TRUE)
    }else{
      x_min=0
    }
    x_max <- max(chem_merge$Conc.x,na.rm=TRUE)
  }else{
    x_min <- 0
    x_max <- 0
  }
  if(y_dets>0){
    if(y_nas==0){
      y_min <- min(chem_merge$Conc.y,na.rm=TRUE)
    }else{
      y_min=0
    }
    y_max <- max(chem_merge$Conc.y,na.rm=TRUE)
  }else{
    y_min <- 0
    y_max <- 0
  }
  ### statistical analysis where all 3 locations are grouped
  #colnames(chem_merge)
  print(paste(chem,'stemflow detection frequency = ',x_dets,'/',x_n))
  print(paste(chem,'stemflow concentration range =(',x_min,',',x_max,')'))
  print(paste(chem,'throughfall detection frequency = ',y_dets,'/',y_n))
  print(paste(chem,'throughfall concentration range =(',y_min,',',y_max,')'))
  
  #change NAs to zeroes for conparisons and the Wilcox test
  chem_merge$Conc.x[is.na(chem_merge$Conc.x)] <- 0
  chem_merge$Conc.y[is.na(chem_merge$Conc.y)] <- 0
  n_comparisons <- length(chem_merge$Conc.x)
  n_tf_greater <- sum(chem_merge$Conc.y > chem_merge$Conc.x)
  n_ties <- sum(chem_merge$Conc.y == chem_merge$Conc.x)
  n_sf_greater <- sum(chem_merge$Conc.x > chem_merge$Conc.y)
  comparisons <- paste('(throughfall_greater, ties, stemflow_greater) = ('
              ,n_tf_greater,',',n_ties,',',n_sf_greater,')')
  print(comparisons)
  
  #do the test for all sites
  if((x_dets+y_dets)>4){
    print(knitr::kable(chem_merge))
    chem_wilcox <- wilcox.test(chem_merge$Conc.x, chem_merge$Conc.y, 
                               alternative = 'greater', paired = TRUE, exact = FALSE)
    max_conc <- max(x_max,y_max)
    max_conc_vector <- seq(0,max_conc,20)
    print(chem_wilcox)
    plot(chem_merge$Conc.x, chem_merge$Conc.y,xlim=c(0,max_conc),ylim=c(0,max_conc),
         xlab='Stemflow Concentration',ylab='Throughfall Concentration',
         main=paste(chem,'(WRS p-value = ',round(chem_wilcox$p.value,4),')'),
         sub = comparisons)
    abline(0,1,col='red')
  }else{
    print(paste(chem,'does not have enough detected values for wilcox test'))
  }
  ### statistical analysis for each location, not grouped
  #do the test for each sites
}
## [1] "======================================================="
## [1] "Metolachlor"

## [1] "Metolachlor stemflow detection frequency =  45 / 54"
## [1] "Metolachlor stemflow concentration range =( 0 , 2.63 )"
## [1] "Metolachlor throughfall detection frequency =  41 / 54"
## [1] "Metolachlor throughfall concentration range =( 0 , 2.98 )"
## [1] "(throughfall_greater, ties, stemflow_greater) = ( 19 , 5 , 30 )"
## 
## 
## Date         Compound       Site  Type.x       Conc.x   Volume.x  Type.y       Conc.y   Volume.y   amount_inches
## -----------  ------------  -----  -------  ----------  ---------  -------  ----------  ---------  --------------
## 1/17/2016    Metolachlor       3  SF        0.2700000     25.000  TF        0.0000000     10.000           3.900
## 1/17/2016    Metolachlor       4  SF        0.1600000     25.000  TF        0.0000000     10.000           3.900
## 1/17/2016    Metolachlor       7  SF        0.2600000     25.000  TF        0.0000000      7.000           3.900
## 10/8/2015    Metolachlor       7  SF        0.4100000     17.000  TF        0.0000000      5.000           2.220
## 10/8/2015    Metolachlor       3  SF        0.2500000     20.000  TF        0.0800000      3.750           2.220
## 10/8/2015    Metolachlor       4  SF        0.3700000     25.000  TF        0.0000000      4.000           2.220
## 11/8/2015    Metolachlor       7  SF        0.4100000      5.000  TF        0.1200000      1.000           1.040
## 11/8/2015    Metolachlor       4  SF        0.2400000     15.000  TF        0.0000000      2.000           1.040
## 11/8/2015    Metolachlor       3  SF        0.0000000         NA  TF        0.0000000      2.000           1.040
## 12/17/2015   Metolachlor       4  SF        0.3500000     25.000  TF        0.0000000     12.000           6.760
## 12/17/2015   Metolachlor       7  SF        0.3300000     25.000  TF        0.0000000      9.000           6.760
## 12/17/2015   Metolachlor       3  SF        0.0000000     25.000  TF        0.0000000     12.000           6.760
## 3/18/2015    Metolachlor       3  SF        0.2272727      0.132  TF        0.7559055      0.635           0.150
## 3/18/2015    Metolachlor       4  SF        0.4100000      1.000  TF        0.9090909      0.440           0.150
## 3/18/2015    Metolachlor       7  SF        0.0000000      0.230  TF        0.1600000      0.550           0.150
## 4/16/2015    Metolachlor       7  SF        0.4500000     12.500  TF        0.3400000      2.000           2.485
## 4/16/2015    Metolachlor       3  SF        0.0000000      0.670  TF        0.0000000      3.000           2.485
## 4/16/2015    Metolachlor       4  SF        0.3600000     13.000  TF        0.7100000      2.000           2.485
## 5/1/2015     Metolachlor       7  SF        1.1600000     20.000  TF        1.2000000      5.000           1.965
## 5/1/2015     Metolachlor       4  SF        0.8000000      5.000  TF        0.2700000      4.500           1.965
## 5/1/2015     Metolachlor       3  SF        0.0000000     16.000  TF        0.3200000      1.000           1.965
## 5/22/2015    Metolachlor       7  SF        0.0000000         NA  TF        0.0000000         NA           0.650
## 5/22/2015    Metolachlor       4  SF        1.3200000     25.000  TF        0.5300000      6.000           0.650
## 5/22/2015    Metolachlor       3  SF        0.0000000         NA  TF        0.0000000         NA           0.650
## 6/10/2015    Metolachlor       4  SF        0.9500000     25.000  TF        0.5400000      4.000           2.580
## 6/10/2015    Metolachlor       3  SF        0.6300000     15.000  TF        1.4000000      4.000           2.580
## 6/10/2015    Metolachlor       7  SF        0.3600000     20.000  TF        2.9800000      5.000           2.580
## 6/23/2015    Metolachlor       3  SF        0.6900000         NA  TF        1.6700000         NA           1.810
## 6/23/2015    Metolachlor       7  SF        2.2000000         NA  TF        2.7800000         NA           1.810
## 6/23/2015    Metolachlor       4  SF        1.7500000         NA  TF        0.7100000         NA           1.810
## 7/10/2015    Metolachlor       7  SF        1.5300000      7.000  TF        0.5800000      2.000           1.370
## 7/10/2015    Metolachlor       4  SF        0.4300000     25.000  TF        0.2900000      4.000           1.370
## 7/10/2015    Metolachlor       3  SF        0.7400000      8.500  TF        0.6300000      3.000           1.370
## 7/17/2015    Metolachlor       7  SF        0.5300000         NA  TF        0.9800000         NA           1.730
## 7/17/2015    Metolachlor       4  SF        0.6600000         NA  TF        0.5300000         NA           1.730
## 7/17/2015    Metolachlor       3  SF        0.4500000         NA  TF        0.9500000         NA           1.730
## 7/2/2015     Metolachlor       4  SF        0.5900000      0.675  TF        0.7700000      4.000           1.010
## 7/2/2015     Metolachlor       7  SF        1.5200000      3.000  TF        1.4100000      1.500           1.010
## 7/2/2015     Metolachlor       3  SF        0.0000000         NA  TF        1.1300000      1.000           1.010
## 7/30/2015    Metolachlor       3  SF        0.4600000     20.000  TF        0.4700000      4.000           2.970
## 7/30/2015    Metolachlor       4  SF        0.5700000     25.000  TF        0.2700000      6.000           2.970
## 7/30/2015    Metolachlor       7  SF        0.9300000     20.000  TF        0.3800000      3.500           2.970
## 8/13/2015    Metolachlor       7  SF        0.8000000     15.000  TF        0.2900000      4.000           3.090
## 8/13/2015    Metolachlor       3  SF        0.3400000     13.000  TF        0.4700000      4.000           3.090
## 8/13/2015    Metolachlor       4  SF        0.4200000     20.000  TF        0.2500000      6.000           3.090
## 8/27/2015    Metolachlor       7  SF        0.8500000     25.000  TF        0.3600000      4.000           2.380
## 8/27/2015    Metolachlor       4  SF        0.2900000     25.000  TF        0.1400000      4.750           2.380
## 8/27/2015    Metolachlor       3  SF        0.2800000     17.000  TF        0.2900000      4.000           2.380
## 9/17/2015    Metolachlor       4  SF        0.6400000     25.000  TF        0.5500000      3.000           1.890
## 9/17/2015    Metolachlor       7  SF        2.6300000     14.000  TF        0.1300000      2.000           1.890
## 9/17/2015    Metolachlor       3  SF        0.0000000      2.500  TF        0.6400000      3.000           1.890
## 9/3/2015     Metolachlor       3  SF        0.7272727      0.220  TF        0.0289855      0.690           0.460
## 9/3/2015     Metolachlor       4  SF        0.3703704      0.540  TF        1.3300000      0.550           0.460
## 9/3/2015     Metolachlor       7  SF        0.4018547      0.647  TF        0.2068966      0.435           0.460
## 
##  Wilcoxon signed rank test with continuity correction
## 
## data:  chem_merge$Conc.x and chem_merge$Conc.y
## V = 701, p-value = 0.1907
## alternative hypothesis: true location shift is greater than 0

## [1] "======================================================="
## [1] "Tebuconazole"

## [1] "Tebuconazole stemflow detection frequency =  15 / 54"
## [1] "Tebuconazole stemflow concentration range =( 0 , 1.64 )"
## [1] "Tebuconazole throughfall detection frequency =  43 / 54"
## [1] "Tebuconazole throughfall concentration range =( 0 , 1.8 )"
## [1] "(throughfall_greater, ties, stemflow_greater) = ( 35 , 10 , 9 )"
## 
## 
## Date         Compound        Site  Type.x       Conc.x   Volume.x  Type.y       Conc.y   Volume.y   amount_inches
## -----------  -------------  -----  -------  ----------  ---------  -------  ----------  ---------  --------------
## 1/17/2016    Tebuconazole       3  SF        0.0000000     25.000  TF        0.1800000     10.000           3.900
## 1/17/2016    Tebuconazole       4  SF        0.0000000     25.000  TF        0.1800000     10.000           3.900
## 1/17/2016    Tebuconazole       7  SF        0.2200000     25.000  TF        0.0000000      7.000           3.900
## 10/8/2015    Tebuconazole       7  SF        0.4700000     17.000  TF        0.2100000      5.000           2.220
## 10/8/2015    Tebuconazole       3  SF        0.0000000     20.000  TF        0.2200000      3.750           2.220
## 10/8/2015    Tebuconazole       4  SF        0.3300000     25.000  TF        0.3400000      4.000           2.220
## 11/8/2015    Tebuconazole       7  SF        0.0000000      5.000  TF        0.2600000      1.000           1.040
## 11/8/2015    Tebuconazole       4  SF        0.0000000     15.000  TF        0.3500000      2.000           1.040
## 11/8/2015    Tebuconazole       3  SF        0.0000000         NA  TF        0.0000000      2.000           1.040
## 12/17/2015   Tebuconazole       4  SF        0.2900000     25.000  TF        0.2400000     12.000           6.760
## 12/17/2015   Tebuconazole       7  SF        0.0000000     25.000  TF        0.0000000      9.000           6.760
## 12/17/2015   Tebuconazole       3  SF        0.0000000     25.000  TF        0.0000000     12.000           6.760
## 3/18/2015    Tebuconazole       3  SF        0.0000000      0.132  TF        0.0000000      0.635           0.150
## 3/18/2015    Tebuconazole       4  SF        0.0000000      1.000  TF        0.0000000      0.440           0.150
## 3/18/2015    Tebuconazole       7  SF        0.0000000      0.230  TF        0.0000000      0.550           0.150
## 4/16/2015    Tebuconazole       7  SF        0.0000000     12.500  TF        0.1600000      2.000           2.485
## 4/16/2015    Tebuconazole       3  SF        0.0000000      0.670  TF        0.0000000      3.000           2.485
## 4/16/2015    Tebuconazole       4  SF        0.0000000     13.000  TF        0.0000000      2.000           2.485
## 5/1/2015     Tebuconazole       7  SF        0.0000000     20.000  TF        0.2100000      5.000           1.965
## 5/1/2015     Tebuconazole       4  SF        0.0000000      5.000  TF        0.2800000      4.500           1.965
## 5/1/2015     Tebuconazole       3  SF        0.0000000     16.000  TF        0.1900000      1.000           1.965
## 5/22/2015    Tebuconazole       7  SF        0.0000000         NA  TF        0.0000000         NA           0.650
## 5/22/2015    Tebuconazole       4  SF        0.2700000     25.000  TF        0.2200000      6.000           0.650
## 5/22/2015    Tebuconazole       3  SF        0.0000000         NA  TF        0.0000000         NA           0.650
## 6/10/2015    Tebuconazole       4  SF        0.0000000     25.000  TF        0.2000000      4.000           2.580
## 6/10/2015    Tebuconazole       3  SF        0.0000000     15.000  TF        0.1800000      4.000           2.580
## 6/10/2015    Tebuconazole       7  SF        0.0000000     20.000  TF        0.2600000      5.000           2.580
## 6/23/2015    Tebuconazole       3  SF        0.0000000         NA  TF        0.1800000         NA           1.810
## 6/23/2015    Tebuconazole       7  SF        0.0000000         NA  TF        0.1900000         NA           1.810
## 6/23/2015    Tebuconazole       4  SF        0.2400000         NA  TF        0.2100000         NA           1.810
## 7/10/2015    Tebuconazole       7  SF        0.3600000      7.000  TF        0.2400000      2.000           1.370
## 7/10/2015    Tebuconazole       4  SF        0.0000000     25.000  TF        0.1900000      4.000           1.370
## 7/10/2015    Tebuconazole       3  SF        0.0000000      8.500  TF        0.2900000      3.000           1.370
## 7/17/2015    Tebuconazole       7  SF        0.0000000         NA  TF        0.2800000         NA           1.730
## 7/17/2015    Tebuconazole       4  SF        0.0000000         NA  TF        0.3500000         NA           1.730
## 7/17/2015    Tebuconazole       3  SF        0.0000000         NA  TF        0.5900000         NA           1.730
## 7/2/2015     Tebuconazole       4  SF        0.0000000      0.675  TF        0.2300000      4.000           1.010
## 7/2/2015     Tebuconazole       7  SF        0.0000000      3.000  TF        0.3700000      1.500           1.010
## 7/2/2015     Tebuconazole       3  SF        0.0000000         NA  TF        0.4900000      1.000           1.010
## 7/30/2015    Tebuconazole       3  SF        0.0000000     20.000  TF        0.2100000      4.000           2.970
## 7/30/2015    Tebuconazole       4  SF        0.2500000     25.000  TF        0.2700000      6.000           2.970
## 7/30/2015    Tebuconazole       7  SF        0.0000000     20.000  TF        0.2100000      3.500           2.970
## 8/13/2015    Tebuconazole       7  SF        0.2400000     15.000  TF        0.3200000      4.000           3.090
## 8/13/2015    Tebuconazole       3  SF        0.0000000     13.000  TF        0.3000000      4.000           3.090
## 8/13/2015    Tebuconazole       4  SF        0.0000000     20.000  TF        0.2600000      6.000           3.090
## 8/27/2015    Tebuconazole       7  SF        1.2800000     25.000  TF        0.6500000      4.000           2.380
## 8/27/2015    Tebuconazole       4  SF        0.6500000     25.000  TF        1.8000000      4.750           2.380
## 8/27/2015    Tebuconazole       3  SF        1.6400000     17.000  TF        0.6500000      4.000           2.380
## 9/17/2015    Tebuconazole       4  SF        0.3300000     25.000  TF        0.7900000      3.000           1.890
## 9/17/2015    Tebuconazole       7  SF        0.0000000     14.000  TF        0.2600000      2.000           1.890
## 9/17/2015    Tebuconazole       3  SF        0.0000000      2.500  TF        0.4200000      3.000           1.890
## 9/3/2015     Tebuconazole       3  SF        0.0000000      0.220  TF        0.3333333      0.690           0.460
## 9/3/2015     Tebuconazole       4  SF        0.5370370      0.540  TF        0.7454545      0.550           0.460
## 9/3/2015     Tebuconazole       7  SF        0.6800618      0.647  TF        0.6206897      0.435           0.460
## 
##  Wilcoxon signed rank test with continuity correction
## 
## data:  chem_merge$Conc.x and chem_merge$Conc.y
## V = 160.5, p-value = 1
## alternative hypothesis: true location shift is greater than 0

## [1] "======================================================="
## [1] "2-Phenylphenol"

## [1] "2-Phenylphenol stemflow detection frequency =  15 / 54"
## [1] "2-Phenylphenol stemflow concentration range =( 0 , 0.68 )"
## [1] "2-Phenylphenol throughfall detection frequency =  23 / 54"
## [1] "2-Phenylphenol throughfall concentration range =( 0 , 0.545454545 )"
## [1] "(throughfall_greater, ties, stemflow_greater) = ( 21 , 23 , 10 )"
## 
## 
## Date         Compound          Site  Type.x       Conc.x   Volume.x  Type.y       Conc.y   Volume.y   amount_inches
## -----------  ---------------  -----  -------  ----------  ---------  -------  ----------  ---------  --------------
## 1/17/2016    2-Phenylphenol       3  SF        0.0000000     25.000  TF        0.0000000     10.000           3.900
## 1/17/2016    2-Phenylphenol       4  SF        0.0000000     25.000  TF        0.0000000     10.000           3.900
## 1/17/2016    2-Phenylphenol       7  SF        0.0000000     25.000  TF        0.0000000      7.000           3.900
## 10/8/2015    2-Phenylphenol       7  SF        0.0000000     17.000  TF        0.0000000      5.000           2.220
## 10/8/2015    2-Phenylphenol       3  SF        0.0000000     20.000  TF        0.1900000      3.750           2.220
## 10/8/2015    2-Phenylphenol       4  SF        0.0000000     25.000  TF        0.1900000      4.000           2.220
## 11/8/2015    2-Phenylphenol       7  SF        0.3700000      5.000  TF        0.0000000      1.000           1.040
## 11/8/2015    2-Phenylphenol       4  SF        0.0000000     15.000  TF        0.2100000      2.000           1.040
## 11/8/2015    2-Phenylphenol       3  SF        0.0000000         NA  TF        0.3000000      2.000           1.040
## 12/17/2015   2-Phenylphenol       4  SF        0.0000000     25.000  TF        0.0600000     12.000           6.760
## 12/17/2015   2-Phenylphenol       7  SF        0.0400000     25.000  TF        0.0000000      9.000           6.760
## 12/17/2015   2-Phenylphenol       3  SF        0.1700000     25.000  TF        0.2100000     12.000           6.760
## 3/18/2015    2-Phenylphenol       3  SF        0.0000000      0.132  TF        0.3622047      0.635           0.150
## 3/18/2015    2-Phenylphenol       4  SF        0.0000000      1.000  TF        0.5454545      0.440           0.150
## 3/18/2015    2-Phenylphenol       7  SF        0.0000000      0.230  TF        0.2300000      0.550           0.150
## 4/16/2015    2-Phenylphenol       7  SF        0.0000000     12.500  TF        0.0000000      2.000           2.485
## 4/16/2015    2-Phenylphenol       3  SF        0.1194030      0.670  TF        0.2200000      3.000           2.485
## 4/16/2015    2-Phenylphenol       4  SF        0.0000000     13.000  TF        0.0000000      2.000           2.485
## 5/1/2015     2-Phenylphenol       7  SF        0.0000000     20.000  TF        0.0000000      5.000           1.965
## 5/1/2015     2-Phenylphenol       4  SF        0.0000000      5.000  TF        0.2000000      4.500           1.965
## 5/1/2015     2-Phenylphenol       3  SF        0.0000000     16.000  TF        0.2000000      1.000           1.965
## 5/22/2015    2-Phenylphenol       7  SF        0.0000000         NA  TF        0.0000000         NA           0.650
## 5/22/2015    2-Phenylphenol       4  SF        0.0000000     25.000  TF        0.0000000      6.000           0.650
## 5/22/2015    2-Phenylphenol       3  SF        0.0000000         NA  TF        0.0000000         NA           0.650
## 6/10/2015    2-Phenylphenol       4  SF        0.0000000     25.000  TF        0.1900000      4.000           2.580
## 6/10/2015    2-Phenylphenol       3  SF        0.0000000     15.000  TF        0.0000000      4.000           2.580
## 6/10/2015    2-Phenylphenol       7  SF        0.0800000     20.000  TF        0.0000000      5.000           2.580
## 6/23/2015    2-Phenylphenol       3  SF        0.0000000         NA  TF        0.0000000         NA           1.810
## 6/23/2015    2-Phenylphenol       7  SF        0.0000000         NA  TF        0.0000000         NA           1.810
## 6/23/2015    2-Phenylphenol       4  SF        0.0000000         NA  TF        0.0000000         NA           1.810
## 7/10/2015    2-Phenylphenol       7  SF        0.0000000      7.000  TF        0.0000000      2.000           1.370
## 7/10/2015    2-Phenylphenol       4  SF        0.0000000     25.000  TF        0.0000000      4.000           1.370
## 7/10/2015    2-Phenylphenol       3  SF        0.0400000      8.500  TF        0.0000000      3.000           1.370
## 7/17/2015    2-Phenylphenol       7  SF        0.0400000         NA  TF        0.0000000         NA           1.730
## 7/17/2015    2-Phenylphenol       4  SF        0.0000000         NA  TF        0.1900000         NA           1.730
## 7/17/2015    2-Phenylphenol       3  SF        0.0000000         NA  TF        0.2800000         NA           1.730
## 7/2/2015     2-Phenylphenol       4  SF        0.0740741      0.675  TF        0.0000000      4.000           1.010
## 7/2/2015     2-Phenylphenol       7  SF        0.0000000      3.000  TF        0.0000000      1.500           1.010
## 7/2/2015     2-Phenylphenol       3  SF        0.0000000         NA  TF        0.2000000      1.000           1.010
## 7/30/2015    2-Phenylphenol       3  SF        0.3700000     20.000  TF        0.2000000      4.000           2.970
## 7/30/2015    2-Phenylphenol       4  SF        0.0000000     25.000  TF        0.0000000      6.000           2.970
## 7/30/2015    2-Phenylphenol       7  SF        0.0000000     20.000  TF        0.1900000      3.500           2.970
## 8/13/2015    2-Phenylphenol       7  SF        0.0000000     15.000  TF        0.0000000      4.000           3.090
## 8/13/2015    2-Phenylphenol       3  SF        0.0000000     13.000  TF        0.0000000      4.000           3.090
## 8/13/2015    2-Phenylphenol       4  SF        0.0000000     20.000  TF        0.0000000      6.000           3.090
## 8/27/2015    2-Phenylphenol       7  SF        0.0000000     25.000  TF        0.0000000      4.000           2.380
## 8/27/2015    2-Phenylphenol       4  SF        0.0000000     25.000  TF        0.0000000      4.750           2.380
## 8/27/2015    2-Phenylphenol       3  SF        0.0500000     17.000  TF        0.0000000      4.000           2.380
## 9/17/2015    2-Phenylphenol       4  SF        0.0100000     25.000  TF        0.1900000      3.000           1.890
## 9/17/2015    2-Phenylphenol       7  SF        0.0000000     14.000  TF        0.2300000      2.000           1.890
## 9/17/2015    2-Phenylphenol       3  SF        0.6800000      2.500  TF        0.4700000      3.000           1.890
## 9/3/2015     2-Phenylphenol       3  SF        0.1818182      0.220  TF        0.2898551      0.690           0.460
## 9/3/2015     2-Phenylphenol       4  SF        0.0370370      0.540  TF        0.0000000      0.550           0.460
## 9/3/2015     2-Phenylphenol       7  SF        0.0154560      0.647  TF        0.4827586      0.435           0.460
## 
##  Wilcoxon signed rank test with continuity correction
## 
## data:  chem_merge$Conc.x and chem_merge$Conc.y
## V = 100, p-value = 0.9982
## alternative hypothesis: true location shift is greater than 0

## [1] "======================================================="
## [1] "Atrazine"

## [1] "Atrazine stemflow detection frequency =  10 / 54"
## [1] "Atrazine stemflow concentration range =( 0 , 3.65 )"
## [1] "Atrazine throughfall detection frequency =  17 / 54"
## [1] "Atrazine throughfall concentration range =( 0 , 7.09 )"
## [1] "(throughfall_greater, ties, stemflow_greater) = ( 12 , 35 , 7 )"
## 
## 
## Date         Compound    Site  Type.x    Conc.x   Volume.x  Type.y    Conc.y   Volume.y   amount_inches
## -----------  ---------  -----  -------  -------  ---------  -------  -------  ---------  --------------
## 1/17/2016    Atrazine       3  SF          0.00     25.000  TF          0.00     10.000           3.900
## 1/17/2016    Atrazine       4  SF          0.00     25.000  TF          0.00     10.000           3.900
## 1/17/2016    Atrazine       7  SF          0.00     25.000  TF          0.00      7.000           3.900
## 10/8/2015    Atrazine       7  SF          0.00     17.000  TF          0.00      5.000           2.220
## 10/8/2015    Atrazine       3  SF          0.00     20.000  TF          0.00      3.750           2.220
## 10/8/2015    Atrazine       4  SF          0.00     25.000  TF          0.00      4.000           2.220
## 11/8/2015    Atrazine       7  SF          0.00      5.000  TF          0.00      1.000           1.040
## 11/8/2015    Atrazine       4  SF          0.00     15.000  TF          0.00      2.000           1.040
## 11/8/2015    Atrazine       3  SF          0.00         NA  TF          0.00      2.000           1.040
## 12/17/2015   Atrazine       4  SF          0.00     25.000  TF          0.00     12.000           6.760
## 12/17/2015   Atrazine       7  SF          0.00     25.000  TF          0.00      9.000           6.760
## 12/17/2015   Atrazine       3  SF          0.00     25.000  TF          0.00     12.000           6.760
## 3/18/2015    Atrazine       3  SF          0.00      0.132  TF          0.00      0.635           0.150
## 3/18/2015    Atrazine       4  SF          0.00      1.000  TF          0.00      0.440           0.150
## 3/18/2015    Atrazine       7  SF          0.00      0.230  TF          0.00      0.550           0.150
## 4/16/2015    Atrazine       7  SF          0.00     12.500  TF          0.72      2.000           2.485
## 4/16/2015    Atrazine       3  SF          0.00      0.670  TF          0.00      3.000           2.485
## 4/16/2015    Atrazine       4  SF          0.00     13.000  TF          0.00      2.000           2.485
## 5/1/2015     Atrazine       7  SF          0.68     20.000  TF          1.55      5.000           1.965
## 5/1/2015     Atrazine       4  SF          2.44      5.000  TF          2.74      4.500           1.965
## 5/1/2015     Atrazine       3  SF          2.70     16.000  TF          7.09      1.000           1.965
## 5/22/2015    Atrazine       7  SF          0.00         NA  TF          0.00         NA           0.650
## 5/22/2015    Atrazine       4  SF          3.65     25.000  TF          1.17      6.000           0.650
## 5/22/2015    Atrazine       3  SF          0.00         NA  TF          0.00         NA           0.650
## 6/10/2015    Atrazine       4  SF          0.66     25.000  TF          0.52      4.000           2.580
## 6/10/2015    Atrazine       3  SF          2.69     15.000  TF          2.11      4.000           2.580
## 6/10/2015    Atrazine       7  SF          0.00     20.000  TF          0.37      5.000           2.580
## 6/23/2015    Atrazine       3  SF          1.01         NA  TF          0.70         NA           1.810
## 6/23/2015    Atrazine       7  SF          0.00         NA  TF          0.30         NA           1.810
## 6/23/2015    Atrazine       4  SF          0.00         NA  TF          0.17         NA           1.810
## 7/10/2015    Atrazine       7  SF          0.00      7.000  TF          0.00      2.000           1.370
## 7/10/2015    Atrazine       4  SF          0.00     25.000  TF          0.00      4.000           1.370
## 7/10/2015    Atrazine       3  SF          0.87      8.500  TF          0.00      3.000           1.370
## 7/17/2015    Atrazine       7  SF          0.00         NA  TF          0.23         NA           1.730
## 7/17/2015    Atrazine       4  SF          0.00         NA  TF          0.00         NA           1.730
## 7/17/2015    Atrazine       3  SF          0.70         NA  TF          0.24         NA           1.730
## 7/2/2015     Atrazine       4  SF          0.00      0.675  TF          0.16      4.000           1.010
## 7/2/2015     Atrazine       7  SF          0.00      3.000  TF          0.00      1.500           1.010
## 7/2/2015     Atrazine       3  SF          0.00         NA  TF          0.25      1.000           1.010
## 7/30/2015    Atrazine       3  SF          0.00     20.000  TF          0.00      4.000           2.970
## 7/30/2015    Atrazine       4  SF          0.00     25.000  TF          0.00      6.000           2.970
## 7/30/2015    Atrazine       7  SF          0.00     20.000  TF          0.00      3.500           2.970
## 8/13/2015    Atrazine       7  SF          0.00     15.000  TF          0.00      4.000           3.090
## 8/13/2015    Atrazine       3  SF          0.42     13.000  TF          0.00      4.000           3.090
## 8/13/2015    Atrazine       4  SF          0.00     20.000  TF          0.00      6.000           3.090
## 8/27/2015    Atrazine       7  SF          0.00     25.000  TF          0.52      4.000           2.380
## 8/27/2015    Atrazine       4  SF          0.00     25.000  TF          0.00      4.750           2.380
## 8/27/2015    Atrazine       3  SF          0.00     17.000  TF          0.19      4.000           2.380
## 9/17/2015    Atrazine       4  SF          0.00     25.000  TF          0.00      3.000           1.890
## 9/17/2015    Atrazine       7  SF          0.00     14.000  TF          0.00      2.000           1.890
## 9/17/2015    Atrazine       3  SF          0.00      2.500  TF          0.00      3.000           1.890
## 9/3/2015     Atrazine       3  SF          0.00      0.220  TF          0.00      0.690           0.460
## 9/3/2015     Atrazine       4  SF          0.00      0.540  TF          0.00      0.550           0.460
## 9/3/2015     Atrazine       7  SF          0.00      0.647  TF          0.00      0.435           0.460
## 
##  Wilcoxon signed rank test with continuity correction
## 
## data:  chem_merge$Conc.x and chem_merge$Conc.y
## V = 81.5, p-value = 0.7134
## alternative hypothesis: true location shift is greater than 0

## [1] "======================================================="
## [1] "Biphenyl"

## [1] "Biphenyl stemflow detection frequency =  13 / 54"
## [1] "Biphenyl stemflow concentration range =( 0 , 1.34 )"
## [1] "Biphenyl throughfall detection frequency =  44 / 54"
## [1] "Biphenyl throughfall concentration range =( 0 , 0.07 )"
## [1] "(throughfall_greater, ties, stemflow_greater) = ( 35 , 10 , 9 )"
## 
## 
## Date         Compound    Site  Type.x    Conc.x   Volume.x  Type.y       Conc.y   Volume.y   amount_inches
## -----------  ---------  -----  -------  -------  ---------  -------  ----------  ---------  --------------
## 1/17/2016    Biphenyl       3  SF          0.00     25.000  TF        0.0000000     10.000           3.900
## 1/17/2016    Biphenyl       4  SF          0.00     25.000  TF        0.0000000     10.000           3.900
## 1/17/2016    Biphenyl       7  SF          0.00     25.000  TF        0.0200000      7.000           3.900
## 10/8/2015    Biphenyl       7  SF          0.00     17.000  TF        0.0200000      5.000           2.220
## 10/8/2015    Biphenyl       3  SF          0.00     20.000  TF        0.0300000      3.750           2.220
## 10/8/2015    Biphenyl       4  SF          0.00     25.000  TF        0.0200000      4.000           2.220
## 11/8/2015    Biphenyl       7  SF          1.34      5.000  TF        0.0000000      1.000           1.040
## 11/8/2015    Biphenyl       4  SF          1.12     15.000  TF        0.0500000      2.000           1.040
## 11/8/2015    Biphenyl       3  SF          0.00         NA  TF        0.0700000      2.000           1.040
## 12/17/2015   Biphenyl       4  SF          0.00     25.000  TF        0.0200000     12.000           6.760
## 12/17/2015   Biphenyl       7  SF          0.28     25.000  TF        0.0300000      9.000           6.760
## 12/17/2015   Biphenyl       3  SF          1.16     25.000  TF        0.0300000     12.000           6.760
## 3/18/2015    Biphenyl       3  SF          0.00      0.132  TF        0.0472441      0.635           0.150
## 3/18/2015    Biphenyl       4  SF          0.00      1.000  TF        0.0681818      0.440           0.150
## 3/18/2015    Biphenyl       7  SF          0.00      0.230  TF        0.0300000      0.550           0.150
## 4/16/2015    Biphenyl       7  SF          0.00     12.500  TF        0.0300000      2.000           2.485
## 4/16/2015    Biphenyl       3  SF          0.00      0.670  TF        0.0600000      3.000           2.485
## 4/16/2015    Biphenyl       4  SF          0.25     13.000  TF        0.0400000      2.000           2.485
## 5/1/2015     Biphenyl       7  SF          0.00     20.000  TF        0.0200000      5.000           1.965
## 5/1/2015     Biphenyl       4  SF          0.00      5.000  TF        0.0300000      4.500           1.965
## 5/1/2015     Biphenyl       3  SF          0.00     16.000  TF        0.0300000      1.000           1.965
## 5/22/2015    Biphenyl       7  SF          0.00         NA  TF        0.0000000         NA           0.650
## 5/22/2015    Biphenyl       4  SF          0.00     25.000  TF        0.0300000      6.000           0.650
## 5/22/2015    Biphenyl       3  SF          0.00         NA  TF        0.0000000         NA           0.650
## 6/10/2015    Biphenyl       4  SF          0.00     25.000  TF        0.0200000      4.000           2.580
## 6/10/2015    Biphenyl       3  SF          0.10     15.000  TF        0.0300000      4.000           2.580
## 6/10/2015    Biphenyl       7  SF          0.00     20.000  TF        0.0000000      5.000           2.580
## 6/23/2015    Biphenyl       3  SF          0.00         NA  TF        0.0300000         NA           1.810
## 6/23/2015    Biphenyl       7  SF          0.00         NA  TF        0.0200000         NA           1.810
## 6/23/2015    Biphenyl       4  SF          0.00         NA  TF        0.0200000         NA           1.810
## 7/10/2015    Biphenyl       7  SF          0.00      7.000  TF        0.0200000      2.000           1.370
## 7/10/2015    Biphenyl       4  SF          0.00     25.000  TF        0.0000000      4.000           1.370
## 7/10/2015    Biphenyl       3  SF          0.01      8.500  TF        0.0200000      3.000           1.370
## 7/17/2015    Biphenyl       7  SF          1.04         NA  TF        0.0300000         NA           1.730
## 7/17/2015    Biphenyl       4  SF          0.00         NA  TF        0.0000000         NA           1.730
## 7/17/2015    Biphenyl       3  SF          0.00         NA  TF        0.0200000         NA           1.730
## 7/2/2015     Biphenyl       4  SF          0.00      0.675  TF        0.0200000      4.000           1.010
## 7/2/2015     Biphenyl       7  SF          0.00      3.000  TF        0.0300000      1.500           1.010
## 7/2/2015     Biphenyl       3  SF          0.00         NA  TF        0.0200000      1.000           1.010
## 7/30/2015    Biphenyl       3  SF          0.68     20.000  TF        0.0200000      4.000           2.970
## 7/30/2015    Biphenyl       4  SF          0.00     25.000  TF        0.0200000      6.000           2.970
## 7/30/2015    Biphenyl       7  SF          0.00     20.000  TF        0.0000000      3.500           2.970
## 8/13/2015    Biphenyl       7  SF          0.00     15.000  TF        0.0200000      4.000           3.090
## 8/13/2015    Biphenyl       3  SF          0.01     13.000  TF        0.0200000      4.000           3.090
## 8/13/2015    Biphenyl       4  SF          0.00     20.000  TF        0.0200000      6.000           3.090
## 8/27/2015    Biphenyl       7  SF          0.00     25.000  TF        0.0200000      4.000           2.380
## 8/27/2015    Biphenyl       4  SF          0.02     25.000  TF        0.0200000      4.750           2.380
## 8/27/2015    Biphenyl       3  SF          0.00     17.000  TF        0.0300000      4.000           2.380
## 9/17/2015    Biphenyl       4  SF          0.02     25.000  TF        0.0300000      3.000           1.890
## 9/17/2015    Biphenyl       7  SF          0.00     14.000  TF        0.0300000      2.000           1.890
## 9/17/2015    Biphenyl       3  SF          0.49      2.500  TF        0.0300000      3.000           1.890
## 9/3/2015     Biphenyl       3  SF          0.00      0.220  TF        0.0000000      0.690           0.460
## 9/3/2015     Biphenyl       4  SF          0.00      0.540  TF        0.0500000      0.550           0.460
## 9/3/2015     Biphenyl       7  SF          0.00      0.647  TF        0.0459770      0.435           0.460
## 
##  Wilcoxon signed rank test with continuity correction
## 
## data:  chem_merge$Conc.x and chem_merge$Conc.y
## V = 359.5, p-value = 0.9451
## alternative hypothesis: true location shift is greater than 0

## [1] "======================================================="
## [1] "DEA"

## [1] "DEA stemflow detection frequency =  11 / 54"
## [1] "DEA stemflow concentration range =( 0 , 9.54 )"
## [1] "DEA throughfall detection frequency =  3 / 54"
## [1] "DEA throughfall concentration range =( 0 , 1.55 )"
## [1] "(throughfall_greater, ties, stemflow_greater) = ( 2 , 43 , 9 )"
## 
## 
## Date         Compound    Site  Type.x    Conc.x   Volume.x  Type.y    Conc.y   Volume.y   amount_inches
## -----------  ---------  -----  -------  -------  ---------  -------  -------  ---------  --------------
## 1/17/2016    DEA            3  SF          0.00     25.000  TF          0.00     10.000           3.900
## 1/17/2016    DEA            4  SF          0.00     25.000  TF          0.00     10.000           3.900
## 1/17/2016    DEA            7  SF          0.00     25.000  TF          0.00      7.000           3.900
## 10/8/2015    DEA            7  SF          0.00     17.000  TF          0.00      5.000           2.220
## 10/8/2015    DEA            3  SF          0.00     20.000  TF          0.00      3.750           2.220
## 10/8/2015    DEA            4  SF          0.00     25.000  TF          0.00      4.000           2.220
## 11/8/2015    DEA            7  SF          0.00      5.000  TF          0.00      1.000           1.040
## 11/8/2015    DEA            4  SF          0.00     15.000  TF          0.00      2.000           1.040
## 11/8/2015    DEA            3  SF          0.00         NA  TF          0.00      2.000           1.040
## 12/17/2015   DEA            4  SF          0.00     25.000  TF          0.00     12.000           6.760
## 12/17/2015   DEA            7  SF          0.00     25.000  TF          0.00      9.000           6.760
## 12/17/2015   DEA            3  SF          0.00     25.000  TF          0.00     12.000           6.760
## 3/18/2015    DEA            3  SF          0.00      0.132  TF          0.00      0.635           0.150
## 3/18/2015    DEA            4  SF          0.00      1.000  TF          0.00      0.440           0.150
## 3/18/2015    DEA            7  SF          0.00      0.230  TF          0.00      0.550           0.150
## 4/16/2015    DEA            7  SF          0.00     12.500  TF          0.00      2.000           2.485
## 4/16/2015    DEA            3  SF          0.00      0.670  TF          0.00      3.000           2.485
## 4/16/2015    DEA            4  SF          0.00     13.000  TF          0.00      2.000           2.485
## 5/1/2015     DEA            7  SF          0.00     20.000  TF          0.00      5.000           1.965
## 5/1/2015     DEA            4  SF          9.54      5.000  TF          0.73      4.500           1.965
## 5/1/2015     DEA            3  SF          0.40     16.000  TF          1.55      1.000           1.965
## 5/22/2015    DEA            7  SF          0.00         NA  TF          0.00         NA           0.650
## 5/22/2015    DEA            4  SF          0.72     25.000  TF          0.00      6.000           0.650
## 5/22/2015    DEA            3  SF          0.00         NA  TF          0.00         NA           0.650
## 6/10/2015    DEA            4  SF          0.11     25.000  TF          0.00      4.000           2.580
## 6/10/2015    DEA            3  SF          0.50     15.000  TF          0.83      4.000           2.580
## 6/10/2015    DEA            7  SF          0.00     20.000  TF          0.00      5.000           2.580
## 6/23/2015    DEA            3  SF          0.71         NA  TF          0.00         NA           1.810
## 6/23/2015    DEA            7  SF          0.00         NA  TF          0.00         NA           1.810
## 6/23/2015    DEA            4  SF          0.00         NA  TF          0.00         NA           1.810
## 7/10/2015    DEA            7  SF          0.00      7.000  TF          0.00      2.000           1.370
## 7/10/2015    DEA            4  SF          0.00     25.000  TF          0.00      4.000           1.370
## 7/10/2015    DEA            3  SF          0.47      8.500  TF          0.00      3.000           1.370
## 7/17/2015    DEA            7  SF          0.00         NA  TF          0.00         NA           1.730
## 7/17/2015    DEA            4  SF          0.00         NA  TF          0.00         NA           1.730
## 7/17/2015    DEA            3  SF          0.33         NA  TF          0.00         NA           1.730
## 7/2/2015     DEA            4  SF          0.00      0.675  TF          0.00      4.000           1.010
## 7/2/2015     DEA            7  SF          0.00      3.000  TF          0.00      1.500           1.010
## 7/2/2015     DEA            3  SF          0.00         NA  TF          0.00      1.000           1.010
## 7/30/2015    DEA            3  SF          0.08     20.000  TF          0.00      4.000           2.970
## 7/30/2015    DEA            4  SF          0.00     25.000  TF          0.00      6.000           2.970
## 7/30/2015    DEA            7  SF          0.00     20.000  TF          0.00      3.500           2.970
## 8/13/2015    DEA            7  SF          0.00     15.000  TF          0.00      4.000           3.090
## 8/13/2015    DEA            3  SF          0.08     13.000  TF          0.00      4.000           3.090
## 8/13/2015    DEA            4  SF          0.00     20.000  TF          0.00      6.000           3.090
## 8/27/2015    DEA            7  SF          0.00     25.000  TF          0.00      4.000           2.380
## 8/27/2015    DEA            4  SF          0.00     25.000  TF          0.00      4.750           2.380
## 8/27/2015    DEA            3  SF          0.02     17.000  TF          0.00      4.000           2.380
## 9/17/2015    DEA            4  SF          0.00     25.000  TF          0.00      3.000           1.890
## 9/17/2015    DEA            7  SF          0.00     14.000  TF          0.00      2.000           1.890
## 9/17/2015    DEA            3  SF          0.00      2.500  TF          0.00      3.000           1.890
## 9/3/2015     DEA            3  SF          0.00      0.220  TF          0.00      0.690           0.460
## 9/3/2015     DEA            4  SF          0.00      0.540  TF          0.00      0.550           0.460
## 9/3/2015     DEA            7  SF          0.00      0.647  TF          0.00      0.435           0.460
## 
##  Wilcoxon signed rank test with continuity correction
## 
## data:  chem_merge$Conc.x and chem_merge$Conc.y
## V = 51, p-value = 0.05977
## alternative hypothesis: true location shift is greater than 0

## [1] "======================================================="
## [1] "Flutolanil"

## [1] "Flutolanil stemflow detection frequency =  15 / 54"
## [1] "Flutolanil stemflow concentration range =( 0 , 0.38 )"
## [1] "Flutolanil throughfall detection frequency =  28 / 54"
## [1] "Flutolanil throughfall concentration range =( 0 , 0.63 )"
## [1] "(throughfall_greater, ties, stemflow_greater) = ( 23 , 26 , 5 )"
## 
## 
## Date         Compound      Site  Type.x       Conc.x   Volume.x  Type.y       Conc.y   Volume.y   amount_inches
## -----------  -----------  -----  -------  ----------  ---------  -------  ----------  ---------  --------------
## 1/17/2016    Flutolanil       3  SF        0.0000000     25.000  TF        0.0000000     10.000           3.900
## 1/17/2016    Flutolanil       4  SF        0.0000000     25.000  TF        0.0000000     10.000           3.900
## 1/17/2016    Flutolanil       7  SF        0.0000000     25.000  TF        0.0700000      7.000           3.900
## 10/8/2015    Flutolanil       7  SF        0.0900000     17.000  TF        0.1000000      5.000           2.220
## 10/8/2015    Flutolanil       3  SF        0.0000000     20.000  TF        0.1300000      3.750           2.220
## 10/8/2015    Flutolanil       4  SF        0.1800000     25.000  TF        0.1400000      4.000           2.220
## 11/8/2015    Flutolanil       7  SF        0.0000000      5.000  TF        0.1700000      1.000           1.040
## 11/8/2015    Flutolanil       4  SF        0.0000000     15.000  TF        0.0800000      2.000           1.040
## 11/8/2015    Flutolanil       3  SF        0.0000000         NA  TF        0.0000000      2.000           1.040
## 12/17/2015   Flutolanil       4  SF        0.2200000     25.000  TF        0.0000000     12.000           6.760
## 12/17/2015   Flutolanil       7  SF        0.0000000     25.000  TF        0.0000000      9.000           6.760
## 12/17/2015   Flutolanil       3  SF        0.0000000     25.000  TF        0.0000000     12.000           6.760
## 3/18/2015    Flutolanil       3  SF        0.0000000      0.132  TF        0.0000000      0.635           0.150
## 3/18/2015    Flutolanil       4  SF        0.0000000      1.000  TF        0.0000000      0.440           0.150
## 3/18/2015    Flutolanil       7  SF        0.0000000      0.230  TF        0.0000000      0.550           0.150
## 4/16/2015    Flutolanil       7  SF        0.0000000     12.500  TF        0.0000000      2.000           2.485
## 4/16/2015    Flutolanil       3  SF        0.0000000      0.670  TF        0.0000000      3.000           2.485
## 4/16/2015    Flutolanil       4  SF        0.0000000     13.000  TF        0.0000000      2.000           2.485
## 5/1/2015     Flutolanil       7  SF        0.0000000     20.000  TF        0.0000000      5.000           1.965
## 5/1/2015     Flutolanil       4  SF        0.0000000      5.000  TF        0.0000000      4.500           1.965
## 5/1/2015     Flutolanil       3  SF        0.0000000     16.000  TF        0.0000000      1.000           1.965
## 5/22/2015    Flutolanil       7  SF        0.0000000         NA  TF        0.0000000         NA           0.650
## 5/22/2015    Flutolanil       4  SF        0.0000000     25.000  TF        0.0000000      6.000           0.650
## 5/22/2015    Flutolanil       3  SF        0.0000000         NA  TF        0.0000000         NA           0.650
## 6/10/2015    Flutolanil       4  SF        0.0000000     25.000  TF        0.0000000      4.000           2.580
## 6/10/2015    Flutolanil       3  SF        0.0000000     15.000  TF        0.0000000      4.000           2.580
## 6/10/2015    Flutolanil       7  SF        0.0900000     20.000  TF        0.0900000      5.000           2.580
## 6/23/2015    Flutolanil       3  SF        0.0000000         NA  TF        0.0000000         NA           1.810
## 6/23/2015    Flutolanil       7  SF        0.0000000         NA  TF        0.0000000         NA           1.810
## 6/23/2015    Flutolanil       4  SF        0.0000000         NA  TF        0.0000000         NA           1.810
## 7/10/2015    Flutolanil       7  SF        0.1200000      7.000  TF        0.1300000      2.000           1.370
## 7/10/2015    Flutolanil       4  SF        0.0000000     25.000  TF        0.1100000      4.000           1.370
## 7/10/2015    Flutolanil       3  SF        0.1500000      8.500  TF        0.6300000      3.000           1.370
## 7/17/2015    Flutolanil       7  SF        0.0000000         NA  TF        0.3000000         NA           1.730
## 7/17/2015    Flutolanil       4  SF        0.2300000         NA  TF        0.2400000         NA           1.730
## 7/17/2015    Flutolanil       3  SF        0.2100000         NA  TF        0.3500000         NA           1.730
## 7/2/2015     Flutolanil       4  SF        0.0000000      0.675  TF        0.0000000      4.000           1.010
## 7/2/2015     Flutolanil       7  SF        0.2400000      3.000  TF        0.1500000      1.500           1.010
## 7/2/2015     Flutolanil       3  SF        0.0000000         NA  TF        0.2000000      1.000           1.010
## 7/30/2015    Flutolanil       3  SF        0.0000000     20.000  TF        0.1900000      4.000           2.970
## 7/30/2015    Flutolanil       4  SF        0.2100000     25.000  TF        0.0800000      6.000           2.970
## 7/30/2015    Flutolanil       7  SF        0.0000000     20.000  TF        0.1800000      3.500           2.970
## 8/13/2015    Flutolanil       7  SF        0.1400000     15.000  TF        0.3100000      4.000           3.090
## 8/13/2015    Flutolanil       3  SF        0.0000000     13.000  TF        0.0000000      4.000           3.090
## 8/13/2015    Flutolanil       4  SF        0.0000000     20.000  TF        0.2100000      6.000           3.090
## 8/27/2015    Flutolanil       7  SF        0.0000000     25.000  TF        0.3300000      4.000           2.380
## 8/27/2015    Flutolanil       4  SF        0.1300000     25.000  TF        0.1900000      4.750           2.380
## 8/27/2015    Flutolanil       3  SF        0.3800000     17.000  TF        0.2100000      4.000           2.380
## 9/17/2015    Flutolanil       4  SF        0.3000000     25.000  TF        0.3500000      3.000           1.890
## 9/17/2015    Flutolanil       7  SF        0.0000000     14.000  TF        0.2500000      2.000           1.890
## 9/17/2015    Flutolanil       3  SF        0.0000000      2.500  TF        0.3300000      3.000           1.890
## 9/3/2015     Flutolanil       3  SF        0.0000000      0.220  TF        0.0000000      0.690           0.460
## 9/3/2015     Flutolanil       4  SF        0.0000000      0.540  TF        0.1818182      0.550           0.460
## 9/3/2015     Flutolanil       7  SF        0.0927357      0.647  TF        0.2758621      0.435           0.460
## 
##  Wilcoxon signed rank test with continuity correction
## 
## data:  chem_merge$Conc.x and chem_merge$Conc.y
## V = 63, p-value = 0.9993
## alternative hypothesis: true location shift is greater than 0

global analyses

Two values with high concentrations are not shown on the all tifton data figure.

print('=======================================================')
## [1] "======================================================="
print('global')
## [1] "global"
tifton_sf <- tifton[which(tifton$Type=='SF'),]
tifton_tf <- tifton[which(tifton$Type=='TF'),]
#merge on site, date, compound
tifton_merge <- merge(tifton_sf,tifton_tf,by=c("Compound","Site","Date"))
#change NAs to zeroes for comparisons and the Wilcox test
tifton_merge$Conc.x[is.na(tifton_merge$Conc.x)] <- 0
tifton_merge$Conc.y[is.na(tifton_merge$Conc.y)] <- 0
n_tf_greater <- sum(tifton_merge$Conc.y > tifton_merge$Conc.x)
n_ties <- sum(tifton_merge$Conc.y == tifton_merge$Conc.x)
n_sf_greater <- sum(tifton_merge$Conc.x > tifton_merge$Conc.y)
comparisons <- paste('(throughfall_greater, ties, stemflow_greater) = ('
            ,n_tf_greater,',',n_ties,',',n_sf_greater,')')
print(comparisons)
## [1] "(throughfall_greater, ties, stemflow_greater) = ( 172 , 1466 , 90 )"
tifton_wilcox <- wilcox.test(tifton_merge$Conc.y, tifton_merge$Conc.x, 
                               alternative = 'two.sided', paired = TRUE, exact = FALSE)
x_max <- max(tifton_merge$Conc.x)
y_max <- max(tifton_merge$Conc.y)
max_conc <- max(x_max,y_max)
max_conc_vector <- seq(0,max_conc,20)
print(tifton_wilcox)
## 
##  Wilcoxon signed rank test with continuity correction
## 
## data:  tifton_merge$Conc.y and tifton_merge$Conc.x
## V = 21174, p-value = 0.001304
## alternative hypothesis: true location shift is not equal to 0
plot(tifton_merge$Conc.x, tifton_merge$Conc.y, 
    xlim=c(0,4),ylim=c(0,4),
    xlab='Stemflow Concentration',ylab='Throughfall Concentration',
    main=paste('All Tifton Data (WRS p-value = ',round(tifton_wilcox$p.value,4),')'),
    sub = comparisons)
abline(0,1,col='red')

date analyses

#break down by day
#rainwater
View(rainwater)
#tifton[which(tifton$Compound==chem),]
tifton_sf <- tifton[which(tifton$Type=='SF'),]
dim(tifton_sf)
## [1] 1728    6
tifton_tf <- tifton[which(tifton$Type=='TF'),]
dim(tifton_tf)
## [1] 1728    6
tifton_tp <- tifton[which(tifton$Type=='TP'),]

#merge on site, date, compound
tifton_merge <- merge(tifton_sf,tifton_tf,by=c("Compound","Site","Date"))
dim(tifton_merge)
## [1] 1728    9
tifton_merge <- merge(tifton_merge, rainwater, by="Date")
dim(tifton_merge)
## [1] 1728   10
unique_dates <- unique(tifton_merge$Date)

for(date in unique_dates){
  tifton_merge_date <- tifton_merge[which(tifton$Date==date),]
  #change NAs to zeroes for comparisons and the Wilcox test
  tifton_merge_date$Conc.x[is.na(tifton_merge_date$Conc.x)] <- 0
  tifton_merge_date$Conc.y[is.na(tifton_merge_date$Conc.y)] <- 0
  print(date)
  #print(tifton_merge_date)
  n_tf_greater <- sum(tifton_merge_date$Conc.y > tifton_merge_date$Conc.x)
  n_ties <- sum(tifton_merge_date$Conc.y == tifton_merge_date$Conc.x)
  n_sf_greater <- sum(tifton_merge_date$Conc.x > tifton_merge_date$Conc.y)
  comparisons <- paste(date,'(throughfall_greater, ties, stemflow_greater) = ('
              ,n_tf_greater,',',n_ties,',',n_sf_greater,')')
  print(comparisons)
  
}
## [1] "1/17/2016"
## [1] "1/17/2016 (throughfall_greater, ties, stemflow_greater) = ( 16 , 487 , 9 )"
## [1] "10/8/2015"
## [1] "10/8/2015 (throughfall_greater, ties, stemflow_greater) = ( 16 , 488 , 8 )"
## [1] "11/8/2015"
## [1] "11/8/2015 (throughfall_greater, ties, stemflow_greater) = ( 6 , 498 , 8 )"
## [1] "12/17/2015"
## [1] "12/17/2015 (throughfall_greater, ties, stemflow_greater) = ( 7 , 496 , 9 )"
## [1] "3/18/2015"
## [1] "3/18/2015 (throughfall_greater, ties, stemflow_greater) = ( 0 , 192 , 0 )"
## [1] "4/16/2015"
## [1] "4/16/2015 (throughfall_greater, ties, stemflow_greater) = ( 0 , 192 , 0 )"
## [1] "5/1/2015"
## [1] "5/1/2015 (throughfall_greater, ties, stemflow_greater) = ( 0 , 192 , 0 )"
## [1] "5/22/2015"
## [1] "5/22/2015 (throughfall_greater, ties, stemflow_greater) = ( 14 , 493 , 5 )"
## [1] "6/10/2015"
## [1] "6/10/2015 (throughfall_greater, ties, stemflow_greater) = ( 0 , 192 , 0 )"
## [1] "6/23/2015"
## [1] "6/23/2015 (throughfall_greater, ties, stemflow_greater) = ( 15 , 489 , 8 )"
## [1] "7/10/2015"
## [1] "7/10/2015 (throughfall_greater, ties, stemflow_greater) = ( 0 , 192 , 0 )"
## [1] "7/17/2015"
## [1] "7/17/2015 (throughfall_greater, ties, stemflow_greater) = ( 20 , 481 , 11 )"
## [1] "7/2/2015"
## [1] "7/2/2015 (throughfall_greater, ties, stemflow_greater) = ( 0 , 192 , 0 )"
## [1] "7/30/2015"
## [1] "7/30/2015 (throughfall_greater, ties, stemflow_greater) = ( 0 , 192 , 0 )"
## [1] "8/13/2015"
## [1] "8/13/2015 (throughfall_greater, ties, stemflow_greater) = ( 8 , 501 , 3 )"
## [1] "8/27/2015"
## [1] "8/27/2015 (throughfall_greater, ties, stemflow_greater) = ( 0 , 192 , 0 )"
## [1] "9/17/2015"
## [1] "9/17/2015 (throughfall_greater, ties, stemflow_greater) = ( 17 , 488 , 7 )"
## [1] "9/3/2015"
## [1] "9/3/2015 (throughfall_greater, ties, stemflow_greater) = ( 0 , 192 , 0 )"

regressing versus rainfall amounts

We want to look at how the amount of rainfall influences the concentrations in stemflow and throughfall, in

print('=======================================================')
## [1] "======================================================="
print('global')
## [1] "global"

permutation stat testing

For many of the chemicals, some/most observations have identical/not detected values, hence the warning message thrown by R: unique ranks cannot be computed for all observations in the Wilcox test. Since there are ties, this prevents the computation of an exact p-value. With high numbers of tied data, Wilcoxon tests are not trustworthy. Moreover, in most non-parametric tests we assume that the sampled populations are symmetric and have the same dispersion or shape, which is not verifiable here.

A permutation test may be more appropriate in this case, for example permTS (perm), pperm (exactRankTests), or the coin package. Although these approaches do not take advantage of the paired design.

results

Mixed bag at the moment. Overall inference on paired data shows that throughfall concentrations exceed stemflow concentration 170 times versus 92 of the opposite exceedance. This corresponds to a p-value of 0.0019 with the Wilcoxon Rank Sum test.

There will be complaints from reviewers about the unequal volumes of samples for the two media, we need to be clear that the collection time is the same for these paired comparisons.

I guess we can also break out how often the exceedances are a detect versus a non-detect as opposed to a detect versus detect comparison. Can we assume that the actual detection limit is lower for the higher volume stemflow samples? (meaning that the volumes may bias the analyses towards stemflow exceedances and not throughfall).

Stemflow concentrations probably plagued by dilution versus first flush issues. We may want to think about how to use sample volume or observed rainfall totals for these dates to look at this and separate small from large rain events.

Having detection limits will help us characterize the magnitude of the difference between stemflow and throughfall (for example, ratio calculations that are not possible by treating non-detects as zeroes).