Sclerotinia Sclerotiorum com outliers

library(readxl)
library(agricolae)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(PerformanceAnalytics)
## Loading required package: xts
## Loading required package: zoo
## 
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric
## 
## Attaching package: 'xts'
## The following objects are masked from 'package:dplyr':
## 
##     first, last
## 
## Attaching package: 'PerformanceAnalytics'
## The following objects are masked from 'package:agricolae':
## 
##     kurtosis, skewness
## The following object is masked from 'package:graphics':
## 
##     legend
library(plotly)
## Loading required package: ggplot2
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
library(tidyverse)
## -- Attaching packages --------------------------------------- tidyverse 1.3.0 --
## v tibble  3.0.4     v purrr   0.3.4
## v tidyr   1.1.2     v stringr 1.4.0
## v readr   1.4.0     v forcats 0.5.0
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x plotly::filter() masks dplyr::filter(), stats::filter()
## x xts::first()     masks dplyr::first()
## x dplyr::lag()     masks stats::lag()
## x xts::last()      masks dplyr::last()
library(reshape2)
## 
## Attaching package: 'reshape2'
## The following object is masked from 'package:tidyr':
## 
##     smiths
library(ggrepel)
library(rgl)
library(car)
## Loading required package: carData
## 
## Attaching package: 'car'
## The following object is masked from 'package:purrr':
## 
##     some
## The following object is masked from 'package:dplyr':
## 
##     recode
library(sf)
## Linking to GEOS 3.8.0, GDAL 3.0.4, PROJ 6.3.1
library(tmap)
library(rgdal)
## Loading required package: sp
## rgdal: version: 1.5-18, (SVN revision 1082)
## Geospatial Data Abstraction Library extensions to R successfully loaded
## Loaded GDAL runtime: GDAL 3.0.4, released 2020/01/28
## Path to GDAL shared files: C:/Users/User/Documents/R/win-library/4.0/rgdal/gdal
## GDAL binary built with GEOS: TRUE 
## Loaded PROJ runtime: Rel. 6.3.1, February 10th, 2020, [PJ_VERSION: 631]
## Path to PROJ shared files: C:/Users/User/Documents/R/win-library/4.0/rgdal/proj
## Linking to sp version:1.4-4
## To mute warnings of possible GDAL/OSR exportToProj4() degradation,
## use options("rgdal_show_exportToProj4_warnings"="none") before loading rgdal.
library(esquisse)
library(ggplot2)
library(gridExtra)
## 
## Attaching package: 'gridExtra'
## The following object is masked from 'package:dplyr':
## 
##     combine
dt <- read_excel("C:/Users/User/Desktop/Sclerotinia_Sclerotiorum.xlsx", 
                                       sheet = "re3")
attach(dt)
names(dt)
## [1] "genot"  "trat"   "bloco"  "folf"   "talf"   "folsec" "talsec" "rasec"
a <- as.factor(genot)
b <- as.factor(trat)
inter<-as.factor(a:b)


############ 1.1 anova folha fresca ###########################
summary(aov(folf ~ a+b+inter, data = dt))
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## a            4   32.1     8.0   1.709    0.174    
## b            1  761.0   761.0 162.084 1.25e-13 ***
## inter        4    9.5     2.4   0.508    0.730    
## Residuals   30  140.9     4.7                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
LSD.test(aov(folf ~ a + b + inter, data = dt),
         "a", alpha = 0.05)["groups"]
## $groups
##         folf groups
## MT   7.89000      a
## VF.1 6.16750     ab
## VG   5.68750     ab
## VA   5.53875      b
## VF   5.52000      b
LSD.test(aov(folf ~ a + b + inter, data = dt),
         "b", alpha = 0.05)["groups"]
## $groups
##           folf groups
## noinoc 10.5225      a
## ino     1.7990      b
LSD.test(aov(folf ~ a + b + inter, data = dt),
         "inter", alpha = 0.05)["groups"]
