Experimento de deficit Hidrico em Tomate Micro Tom

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 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
library(readxl)
library(agricolae)
## 
## Attaching package: 'agricolae'
## The following objects are masked from 'package:PerformanceAnalytics':
## 
##     kurtosis, skewness
exp <- read_excel("C:/Users/User/Desktop/exp.xlsx", 
                  sheet = "expseca3")
attach(exp)
names(exp)
## [1] "vector"   "Planta"   "defh"     "Rept"     "numhojas" "areafol"  "folhas"  
## [8] "talo"     "raiz"
#View(exp)
attach(exp)
## The following objects are masked from exp (pos = 3):
## 
##     areafol, defh, folhas, numhojas, Planta, raiz, Rept, talo, vector
names(exp)
## [1] "vector"   "Planta"   "defh"     "Rept"     "numhojas" "areafol"  "folhas"  
## [8] "talo"     "raiz"
a <- as.factor(vector)
b <- as.factor(defh)
inter<-as.factor(a:b)

############ 1.1 anova numero de folhas  ###########################

summary(aov(numhojas ~ a+b+inter, data = exp))
##              Df Sum Sq Mean Sq F value   Pr(>F)    
## a             3 115.58   38.53  13.127 2.36e-07 ***
## b             2  56.01   28.00   9.542 0.000155 ***
## inter         6  16.09    2.68   0.914 0.488120    
## Residuals   106 311.10    2.93                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 2 observations deleted due to missingness
LSD.test(aov(numhojas ~ a + b + inter, data = exp),
         "a", alpha = 0.05)["groups"]
## $groups
##     numhojas groups
## VØ 11.000000      a
## VF 10.733333      a
## MT 10.266667      a
## VG  8.466667      b
LSD.test(aov(numhojas ~ a + b + inter, data = exp),
         "b", alpha = 0.05)["groups"]
## $groups
##     numhojas groups
## 100 10.94737      a
## 60  10.10000      b
## 30   9.30000      c
LSD.test(aov(numhojas ~ a + b + inter, data = exp),
         "inter", alpha = 0.05)["groups"]
## $groups
##        numhojas groups
## VØ:100    12.25      a
## VF:100    11.60     ab
## VØ:60     11.00    abc
## MT:100    10.80   abcd
## VF:30     10.40   bcde
## MT:60     10.20   bcde
## VF:60     10.20   bcde
## VØ:30     10.00    cde
## MT:30      9.80    cde
## VG:100     9.40     de
## VG:60      9.00      e
## VG:30      7.00      f
shapiro.test(unlist(aov(numhojas ~ a + b + inter, 
                        data = exp)["residuals"]))
