library(readxl)
almidondbca <- read_excel("almidondbca.xlsx")
almidondbca
## # A tibble: 16 x 3
##    temperatura día   rend_almidon
##    <chr>       <chr>        <dbl>
##  1 T30         D1            14.4
##  2 T35         D1            13.9
##  3 T40         D1            14.1
##  4 T45         D1            13  
##  5 T30         D2            14.1
##  6 T35         D2            13.8
##  7 T40         D2            14.2
##  8 T45         D2            13.1
##  9 T30         D3            14.5
## 10 T35         D3            14.2
## 11 T40         D3            14.4
## 12 T45         D3            13.5
## 13 T30         D4            14  
## 14 T35         D4            14  
## 15 T40         D4            13.9
## 16 T45         D4            13.2
attach(almidondbca)
temperatura <- as.factor(temperatura)
summary (temperatura)
## T30 T35 T40 T45 
##   4   4   4   4

tratamientos

library(ggplot2)
ggplot(almidondbca, aes(x =temperatura, y = rend_almidon)) +
  geom_boxplot(fill = "grey80", colour = "blue") +
  scale_x_discrete() + xlab("Temperatura") +
  ylab("Almidón_gr")

### bloques

ggplot(almidondbca, aes(x = día, y = rend_almidon)) +
  geom_boxplot(fill = "grey80", colour = "blue") +
  scale_x_discrete() + xlab("Dia") +
  ylab("rend_almidon")

supuestos
anova.almidondbca = aov(rend_almidon ~ temperatura + día,
                 data=almidondbca)
summary(anova.almidondbca)
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## temperatura  3 2.7219  0.9073  49.302 6.55e-06 ***
## día          3 0.3619  0.1206   6.555   0.0121 *  
## Residuals    9 0.1656  0.0184                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Normalidad en base a residuales

si p.valor > 0,05 se cumple supuesto Con base en la prueba Shapiro wilk se cumple el supuesto

e<-anova.almidondbca$residuals ##### residuales
shapiro.test(e) #### Normalidad
## 
##  Shapiro-Wilk normality test
## 
## data:  e
## W = 0.9371, p-value = 0.3149
hist(e, freq=FALSE)
curve(dnorm(x,mean(e), sd(e)), xlim=c(-0.7,0.7), add=TRUE, col=2)

#### homogeneidad

library(carData)
library(car)

leveneTest(e ~ as.factor(temperatura), data = almidondbca, center = "median") 
## Levene's Test for Homogeneity of Variance (center = "median")
##       Df F value Pr(>F)
## group  3  0.1527  0.926
##       12

Anova DBCA

library(carData)
library(car)

analisis post anova

PRUEBA LSD

library(agricolae) #### PAQUETE DE PRUEBAS POST-ANOVA

LSD.test(anova.almidondbca,"temperatura",console=TRUE)
## 
## Study: anova.almidondbca ~ "temperatura"
## 
## LSD t Test for rend_almidon 
## 
## Mean Square Error:  0.01840278 
## 
## temperatura,  means and individual ( 95 %) CI
## 
##     rend_almidon       std r      LCL      UCL  Min  Max
## T30       14.250 0.2380476 4 14.09656 14.40344 14.0 14.5
## T35       13.975 0.1707825 4 13.82156 14.12844 13.8 14.2
## T40       14.150 0.2081666 4 13.99656 14.30344 13.9 14.4
## T45       13.200 0.2160247 4 13.04656 13.35344 13.0 13.5
## 
## Alpha: 0.05 ; DF Error: 9
## Critical Value of t: 2.262157 
## 
## least Significant Difference: 0.2169949 
## 
## Treatments with the same letter are not significantly different.
## 
##     rend_almidon groups
## T30       14.250      a
## T40       14.150     ab
## T35       13.975      b
## T45       13.200      c

PRUEBA POST ANOVA

library(agricolae)
LSD.test(anova.almidondbca, "temperatura",p.adj= "bon",console=TRUE)
## 
## Study: anova.almidondbca ~ "temperatura"
## 
## LSD t Test for rend_almidon 
## P value adjustment method: bonferroni 
## 
## Mean Square Error:  0.01840278 
## 
## temperatura,  means and individual ( 95 %) CI
## 
##     rend_almidon       std r      LCL      UCL  Min  Max
## T30       14.250 0.2380476 4 14.09656 14.40344 14.0 14.5
## T35       13.975 0.1707825 4 13.82156 14.12844 13.8 14.2
## T40       14.150 0.2081666 4 13.99656 14.30344 13.9 14.4
## T45       13.200 0.2160247 4 13.04656 13.35344 13.0 13.5
## 
## Alpha: 0.05 ; DF Error: 9
## Critical Value of t: 3.364203 
## 
## Minimum Significant Difference: 0.3227074 
## 
## Treatments with the same letter are not significantly different.
## 
##     rend_almidon groups
## T30       14.250      a
## T40       14.150      a
## T35       13.975      a
## T45       13.200      b