## $groups
##                folf groups
## MT:noinoc   13.0575      a
## VF.1:noinoc 10.6800     ab
## VG:noinoc    9.9775     ab
## VA:noinoc    9.7075      b
## VF:noinoc    9.1900      b
## MT:ino       2.7225      c
## VF:ino       1.8500      c
## VF.1:ino     1.6550      c
## VG:ino       1.3975      c
## VA:ino       1.3700      c
shapiro.test(unlist(aov(folf ~ a + b + inter, 
                              data = dt)["residuals"]))
## 
##  Shapiro-Wilk normality test
## 
## data:  unlist(aov(folf ~ a + b + inter, data = dt)["residuals"])
## W = 0.91788, p-value = 0.006611
res <-sort(unlist(aov( folf ~ a + b + inter, 
                         data = dt)["residuals"]),decreasing = TRUE)
ks.test(res,  "pnorm" ,mean(res),sd(res))
## 
##  One-sample Kolmogorov-Smirnov test
## 
## data:  res
## D = 0.15311, p-value = 0.2763
## alternative hypothesis: two-sided
kruskal(folf, inter)["groups"]
## $groups
##               folf groups
## MT:noinoc   34.000      a
## VF.1:noinoc 31.250      a
## VG:noinoc   30.500      a
## VA:noinoc   29.000      a
## VF:noinoc   27.750      a
## MT:ino      15.125      b
## VF:ino      12.250      b
## VF.1:ino     9.875      b
## VG:ino       8.250      b
## VA:ino       7.000      b
##### 1.2 anova talo fresco#########################################

summary(aov(talf ~ a+b+inter, data = dt))
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## a            4   67.6    16.9  13.149 2.66e-06 ***
## b            1  325.0   325.0 253.004 3.65e-16 ***
## inter        4   13.9     3.5   2.704   0.0491 *  
## Residuals   30   38.5     1.3                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
LSD.test(aov(talf ~ a + b + inter, data = dt),
         "a", alpha = 0.05)["groups"]
## $groups
##         talf groups
## MT   7.12250      a
## VF   5.62125      b
## VF.1 5.54000      b
## VA   4.12250      c
## VG   3.38250      c
LSD.test(aov(talf~ a + b + inter, data = dt),
         "b", alpha = 0.05)["groups"]
## $groups
##          talf groups
## noinoc 8.0080      a
## ino    2.3075      b
LSD.test(aov(talf ~ a + b + inter, data = dt),
         "inter", alpha = 0.05)["groups"]
## $groups
##                talf groups
## MT:noinoc   10.8150      a
## VF.1:noinoc  8.6050      b
## VF:noinoc    8.3550      b
## VA:noinoc    7.0150      b
## VG:noinoc    5.2500      c
## MT:ino       3.4300      d
## VF:ino       2.8875     de
## VF.1:ino     2.4750    def
## VG:ino       1.5150     ef
## VA:ino       1.2300      f
shapiro.test(unlist(aov(talf ~ a + b + inter, 
                        data = dt)["residuals"]))
## 
##  Shapiro-Wilk normality test
## 
## data:  unlist(aov(talf ~ a + b + inter, data = dt)["residuals"])
## W = 0.9805, p-value = 0.7082
res <-sort(unlist(aov( talf ~ a + b + inter, 
                       data = dt)["residuals"]),decreasing = TRUE)
ks.test(res,  "pnorm" ,mean(res),sd(res))
## 
##  One-sample Kolmogorov-Smirnov test
## 
## data:  res
## D = 0.094294, p-value = 0.8364
## alternative hypothesis: two-sided
kruskal(talf, inter)["groups"]
## $groups
##              talf groups
## MT:noinoc   37.50      a
## VF.1:noinoc 32.75     ab
## VF:noinoc   32.25     ab
## VA:noinoc   27.50     bc
## VG:noinoc   21.50     cd
## MT:ino      16.25     de
## VF:ino      14.00      e
## VF.1:ino    11.00     ef
## VG:ino       7.50     fg
## VA:ino       4.75      g
#######1.3 anova folhas secas #################################