## 
##  Shapiro-Wilk normality test
## 
## data:  unlist(aov(numhojas ~ a + b + inter, data = exp)["residuals"])
## W = 0.96688, p-value = 0.005197
res <-sort(unlist(aov( numhojas ~ a + b + inter, 
                       data = exp)["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.10303, p-value = 0.1632
## alternative hypothesis: two-sided
kruskal(numhojas, inter)["groups"]
## $groups
##        numhojas groups
## VØ:100     91.0      a
## VF:100     84.5     ab
## VØ:60      74.1    abc
## MT:100     72.9    abc
## VF:30      64.7   abcd
## MT:60      60.9    bcd
## VF:60      60.1    bcd
## VØ:30      57.7     cd
## MT:30      52.7     cd
## VG:100     46.7      d
## VG:60      39.1     de
## VG:30      15.9      e
############ 1.1 anova area foliar  ###########################

summary(aov(areafol ~ a+b+inter, data = exp))
##              Df Sum Sq Mean Sq F value   Pr(>F)    
## a             3  39929   13310  23.694 8.19e-12 ***
## b             2  12408    6204  11.044 4.40e-05 ***
## inter         6  12083    2014   3.585  0.00283 ** 
## Residuals   106  59544     562                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 2 observations deleted due to missingness
LSD.test(aov(areafol ~ a + b + inter, data = exp),
         "a", alpha = 0.05)["groups"]
## $groups
##      areafol groups
## MT 127.21200      a
## VØ 112.36714      b
## VF  88.59267      c
## VG  81.61467      c
LSD.test(aov(areafol ~ a + b + inter, data = exp),
         "b", alpha = 0.05)["groups"]
## $groups
##      areafol groups
## 100 113.2768      a
## 60  105.0940      a
## 30   89.0145      b
LSD.test(aov(areafol ~ a + b + inter, data = exp),
         "inter", alpha = 0.05)["groups"]
## $groups
##        areafol groups
## VØ:100 141.080      a
## MT:100 140.616      a
## MT:60  126.520     ab
## MT:30  114.500     bc
## VØ:60  108.070    bcd
## VG:100  98.796    cde
## VF:60   97.906    cde
## VØ:30   93.694    cde
## VF:30   89.696     de
## VG:60   87.880     de
## VF:100  78.176     ef
## VG:30   58.168      f
shapiro.test(unlist(aov(areafol ~ a + b + inter, 
                        data = exp)["residuals"]))
## 
##  Shapiro-Wilk normality test
## 
## data:  unlist(aov(areafol ~ a + b + inter, data = exp)["residuals"])
## W = 0.96821, p-value = 0.006743
res <-sort(unlist(aov( areafol ~ a + b + inter, 
                       data = exp)["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.093228, p-value = 0.2566
## alternative hypothesis: two-sided
kruskal(areafol, inter)["groups"]
## $groups
##        areafol groups
## MT:100    99.1      a
## VØ:100    98.5      a
## MT:60     87.5     ab
## MT:30     73.1     bc
## VØ:60     63.1     cd
## VG:100    54.7    cde
## VF:60     53.5    cde
## VØ:30     48.3     de
## VF:30     44.3    def
## VG:60     41.5    def
## VF:100    35.9     ef
## VG:30     22.3      f
############ 1.1 anova Biomassa de folhas###########################
summary(aov(folhas ~ a+b+inter, data = exp))
##              Df Sum Sq Mean Sq F value   Pr(>F)    
## a             3 0.8323 0.27743  23.599 8.91e-12 ***
## b             2 0.2102 0.10511   8.941 0.000258 ***
## inter         6 0.1265 0.02109   1.794 0.107248    
## Residuals   106 1.2461 0.01176                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 2 observations deleted due to missingness
LSD.test(aov(folhas ~ a + b + inter, data = exp),
         "a", alpha = 0.05)["groups"]
## $groups
##       folhas groups
## MT 0.4486667      a
## VØ 0.3943333      a
## VF 0.2935714      b
## VG 0.2350000      c
LSD.test(aov(folhas ~ a + b + inter, data = exp),
         "b", alpha = 0.05)["groups"]
## $groups
##        folhas groups
## 100 0.4002564      a
## 60  0.3351282      b
## 30  0.2970000      b
LSD.test(aov(folhas ~ a + b + inter, data = exp),
         "inter", alpha = 0.05)["groups"]
## $groups
##           folhas groups
## MT:100 0.5370000      a
## VØ:100 0.4830000      a
## MT:60  0.4700000      a
## VØ:30  0.3510000      b
## VØ:60  0.3490000      b
## MT:30  0.3390000      b
## VF:100 0.3144444     bc
## VF:30  0.2850000    bcd
## VF:60  0.2822222    bcd
## VG:100 0.2580000    bcd
## VG:60  0.2340000     cd
## VG:30  0.2130000      d
shapiro.test(unlist(aov(folhas ~ a + b + inter, 
                        data = exp)["residuals"]))
## 
##  Shapiro-Wilk normality test
## 
## data:  unlist(aov(folhas ~ a + b + inter, data = exp)["residuals"])
## W = 0.98832, p-value = 0.4092
res <-sort(unlist(aov( folhas ~ a + b + inter, 
                       data = exp)["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.055135, p-value = 0.8657
## alternative hypothesis: two-sided
kruskal(folhas, inter)["groups"]
## $groups
##           folhas groups
## MT:100 102.80000      a
## MT:60   94.45000      a
## VØ:100  93.00000      a
## VØ:30   61.80000      b
## MT:30   61.20000      b
## VØ:60   60.20000      b
## VF:100  50.11111     bc
## VF:60   42.83333    bcd
## VG:100  42.65000    bcd
## VF:30   39.35000    bcd
## VG:60   36.90000     cd
## VG:30   26.10000      d
############ 1.1 anova Biomassa de talo ###########################
summary(aov(talo ~ a+b+inter, data = exp))
##              Df Sum Sq Mean Sq F value   Pr(>F)    
## a             3 0.4569 0.15230  13.572 1.41e-07 ***
## b             2 0.1514 0.07569   6.745  0.00174 ** 
## inter         6 0.0542 0.00903   0.805  0.56806    
## Residuals   108 1.2119 0.01122                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
LSD.test(aov(talo ~ a + b + inter, data = exp),
         "a", alpha = 0.05)["groups"]
## $groups
##         talo groups
## MT 0.3253333      a
## VØ 0.2850000     ab
## VF 0.2486667      b
## VG 0.1583333      c
LSD.test(aov(talo ~ a + b + inter, data = exp),
         "b", alpha = 0.05)["groups"]
## $groups
##        talo groups
## 100 0.30325      a
## 60  0.23975      b
## 30  0.22000      b
LSD.test(aov(talo ~ a + b + inter, data = exp),
         "inter", alpha = 0.05)["groups"]
## $groups
##         talo groups
## MT:100 0.395      a
## VØ:100 0.348     ab
## MT:60  0.308    abc
## VØ:60  0.293    bcd
## VF:100 0.281   bcde
## MT:30  0.273   bcde
## VF:30  0.250    cde
## VF:60  0.215   cdef
## VØ:30  0.214    def
## VG:100 0.189     ef
## VG:30  0.143      f
## VG:60  0.143      f
shapiro.test(unlist(aov(talo ~ a + b + inter, 
                        data = exp)["residuals"]))
## 
##  Shapiro-Wilk normality test
## 
## data:  unlist(aov(talo ~ a + b + inter, data = exp)["residuals"])
## W = 0.98271, p-value = 0.1271
res <-sort(unlist(aov( talo ~ a + b + inter, 
                       data = exp)["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.092268, p-value = 0.2587
## alternative hypothesis: two-sided
kruskal(talo, inter)["groups"]
## $groups
##         talo groups
## MT:100 99.10      a
## VØ:100 81.15     ab
## MT:60  78.05     ab
## VØ:60  71.85     bc
## VF:100 69.80    bcd
## MT:30  66.25    bcd
## VF:30  59.25    bcd
## VF:60  49.95    cde
## VØ:30  49.85    cde
## VG:100 44.15     de
## VG:60  29.30      e
## VG:30  27.30      e
############ 1.1 anova Biomassa de raiz###########################
summary(aov(raiz ~ a+b+inter, data = exp))
##              Df  Sum Sq Mean Sq F value   Pr(>F)    
## a             3 0.09618 0.03206  16.855 4.73e-09 ***
## b             2 0.00585 0.00293   1.538    0.219    
## inter         6 0.01100 0.00183   0.963    0.454    
## Residuals   108 0.20543 0.00190                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
LSD.test(aov(raiz ~ a + b + inter, data = exp),
         "a", alpha = 0.05)["groups"]
## $groups
##          raiz groups
## MT 0.15033333      a
## VØ 0.12566667      b
## VF 0.09533333      c
## VG 0.07633333      c
LSD.test(aov(raiz ~ a + b + inter, data = exp),
         "b", alpha = 0.05)["groups"]
## $groups
##        raiz groups
## 100 0.11850      a
## 60  0.11500      a
## 30  0.10225      a
LSD.test(aov(raiz ~ a + b + inter, data = exp),
         "inter", alpha = 0.05)["groups"]
## $groups
##         raiz groups
## MT:100 0.157      a
## MT:60  0.156      a
## VØ:100 0.144     ab
## MT:30  0.138     ab
## VØ:60  0.134    abc
## VF:30  0.106    bcd
## VØ:30  0.099    cde
## VF:100 0.092     de
## VF:60  0.088     de
## VG:60  0.082     de
## VG:100 0.081     de
## VG:30  0.066      e
shapiro.test(unlist(aov(raiz ~ a + b + inter, 
                        data = exp)["residuals"]))
## 
##  Shapiro-Wilk normality test
## 
## data:  unlist(aov(raiz ~ a + b + inter, data = exp)["residuals"])
## W = 0.96206, p-value = 0.001859
res <-sort(unlist(aov( raiz ~ a + b + inter, 
                       data = exp)["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.10303, p-value = 0.1565
## alternative hypothesis: two-sided
kruskal(raiz, inter)["groups"]
## $groups
##         raiz groups
## MT:60  95.00      a
## MT:100 94.55      a
## VØ:100 84.00      a
## MT:30  82.05      a
## VØ:60  71.30     ab
## VF:30  53.80     bc
## VØ:30  51.30    bcd
## VF:100 43.65     cd
## VF:60  42.35     cd
## VG:60  41.95     cd
## VG:100 38.00     cd
## VG:30  28.05      d
########## Anova CLOROFILA EXPERIMENTOS 2-3##############

exp <- read_excel("C:/Users/User/Desktop/exp.xlsx", 
                  sheet = "clor2")
#View(exp)
attach(exp)
names(exp)
## [1] "genot"    "cc"       "rep"      "clora2"   "clorb2"   "clortot2"
a <- as.factor(genot)
b <- as.factor(cc)
inter<-as.factor(a:b)
############ 1.1 anova Clorofila A2 ###########################

summary(aov(clora2 ~ a+b+inter, data = exp))
##             Df Sum Sq Mean Sq F value  Pr(>F)   
## a            3  336.2  112.06   4.406 0.00833 **
## b            2    0.9    0.46   0.018 0.98208   
## inter        6  203.8   33.97   1.336 0.26094   
## Residuals   46 1170.0   25.43                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 2 observations deleted due to missingness
LSD.test(aov(clora2 ~ a + b + inter, data = exp),
         "a", alpha = 0.05)["groups"]
## $groups
##      clora2 groups
## VF 38.91333      a
## VA 37.50000      a
## MT 36.20667     ab
## VG 32.51333      b
LSD.test(aov(clora2 ~ a + b + inter, data = exp),
         "b", alpha = 0.05)["groups"]
## $groups
##       clora2 groups
## 60  36.38000      a
## 100 36.23333      a
## 30  36.11000      a
LSD.test(aov(clora2 ~ a + b + inter, data = exp),
         "inter", alpha = 0.05)["groups"]
## $groups
##          clora2 groups
## VA:60  41.26000      a
## VF:30  40.82000     ab
## VF:100 38.88000    abc
## MT:100 37.96000    abc
## VF:60  37.04000   abcd
## MT:60  36.16000   abcd
## VA:30  35.94000   abcd
## MT:30  34.50000    bcd
## VA:100 33.83333    bcd
## VG:100 33.30000     cd
## VG:30  33.18000     cd
## VG:60  31.06000      d
shapiro.test(unlist(aov(clora2 ~ a + b + inter, 
                        data = exp)["residuals"]))
## 
##  Shapiro-Wilk normality test
## 
## data:  unlist(aov(clora2 ~ a + b + inter, data = exp)["residuals"])
## W = 0.97854, p-value = 0.3924
res <-sort(unlist(aov( clora2 ~ a + b + inter, 
                       data = exp)["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.068384, p-value = 0.9491
## alternative hypothesis: two-sided
kruskal(clora2, inter)["groups"]
## $groups
##          clora2 groups
## VA:60  45.40000      a
## VF:30  45.30000      a
## VF:100 36.70000     ab
## MT:100 35.10000     ab
## VA:30  29.80000    abc
## VF:60  29.50000    abc
## MT:60  27.60000    abc
## MT:30  27.40000    abc
## VG:30  20.60000     bc
## VA:100 19.33333     bc
## VG:100 18.20000     bc
## VG:60  15.00000      c
############ 1.2 anova Clorofila B2 ###########################

summary(aov(clorb2 ~ a+b+inter, data = exp))
##             Df Sum Sq Mean Sq F value  Pr(>F)   
## a            3  184.6   61.52   4.290 0.00944 **
## b            2    1.4    0.68   0.047 0.95406   
## inter        6  102.2   17.03   1.188 0.32965   
## Residuals   46  659.6   14.34                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 2 observations deleted due to missingness
LSD.test(aov(clorb2 ~ a + b + inter, data = exp),
         "a", alpha = 0.05)["groups"]
## $groups
##      clorb2 groups
## VA 15.56923      a
## VF 15.18667      a
## MT 14.96667      a
## VG 11.18000      b
LSD.test(aov(clorb2 ~ a + b + inter, data = exp),
         "b", alpha = 0.05)["groups"]
## $groups
##       clorb2 groups
## 30  14.43500      a
## 60  14.10000      a
## 100 13.98333      a
LSD.test(aov(clorb2 ~ a + b + inter, data = exp),
         "inter", alpha = 0.05)["groups"]
## $groups
##          clorb2 groups
## VA:60  17.34000      a
## VF:30  16.96000     ab
## VF:100 16.04000     ab
## MT:100 15.70000    abc
## MT:60  15.34000    abc
## VA:30  14.52000   abcd
## VA:100 14.36667   abcd
## MT:30  13.86000   abcd
## VF:60  12.56000   abcd
## VG:30  12.40000    bcd
## VG:60  11.16000     cd
## VG:100  9.98000      d
shapiro.test(unlist(aov(clorb2 ~ a + b + inter, 
                        data = exp)["residuals"]))
## 
##  Shapiro-Wilk normality test
## 
## data:  unlist(aov(clorb2 ~ a + b + inter, data = exp)["residuals"])
## W = 0.96355, p-value = 0.07887
res <-sort(unlist(aov( clorb2 ~ a + b + inter, 
                       data = exp)["residuals"]),decreasing = TRUE)
ks.test(res,  "pnorm" ,mean(res),sd(res))
## 
##  One-sample Kolmogorov-Smirnov test
## 
## data:  res
## D = 0.08704, p-value = 0.7388
## alternative hypothesis: two-sided
kruskal(clorb2, inter)["groups"]
## $groups
##        clorb2 groups
## VA:60    44.2      a
## VF:30    41.7     ab
## VF:100   37.1    abc
## MT:60    35.5    abc
## MT:100   34.8   abcd
## VA:30    29.7   abcd
## VA:100   27.0   abcd
## MT:30    25.2   abcd
## VF:60    23.9    bcd
## VG:30    21.1     cd
## VG:60    17.6     cd
## VG:100   15.2      d
############ 1.2 anova Clorofila total2 ###########################

summary(aov(clortot2 ~ a+b+inter, data = exp))
##             Df Sum Sq Mean Sq F value Pr(>F)  
## a            3   1015   338.3   2.721 0.0547 .
## b            2    377   188.5   1.516 0.2299  
## inter        6   2248   374.6   3.013 0.0140 *
## Residuals   48   5969   124.3                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
LSD.test(aov(clortot2 ~ a + b + inter, data = exp),
         "a", alpha = 0.05)["groups"]
## $groups
##    clortot2 groups
## VF 54.10000      a
## MT 51.17333     ab
## VA 45.99333     ab
## VG 43.69333      b
LSD.test(aov(clortot2 ~ a + b + inter, data = exp),
         "b", alpha = 0.05)["groups"]
## $groups
##     clortot2 groups
## 30    50.545      a
## 60    50.480      a
## 100   45.195      a
LSD.test(aov(clortot2 ~ a + b + inter, data = exp),
         "inter", alpha = 0.05)["groups"]
## $groups
##        clortot2 groups
## VA:60     58.60      a
## VF:30     57.78      a
## VF:100    54.92     ab
## MT:100    53.66     ab
## MT:60     51.50     ab
## VA:30     50.46     ab
## VF:60     49.60     ab
## MT:30     48.36     ab
## VG:30     45.58     ab
## VG:100    43.28      b
## VG:60     42.22     bc
## VA:100    28.92      c
shapiro.test(unlist(aov(clortot2 ~ a + b + inter, 
                        data = exp)["residuals"]))
## 
##  Shapiro-Wilk normality test
## 
## data:  unlist(aov(clortot2 ~ a + b + inter, data = exp)["residuals"])
## W = 0.96518, p-value = 0.08453
res <-sort(unlist(aov( clortot2~ a + b + inter, 
                       data = exp)["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.081413, p-value = 0.8213
## alternative hypothesis: two-sided
kruskal(clortot2,inter)["groups"]
## $groups
##        clortot2 groups
## VA:60      47.2      a
## VF:30      45.6      a
## VF:100     38.8     ab
## MT:100     38.4     ab
## MT:60      33.7    abc
## VA:30      32.4    abc
## VF:60      28.2    abc
## MT:30      28.0    abc
## VG:30      23.2     bc
## VG:100     18.3      c
## VG:60      16.6      c
## VA:100     15.6      c
exp <- read_excel("C:/Users/User/Desktop/exp.xlsx", 
                  sheet = "clor3")
#View(exp)
attach(exp)
## The following objects are masked from exp (pos = 3):
## 
##     cc, genot, rep
names(exp)
## [1] "genot" "cc"    "rep"   "clora" "clorb" "clor"
a <- as.factor(genot)
b <- as.factor(cc)
inter<-as.factor(a:b)

############ 1.2 anova Clorofila A3 ###########################


summary(aov(clora ~ a+b+inter, data = exp))
##             Df Sum Sq Mean Sq F value Pr(>F)
## a            3    7.5    2.49   0.050  0.985
## b            2   48.8   24.42   0.487  0.617
## inter        6  246.5   41.08   0.820  0.560
## Residuals   48 2406.2   50.13
LSD.test(aov(clora ~ a + b + inter, data = exp),
         "a", alpha = 0.05)["groups"]
## $groups
##       clora groups
## VA 37.92667      a
## MT 37.69333      a
## VF 37.60667      a
## VG 36.97333      a
LSD.test(aov(clora ~ a + b + inter, data = exp),
         "b", alpha = 0.05)["groups"]
## $groups
##     clora groups
## 30  38.65      a
## 100 37.56      a
## 60  36.44      a
LSD.test(aov(clora ~ a + b + inter, data = exp),
         "inter", alpha = 0.05)["groups"]
## $groups
##        clora groups
## MT:100 40.36      a
## VA:60  39.66      a
## VF:30  39.36      a
## VA:30  39.30      a
## VF:100 39.22      a
## MT:30  39.02      a
## VG:60  38.16      a
## VG:30  36.92      a
## VG:100 35.84      a
## VA:100 34.82      a
## VF:60  34.24      a
## MT:60  33.70      a
shapiro.test(unlist(aov(clora ~ a + b + inter, 
                        data = exp)["residuals"]))
## 
##  Shapiro-Wilk normality test
## 
## data:  unlist(aov(clora ~ a + b + inter, data = exp)["residuals"])
## W = 0.81671, p-value = 3.613e-07
res <-sort(unlist(aov( clora ~ a + b + inter, 
                       data = exp)["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.18426, p-value = 0.03401
## alternative hypothesis: two-sided
kruskal(clora, inter)["groups"]
## $groups
##        clora groups
## VA:100  36.8      a
## MT:30   35.6      a
## VA:60   35.4      a
## VG:60   34.7      a
## VA:30   32.4      a
## VF:30   31.4      a
## MT:100  31.1      a
## MT:60   29.8      a
## VF:100  29.2      a
## VF:60   27.8      a
## VG:100  22.6      a
## VG:30   19.2      a
############ 1.2 anova Clorofila B3 ###########################

summary(aov(clorb ~ a+b+inter, data = exp))
##             Df Sum Sq Mean Sq F value Pr(>F)
## a            3   41.7  13.905   0.894  0.451
## b            2   12.9   6.469   0.416  0.662
## inter        6   85.0  14.174   0.911  0.495
## Residuals   48  746.9  15.561
LSD.test(aov(clorb ~ a + b + inter, data = exp),
         "a", alpha = 0.05)["groups"]
## $groups
##       clorb groups
## VA 17.12667      a
## VF 16.42667      a
## MT 15.91333      a
## VG 14.84000      a
LSD.test(aov(clorb ~ a + b + inter, data = exp),
         "b", alpha = 0.05)["groups"]
## $groups
##     clorb groups
## 60  16.56      a
## 30  16.22      a
## 100 15.45      a
LSD.test(aov(clorb ~ a + b + inter, data = exp),
         "inter", alpha = 0.05)["groups"]
## $groups
##        clorb groups
## VA:100 18.22      a
## MT:60  17.78      a
## VF:30  17.12     ab
## VF:100 16.92     ab
## VA:60  16.74     ab
## VG:60  16.48     ab
## VA:30  16.42     ab
## MT:30  15.68     ab
## VG:30  15.66     ab
## VF:60  15.24     ab
## MT:100 14.28     ab
## VG:100 12.38      b
shapiro.test(unlist(aov(clorb ~ a + b + inter, 
                        data = exp)["residuals"]))
## 
##  Shapiro-Wilk normality test
## 
## data:  unlist(aov(clorb ~ a + b + inter, data = exp)["residuals"])
## W = 0.8978, p-value = 0.0001095
res <-sort(unlist(aov( clorb ~ a + b + inter, 
                       data = exp)["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.13566, p-value = 0.2194
## alternative hypothesis: two-sided
kruskal(clorb, inter)["groups"]
## $groups
##        clorb groups
## VA:100  45.0      a
## MT:60   38.0     ab
## VG:60   34.5     ab
## VF:30   34.1     ab
## VF:100  33.0     ab
## VA:30   32.1     ab
## VA:60   31.6     ab
## MT:30   31.0     ab
## VF:60   25.5     ab
## VG:30   25.5     ab
## VG:100  19.4      b
## MT:100  16.3      b
############ 1.2 anova Clorofila total3 ###########################

summary(aov(clor ~ a+b+inter, data = exp))
##             Df Sum Sq Mean Sq F value Pr(>F)
## a            3     82   27.45   0.304  0.822
## b            2     46   23.19   0.257  0.775
## inter        6    282   47.06   0.521  0.790
## Residuals   48   4336   90.34
LSD.test(aov(clor ~ a + b + inter, data = exp),
         "a", alpha = 0.05)["groups"]
## $groups
##        clor groups
## VA 55.05333      a
## VF 54.03333      a
## MT 53.60667      a
## VG 51.81333      a
LSD.test(aov(clor ~ a + b + inter, data = exp),
         "b", alpha = 0.05)["groups"]
## $groups
##      clor groups
## 30  54.87      a
## 100 53.01      a
## 60  53.00      a
LSD.test(aov(clor ~ a + b + inter, data = exp),
         "inter", alpha = 0.05)["groups"]
## $groups
##         clor groups
## VF:30  56.48      a
## VA:60  56.40      a
## VF:100 56.14      a
## VA:30  55.72      a
## MT:30  54.70      a
## MT:100 54.64      a
## VG:60  54.64      a
## VA:100 53.04      a
## VG:30  52.58      a
## MT:60  51.48      a
## VF:60  49.48      a
## VG:100 48.22      a
shapiro.test(unlist(aov(clor ~ a + b + inter, 
                        data = exp)["residuals"]))
## 
##  Shapiro-Wilk normality test
## 
## data:  unlist(aov(clor ~ a + b + inter, data = exp)["residuals"])
## W = 0.86674, p-value = 9.859e-06
res <-sort(unlist(aov( clor~ a + b + inter, 
                       data = exp)["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.14964, p-value = 0.1361
## alternative hypothesis: two-sided
kruskal(clor,inter)["groups"]
## $groups
##        clor groups
## VG:60  37.7      a
## VA:100 35.7      a
## VF:30  34.6      a
## VA:30  33.6      a
## MT:30  33.5      a
## VA:60  32.5      a
## VF:100 31.1      a
## MT:60  30.2      a
## MT:100 28.1      a
## VF:60  25.9      a
## VG:30  22.2      a
## VG:100 20.9      a