-
Notifications
You must be signed in to change notification settings - Fork 0
/
Table A2 to A6_limit_of_detection_wallace.Rmd
65 lines (50 loc) · 2.13 KB
/
Table A2 to A6_limit_of_detection_wallace.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
title: "Limit of detection according to Wallace 2011"
output: html_notebook
---
Table A2. PM2.5 concentration range, the mean and the standard deviation of the PM2.5 concentrations
within that range, the ration of the mean and the standard deviation and the number of data points
used for the calculations. The Lower limit of detection withWallace et al.
[63] method is defined as the PM2.5 concentration above which the ratio is >3.
```{r}
source("utilities.R")
source("variables.R")
require(dplyr)
require(splitstackshape)
```
```{r}
df <- readRDS(sensor_blank)
df<-cSplit(indt=df,splitCols = c("sensor"),sep="-",direction="wide",drop=FALSE) %>%
select(-sensor_2,-sensor_3)
```
```{r}
require(openair)
df %>%
group_by(sensor_1,date) %>%
summarise(mean_pm25 = mean(PM25, na.rm = TRUE)) %>%
group_by(sensor_1) %>%
mutate(pm25_bin =
ifelse(mean_pm25<0.5,0.5,
ifelse(mean_pm25<1,1,
ifelse(mean_pm25<1.5,1.5,
ifelse(mean_pm25<2,2,
ifelse(mean_pm25<2.5,2.5,
ifelse(mean_pm25<3,3,
ifelse(mean_pm25<3.5,3.5,
ifelse(mean_pm25<4,4,
ifelse(mean_pm25<4.5,4.5,
ifelse(mean_pm25<5,5,
ifelse(mean_pm25<5.5,5.5,
ifelse(mean_pm25<6,6,
ifelse(mean_pm25<6.5,6.5,
ifelse(mean_pm25<7,7,
ifelse(mean_pm25<7.5,7.5,
ifelse(mean_pm25<8,8,
ifelse(mean_pm25<8.5,8.5,
ifelse(mean_pm25<9,9,
ifelse(mean_pm25<9.5,9.5,
ifelse(mean_pm25<10,10,11)))))))))))))))))))))%>%
group_by(sensor_1,pm25_bin) %>%
summarise(mean = mean(mean_pm25, na.rm = TRUE), sd = sd(mean_pm25, na.rm = TRUE), count = n()) %>%
mutate(ratio = mean/sd)
```