summary(aov(folsec ~ a+b+inter, data = dt))
##             Df Sum Sq Mean Sq F value Pr(>F)  
## a            4 0.3634  0.0909   1.264 0.3057  
## b            1 0.4906  0.4906   6.828 0.0139 *
## inter        4 0.0590  0.0148   0.205 0.9334  
## Residuals   30 2.1556  0.0719                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
LSD.test(aov(folsec ~ a + b + inter, data = dt),
         "a", alpha = 0.05)["groups"]
## $groups
##       folsec groups
## MT   0.68125      a
## VF   0.61875      a
## VF.1 0.51750      a
## VA   0.46000      a
## VG   0.42875      a
LSD.test(aov(folsec ~ a + b + inter, data = dt),
         "b", alpha = 0.05)["groups"]
## $groups
##        folsec groups
## ino    0.6520      a
## noinoc 0.4305      b
LSD.test(aov(folsec ~ a + b + inter, data = dt),
         "inter", alpha = 0.05)["groups"]
## $groups
##             folsec groups
## MT:ino      0.8450      a
## VF:ino      0.7675     ab
## VF.1:ino    0.5825    abc
## VA:ino      0.5500    abc
## MT:noinoc   0.5175    abc
## VG:ino      0.5150    abc
## VF:noinoc   0.4700    abc
## VF.1:noinoc 0.4525     bc
## VA:noinoc   0.3700      c
## VG:noinoc   0.3425      c
shapiro.test(unlist(aov(folsec ~ a + b + inter, 
                        data = dt)["residuals"]))
## 
##  Shapiro-Wilk normality test
## 
## data:  unlist(aov(folsec ~ a + b + inter, data = dt)["residuals"])
## W = 0.95772, p-value = 0.1399
res <-sort(unlist(aov( folsec ~ a + b + inter, 
                       data = dt)["residuals"]),decreasing = TRUE)
ks.test(res,  "pnorm" ,mean(res),sd(res))
## 
##  One-sample Kolmogorov-Smirnov test
## 
## data:  res
## D = 0.095758, p-value = 0.8229
## alternative hypothesis: two-sided
kruskal(folsec, inter)["groups"]
## $groups
##             folsec groups
## MT:ino      31.375      a
## VF:ino      28.250      a
## VA:ino      22.250     ab
## MT:noinoc   22.125     ab
## VF.1:ino    21.500     ab
## VG:ino      21.250     ab
## VF:noinoc   18.500     ab
## VF.1:noinoc 17.250     ab
## VA:noinoc   11.875      b
## VG:noinoc   10.625      b
#######1.4 anova talo seco #################################

summary(aov(talsec ~ a+b+inter, data = dt))
##             Df Sum Sq  Mean Sq F value Pr(>F)
## a            4 0.0060 0.001500   0.238  0.915
## b            1 0.0162 0.016201   2.566  0.120
## inter        4 0.0097 0.002424   0.384  0.818
## Residuals   30 0.1894 0.006315
LSD.test(aov(talsec ~ a + b + inter, data = dt),
         "a", alpha = 0.05)["groups"]
## $groups
##         talsec groups
## MT   0.1712500      a
## VF   0.1574125      a
## VG   0.1485125      a
## VF.1 0.1390500      a
## VA   0.1387500      a
LSD.test(aov(talsec ~ a + b + inter, data = dt),
         "b", alpha = 0.05)["groups"]
## $groups
##         talsec groups
## ino    0.17112      a
## noinoc 0.13087      a
LSD.test(aov(talsec ~ a + b + inter, data = dt),
         "inter", alpha = 0.05)["groups"]
## $groups
##               talsec groups
## MT:ino      0.200000      a
## VF:ino      0.190475      a
## VA:ino      0.175000      a
## VG:ino      0.149525      a
## VG:noinoc   0.147500      a
## MT:noinoc   0.142500      a
## VF.1:ino    0.140600      a
## VF.1:noinoc 0.137500      a
## VF:noinoc   0.124350      a
## VA:noinoc   0.102500      a
shapiro.test(unlist(aov(talsec ~ a + b + inter, 
                        data = dt)["residuals"]))
