df<-read.csv("Eira2.csv")

Análisis de ANOVA

df$Productor<-factor(df$Productor)
df$Conc<-as.numeric(df$Conc)
df$Lugar<-factor(df$Lugar)
modelo<-aov(Conc~Lugar,data=df)
summary(modelo)
##             Df  Sum Sq Mean Sq F value Pr(>F)
## Lugar        1   32080   32080   0.872  0.356
## Residuals   41 1508710   36798

El valor de p=0.356 indica que no hay diferencias significativas en la concentración de ciproconazol entre los dos sitios de muestreo

library("tidyverse")
## -- Attaching packages --------------------------------------- tidyverse 1.3.1 --
## v ggplot2 3.3.5     v purrr   0.3.4
## v tibble  3.1.5     v dplyr   1.0.7
## v tidyr   1.1.4     v stringr 1.4.0
## v readr   2.0.2     v forcats 0.5.1
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
df2<-df %>% filter(Lugar=="BOQ")
df3<-df %>% filter(Lugar=="REN")
BoqData<-cut(df2$Conc,breaks=c(0,10,20,30,40,50,Inf),labels=c('0-10','10-20','20-30','30-40','40-50','1000-1300'),include.lowest =TRUE)
RenData<-cut(df3$Conc,breaks=c(0,10,20,30,40,50,Inf),labels=c('0-10','10-20','20-30','30-40','40-50','1000-1300'),include.lowest =TRUE)

Gráficas de la distribución de niveles de ciproconazol en granos de café por lugar de muestreo

library(ggplot2)
ggplot(data = as_tibble(RenData), mapping = aes(x=value)) + 
  geom_bar(fill="bisque",color="gray",alpha=1.0) + 
  stat_count(geom="text", aes(label=sprintf("%d",..count..)), vjust=-0.5) +
  labs(x='[Ciproconazol] ug/Kg',y='Número de Muestras') +
  theme_minimal() +ylim(0, 25)+geom_text(x=3, y=25,size=6, label="Renacimiento")

ggplot(data = as_tibble(BoqData), mapping = aes(x=value)) + 
  geom_bar(fill="bisque",color="gray",alpha=1.0) + 
  stat_count(geom="text", aes(label=sprintf("%d",..count..)), vjust=-0.5) +
  labs(x='[Ciproconazol] ug/Kg',y='Número de Muestras') +
  theme_minimal() +ylim(0, 25)+geom_text(x=2, y=25,size=6, label="Boquete")

muestras<-read.csv("Muestras.csv")
patrones<-read.csv("Patrones.csv")

Tabla de Datos de las curvas de calibración

knitr::kable(patrones, align = "lcccccccccc")
Conc Acetamiprid Acetoclor Aflatoxina.B1 AflatoxinaB2 AfratoxinaG1 Chloropiryfos Clotiadinina Cyproconazole Epoxyconazole Tiametoxan
0.50 870.9915 273.6039 384.8337 252.6643 0.000 147.8100 809.6255 7889.055 4436.050 1006.343
1.25 5243.8585 937.5786 1147.3751 675.9481 1234.315 117.3181 3485.7145 13812.877 8861.828 5489.108
2.50 5922.0192 2027.5003 1431.5289 1018.3362 1007.463 230.0323 4355.3209 20117.084 14589.111 8293.662
6.25 12422.5596 3683.9771 5982.4089 3764.5481 3923.536 446.3122 7275.4259 41361.157 30216.895 15411.588
10.00 18830.4849 6537.8212 11629.9570 7164.2837 8116.239 521.2114 10983.4070 56888.241 46417.955 23054.710

Curva de Calibración del ciproconazol

y<-patrones$Cyproconazole
x<-patrones$Conc

datos<-muestras$Cyproconazole

modelo<-lm(y~x)
s<-summary(modelo)
LOD<-s$coefficients[1,2]/s$coefficients[1]*3.3*8
b0=s$coefficients[1]
b1=s$coefficients[2]

yexp=modelo$fitted.values

Sxy=sqrt((sum(y*y)-b0*sum(y)-b1*sum(x*y))/(length(x)-2))

print(s)
## 
## Call:
## lm(formula = y ~ x)
## 
## Residuals:
##       1       2       3       4       5 
## -1597.4   466.6   337.7  2282.6 -1489.5 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   6913.2     1266.3   5.459 0.012077 *  
## x             5146.5      233.4  22.045 0.000204 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1854 on 3 degrees of freedom
## Multiple R-squared:  0.9939, Adjusted R-squared:  0.9918 
## F-statistic:   486 on 1 and 3 DF,  p-value: 0.0002043
n=length(x)
SE=sqrt(sum((y-yexp)**2)/(n-2))
print("LOD:")
## [1] "LOD:"
print(SE/modelo$coefficients[2]*3.3*8)
##       x 
## 9.51074
t<-qt(0.975,3)
IC1<-yexp+t*Sxy*sqrt(1/n+(x-mean(x))**2/sum((x-mean(x))**2))
IC2<-yexp-t*Sxy*sqrt(1/n+(x-mean(x))**2/sum((x-mean(x))**2))
plot(x,y,main="Curva de calibración del ciproconazol",xlab="[Ciproconazol](ug/Kg)",ylab="Señal")
lines(x,yexp,lty=1)
lines(x,IC1,lty=2)
lines(x,IC2,lty=2)