## 
##  Shapiro-Wilk normality test
## 
## data:  unlist(aov(talsec ~ a + b + inter, data = dt)["residuals"])
## W = 0.97402, p-value = 0.4777
res <-sort(unlist(aov( talsec ~ a + b + inter, 
                       data = dt)["residuals"]),decreasing = TRUE)
ks.test(res,  "pnorm" ,mean(res),sd(res))
## 
##  One-sample Kolmogorov-Smirnov test
## 
## data:  res
## D = 0.06826, p-value = 0.9859
## alternative hypothesis: two-sided
kruskal(talsec, inter)["groups"]
## $groups
##             talsec groups
## MT:ino      28.500      a
## VF:ino      28.000      a
## VA:ino      24.625      a
## VG:ino      21.000      a
## VF.1:ino    20.500      a
## VG:noinoc   20.125      a
## MT:noinoc   19.000      a
## VF:noinoc   16.125      a
## VF.1:noinoc 14.750      a
## VA:noinoc   12.375      a
#######1.5 anova raiz seca #################################

summary(aov(rasec ~ a+b+inter, data = dt))
##             Df Sum Sq Mean Sq F value Pr(>F)  
## a            4  0.231  0.0577   0.464 0.7617  
## b            1  0.643  0.6426   5.169 0.0303 *
## inter        4  0.042  0.0104   0.084 0.9868  
## Residuals   30  3.729  0.1243                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
LSD.test(aov(rasec ~ a + b + inter, data = dt),
         "a", alpha = 0.05)["groups"]
## $groups
##        rasec groups
## MT   0.83500      a
## VF   0.73750      a
## VF.1 0.73125      a
## VG   0.63750      a
## VA   0.62750      a
LSD.test(aov(rasec ~ a + b + inter, data = dt),
         "b", alpha = 0.05)["groups"]
## $groups
##         rasec groups
## ino    0.8405      a
## noinoc 0.5870      b
LSD.test(aov(rasec ~ a + b + inter, data = dt),
         "inter", alpha = 0.05)["groups"]
## $groups
##              rasec groups
## MT:ino      0.9025      a
## VF.1:ino    0.8775      a
## VF:ino      0.8625      a
## VG:ino      0.8000      a
## MT:noinoc   0.7675      a
## VA:ino      0.7600      a
## VF:noinoc   0.6125      a
## VF.1:noinoc 0.5850      a
## VA:noinoc   0.4950      a
## VG:noinoc   0.4750      a
shapiro.test(unlist(aov(rasec ~ a + b + inter, 
                        data = dt)["residuals"]))
## 
##  Shapiro-Wilk normality test
## 
## data:  unlist(aov(rasec ~ a + b + inter, data = dt)["residuals"])
## W = 0.98013, p-value = 0.6943
res <-sort(unlist(aov( rasec ~ a + b + inter, 
                       data = dt)["residuals"]),decreasing = TRUE)
ks.test(res,  "pnorm" ,mean(res),sd(res))
## Warning in ks.test(res, "pnorm", mean(res), sd(res)): ties should not be present
## for the Kolmogorov-Smirnov test
## 
##  One-sample Kolmogorov-Smirnov test
## 
## data:  res
## D = 0.080428, p-value = 0.9581
## alternative hypothesis: two-sided
kruskal(rasec, inter)["groups"]
## $groups
##              rasec groups
## MT:ino      27.250      a
## VF.1:ino    24.625      a
## VF:ino      24.500      a
## MT:noinoc   23.000      a
## VA:ino      22.625      a
## VG:ino      22.625      a
## VF:noinoc   18.375      a
## VF.1:noinoc 16.000      a
## VG:noinoc   13.125      a
## VA:noinoc   12.875      a