Curva de Calibración del epoxiconazol

y<-patrones$Epoxyconazole
x<-patrones$Conc

modelo<-lm(y~x)
s<-summary(modelo)
LOD<-s$coefficients[1,2]/s$coefficients[1]*3.3*8
b0=s$coefficients[1]
b1=s$coefficients[2]

yexp=modelo$fitted.values

Sxy=sqrt((sum(y*y)-b0*sum(y)-b1*sum(x*y))/(length(x)-2))

print(s)
## 
## Call:
## lm(formula = y ~ x)
## 
## Residuals:
##       1       2       3       4       5 
## -814.74  349.87  641.89  -36.14 -140.88 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  3076.68     435.45   7.065  0.00583 ** 
## x            4348.22      80.28  54.166 1.39e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 637.5 on 3 degrees of freedom
## Multiple R-squared:  0.999,  Adjusted R-squared:  0.9986 
## F-statistic:  2934 on 1 and 3 DF,  p-value: 1.386e-05
n=length(x)
SE=sqrt(sum((y-yexp)**2)/(n-2))
print("LOD:")
## [1] "LOD:"
print(SE/modelo$coefficients[2]*3.3*8)
##        x 
## 3.870826
t<-qt(0.975,3)
IC1<-yexp+t*Sxy*sqrt(1/n+(x-mean(x))**2/sum((x-mean(x))**2))
IC2<-yexp-t*Sxy*sqrt(1/n+(x-mean(x))**2/sum((x-mean(x))**2))
plot(x,y,main="Curva de calibración del epoxiconazol",xlab="[Epoxiconazol](ug/Kg)",ylab="Señal")
lines(x,yexp,lty=1)
lines(x,IC1,lty=2)
lines(x,IC2,lty=2)

Curva de Calibración del clotiadinina

y<-patrones$Clotiadinina
x<-patrones$Conc

modelo<-lm(y~x)
s<-summary(modelo)
LOD<-s$coefficients[1,2]/s$coefficients[1]*3.3*8
b0=s$coefficients[1]
b1=s$coefficients[2]

yexp=modelo$fitted.values

Sxy=sqrt((sum(y*y)-b0*sum(y)-b1*sum(x*y))/(length(x)-2))

print(s)
## 
## Call:
## lm(formula = y ~ x)
## 
## Residuals:
##        1        2        3        4        5 
## -1112.00   843.20   511.32  -173.02   -69.49 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)   
## (Intercept)   1441.0      590.7   2.440  0.09253 . 
## x              961.2      108.9   8.827  0.00306 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 864.8 on 3 degrees of freedom
## Multiple R-squared:  0.9629, Adjusted R-squared:  0.9506 
## F-statistic: 77.91 on 1 and 3 DF,  p-value: 0.003064
n=length(x)
SE=sqrt(sum((y-yexp)**2)/(n-2))
print("LOD:")
## [1] "LOD:"
print(SE/modelo$coefficients[2]*3.3*8)
##        x 
## 23.75322
t<-qt(0.975,3)
IC1<-yexp+t*Sxy*sqrt(1/n+(x-mean(x))**2/sum((x-mean(x))**2))
IC2<-yexp-t*Sxy*sqrt(1/n+(x-mean(x))**2/sum((x-mean(x))**2))
plot(x,y,main="Curva de calibración del clotadinina",xlab="[Clotadinina](ug/Kg)",ylab="Señal")
lines(x,yexp,lty=1)
lines(x,IC1,lty=2)
lines(x,IC2,lty=2)

Curva de Calibración del tiametoxan

y<-patrones$Tiametoxan
x<-patrones$Conc

modelo<-lm(y~x)
s<-summary(modelo)
LOD<-s$coefficients[1,2]/s$coefficients[1]*3.3*8
b0=s$coefficients[1]
b1=s$coefficients[2]

yexp=modelo$fitted.values

Sxy=sqrt((sum(y*y)-b0*sum(y)-b1*sum(x*y))/(length(x)-2))

print(s)
## 
## Call:
## lm(formula = y ~ x)
## 
## Residuals:
##       1       2       3       4       5 
## -1847.1  1011.2  1108.2   103.6  -375.8 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)   
## (Intercept)   1770.4      950.9   1.862  0.15952   
## x             2166.0      175.3  12.357  0.00114 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1392 on 3 degrees of freedom
## Multiple R-squared:  0.9807, Adjusted R-squared:  0.9743 
## F-statistic: 152.7 on 1 and 3 DF,  p-value: 0.001142
n=length(x)
SE=sqrt(sum((y-yexp)**2)/(n-2))
print("LOD:")
## [1] "LOD:"
print(SE/modelo$coefficients[2]*3.3*8)
##        x 
## 16.96804
t<-qt(0.975,3)
IC1<-yexp+t*Sxy*sqrt(1/n+(x-mean(x))**2/sum((x-mean(x))**2))
IC2<-yexp-t*Sxy*sqrt(1/n+(x-mean(x))**2/sum((x-mean(x))**2))
plot(x,y,main="Curva de calibración del tiametoxan",xlab="[Tiametoxan](ug/Kg)",ylab="Señal")
lines(x,yexp,lty=1)
lines(x,IC1,lty=2)
lines(x,IC2,lty=2)