Analysis of an experiment conducted in a randomized block design in a triple factorial scheme using analysis of variance of fixed effects.

FAT3DBC(
f1,
f2,
f3,
block,
response,
norm = "sw",
alpha.f = 0.05,
alpha.t = 0.05,
quali = c(TRUE, TRUE, TRUE),
mcomp = "tukey",
transf = 1,
constant = 0,
names.fat = c("F1", "F2", "F3"),
ylab = "Response",
xlab = "",
xlab.factor = c("F1", "F2", "F3"),
sup = NA,
grau = c(NA, NA, NA),
grau12 = NA,
grau13 = NA,
grau23 = NA,
grau21 = NA,
grau31 = NA,
grau32 = NA,
grau123 = NA,
grau213 = NA,
grau312 = NA,
fill = "lightblue",
theme = theme_classic(),
angulo = 0,
errorbar = TRUE,
family = "sans",
dec = 3,
geom = "bar",
textsize = 12,
labelsize = 4,
point = "mean_sd",
angle.label = 0
)

## Arguments

f1

Numeric or complex vector with factor 1 levels

f2

Numeric or complex vector with factor 2 levels

f3

Numeric or complex vector with factor 3 levels

block

Numerical or complex vector with blocks

response

Numerical vector containing the response of the experiment.

norm

Error normality test (default is Shapiro-Wilk)

alpha.f

Level of significance of the F test (default is 0.05)

alpha.t

Significance level of the multiple comparison test (default is 0.05)

quali

Defines whether the factor is quantitative or qualitative (qualitative)

mcomp

Multiple comparison test (Tukey (default), LSD, Scott-Knott and Duncan)

transf

Applies data transformation (default is 1; for log consider 0; angular for angular transformation)

constant

Add a constant for transformation (enter value)

names.fat

Allows labeling the factors 1, 2 and 3.

ylab

Variable response name (Accepts the expression() function)

xlab

Treatments name (Accepts the expression() function)

xlab.factor

Provide a vector with two observations referring to the x-axis name of factors 1, 2 and 3, respectively, when there is an isolated effect of the factors. This argument uses parse.

sup

Number of units above the standard deviation or average bar on the graph

grau

Polynomial degree in case of quantitative factor (default is 1). Provide a vector with three elements.

grau12

Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 2, in the case of interaction f1 x f2 and qualitative factor 2 and quantitative factor 1.

grau13

Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 3, in the case of interaction f1 x f3 and qualitative factor 3 and quantitative factor 1.

grau23

Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 3, in the case of interaction f2 x f3 and qualitative factor 3 and quantitative factor 2.

grau21

Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 1, in the case of interaction f1 x f2 and qualitative factor 1 and quantitative factor 2.

grau31

Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 1, in the case of interaction f1 x f3 and qualitative factor 1 and quantitative factor 3.

grau32

Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 2, in the case of interaction f2 x f3 and qualitative factor 2 and quantitative factor 3.

grau123

Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 1, in the case of interaction f1 x f2 x f3 and quantitative factor 1.

grau213

Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 2, in the case of interaction f1 x f2 x f3 and quantitative factor 2.

grau312

Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 3, in the case of interaction f1 x f2 x f3 and quantitative factor 3.

fill

Defines chart color (to generate different colors for different treatments, define fill = "trat")

theme

ggplot2 theme (default is theme_classic())

angulo

x-axis scale text rotation

errorbar

Plot the standard deviation bar on the graph (In the case of a segment and column graph) - default is TRUE

Plot the average value on the graph (default is TRUE)

family

Font family

dec

Number of cells

geom

Graph type (columns or segments)

textsize

Font size

labelsize

Label Size

point

This function defines whether the point must have all points ("all"), mean ("mean"), standard deviation (default - "mean_sd") or mean with standard error ("mean_se") if quali= FALSE. For quali=TRUE, mean_sd and mean_se change which information will be displayed in the error bar.

angle.label

label angle

## Value

The analysis of variance table, the Shapiro-Wilk error normality test, the Bartlett homogeneity test of variances, the Durbin-Watson error independence test, multiple comparison test (Tukey, LSD, Scott-Knott or Duncan) or adjustment of regression models up to grade 3 polynomial, in the case of quantitative treatments. The column chart for qualitative treatments is also returned.For significant triple interaction only, no graph is returned.

## Note

The order of the chart follows the alphabetical pattern. Please use scale_x_discrete from package ggplot2, limits argument to reorder x-axis. The bars of the column and segment graphs are standard deviation.

The function does not perform multiple regression in the case of two or more quantitative factors. The bars of the column and segment graphs are standard deviation.

In the final output when transformation (transf argument) is different from 1, the columns resp and respo in the mean test are returned, indicating transformed and non-transformed mean, respectively.

## References

Principles and procedures of statistics a biometrical approach Steel, Torry and Dickey. Third Edition 1997

Multiple comparisons theory and methods. Departament of statistics the Ohio State University. USA, 1996. Jason C. Hsu. Chapman Hall/CRC.

Practical Nonparametrics Statistics. W.J. Conover, 1999

Ramalho M.A.P., Ferreira D.F., Oliveira A.C. 2000. Experimentacao em Genetica e Melhoramento de Plantas. Editora UFLA.

Scott R.J., Knott M. 1974. A cluster analysis method for grouping mans in the analysis of variance. Biometrics, 30, 507-512.

Ferreira, E. B., Cavalcanti, P. P., and Nogueira, D. A. (2014). ExpDes: an R package for ANOVA and experimental designs. Applied Mathematics, 5(19), 2952.

Mendiburu, F., and de Mendiburu, M. F. (2019). Package ‘agricolae’. R Package, Version, 1-2.

## Author

Gabriel Danilo Shimizu, shimizu@uel.br

Leandro Simoes Azeredo Goncalves

Rodrigo Yudi Palhaci Marubayashi

## Examples

library(AgroR)
data(enxofre)
with(enxofre, FAT3DBC(f1, f2, f3, bloco, resp))
#>
#> ------------------------------------------
#> Normality of errors
#> ------------------------------------------
#> 	Shapiro-Wilk normality test
#>
#> data:  anava$residuals #> W = 0.989, p-value = 0.5281 #> #> As the calculated p-value is greater than the 5% significance level, hypothesis H0 is not rejected. Therefore, errors can be considered normal #> #> ------------------------------------------ #> Homogeneity of Variances #> ------------------------------------------ #> Bartlett test of homogeneity of variances #> #> data: anava$residuals by paste(Fator1, Fator2, Fator3)
#> Bartlett's K-squared = 25.924, df = 26, p-value = 0.4673
#>
#> As the calculated p-value is greater than the 5% significance level, hypothesis H0 is not rejected. Therefore, the variances can be considered homogeneous
#>
#> ------------------------------------------
#> Independence from errors
#> ------------------------------------------
#> 	Durbin-Watson test
#>
#> data:  anava
#> DW = 2.8704, p-value = 0.9879
#> alternative hypothesis: true autocorrelation is greater than 0
#>
#> As the calculated p-value is greater than the 5% significance level, hypothesis H0 is not rejected. Therefore, errors can be considered independent
#>
#>
#> -----------------------------------------------------------------
#> -----------------------------------------------------------------
#>
#> CV (%) =  6.67
#> Mean =  4985.6044
#> Median =  4975.775
#> Possible outliers =  No discrepant point
#>
#> ------------------------------------------
#> Analysis of Variance
#> ------------------------------------------
#>                      Df    Sum Sq    Mean.Sq    F value        Pr(F)
#> Fator1                2  532880.7  266440.37  2.4098282 9.649081e-02
#> Fator2                2 2593572.1 1296786.07 11.7288222 3.520329e-05
#> Fator3                2 1012836.0  506417.98  4.5803133 1.315819e-02
#> bloco                 3  166887.1   55629.03  0.5031385 6.812289e-01
#> Fator1:Fator2         4  568195.7  142048.92  1.2847659 2.832261e-01
#> Fator1:Fator3         4 2177620.9  544405.23  4.9238901 1.361837e-03
#> Fator2:Fator3         4  548172.3  137043.08  1.2394905 3.011456e-01
#> Fator1:Fator2:Fator3  8 2255321.1  281915.14  2.5497903 1.598465e-02
#> Residuals            78 8623995.8  110564.05
#>
#>
#>
#> ------------------------------------------
#>
#> Interaction F1*F2*F3  significant: unfolding the interaction
#>
#> ------------------------------------------
#>
#> ------------------------------------------
#> Analyzing  F1  within the combination of levels  F2 and F3
#> ------------------------------------------
#>                                     Df     Sum Sq   Mean Sq   F value
#> Fator2: 150 Fator3: Ciclo Completo   2  110556.18  55278.09 0.4999644
#> Fator2: 450 Fator3: Ciclo Completo   2  509409.88 254704.94 2.3036868
#> Fator2: 1350 Fator3: Ciclo Completo  2   63027.18  31513.59 0.2850257
#> Fator2: 150 Fator3: Reprodutivo      2 1100604.58 550302.29 4.9772263
#> Fator2: 450 Fator3: Reprodutivo      2  195182.15  97591.07 0.8826655
#> Fator2: 1350 Fator3: Reprodutivo     2  199700.39  99850.20 0.9030982
#> Fator2: 150 Fator3: Vegetativo       2 1515236.80 757618.40 6.8523034
#> Fator2: 450 Fator3: Vegetativo       2 1485001.57 742500.78 6.7155716
#> Fator2: 1350 Fator3: Vegetativo      2  355299.69 177649.85 1.6067596
#>                                          Pr(>F)
#> Fator2: 150 Fator3: Ciclo Completo  0.608482641
#> Fator2: 450 Fator3: Ciclo Completo  0.106648740
#> Fator2: 1350 Fator3: Ciclo Completo 0.752774794
#> Fator2: 150 Fator3: Reprodutivo     0.009239195
#> Fator2: 450 Fator3: Reprodutivo     0.417769568
#> Fator2: 1350 Fator3: Reprodutivo    0.409507252
#> Fator2: 150 Fator3: Vegetativo      0.001813153
#> Fator2: 450 Fator3: Vegetativo      0.002037125
#> Fator2: 1350 Fator3: Vegetativo     0.207102162
#>
#>
#>  F1  inside of each level of  150  of  F2  and  Ciclo Completo  of  F3
#>         resp letters
#> 675 5027.233       a
#> 225 4927.000       a
#> 75  4792.932       a
#>
#>
#>  F1  inside of each level of  150  of  F2  and  Reprodutivo  of  F3
#>         resp letters
#> 675 5056.610       a
#> 225 4847.748      ab
#> 75  4335.730       b
#>
#>
#>  F1  inside of each level of  150  of  F2  and  Vegetativo  of  F3
#>         resp letters
#> 75  5246.363       a
#> 675 4578.007       b
#> 225 4429.288       b
#>
#>
#>  F1  inside of each level of  450  of  F2  and  Ciclo Completo  of  F3
#>         resp letters
#> 75  5389.980       a
#> 675 5085.130       a
#> 225 4889.233       a
#>
#>
#>  F1  inside of each level of  450  of  F2  and  Reprodutivo  of  F3
#>         resp letters
#> 675 4968.540       a
#> 75  4847.222       a
#> 225 4658.573       a
#>
#>
#>  F1  inside of each level of  450  of  F2  and  Vegetativo  of  F3
#>         resp letters
#> 75  5286.368       a
#> 225 5125.075       a
#> 675 4472.670       b
#>
#>
#>  F1  inside of each level of  1350  of  F2  and  Ciclo Completo  of  F3
#>         resp letters
#> 75  5305.762       a
#> 675 5188.823       a
#> 225 5131.625       a
#>
#>
#>  F1  inside of each level of  1350  of  F2  and  Reprodutivo  of  F3
#>         resp letters
#> 225 5147.488       a
#> 75  4984.855       a
#> 675 4831.542       a
#>
#>
#>  F1  inside of each level of  1350  of  F2  and  Vegetativo  of  F3
#>         resp letters
#> 75  5561.840       a
#> 675 5355.302       a
#> 225 5140.382       a
#>
#>
#>
#> ------------------------------------------
#> Analyzing  F2  within the combination of levels  F1 and F3
#> ------------------------------------------
#>                                    Df     Sum Sq   Mean Sq   F value
#> Fator1: 75 Fator3: Ciclo Completo   2  835403.88 417701.94 3.7779183
#> Fator1: 225 Fator3: Ciclo Completo  2  136069.20  68034.60 0.6153411
#> Fator1: 675 Fator3: Ciclo Completo  2   53620.78  26810.39 0.2424874
#> Fator1: 75 Fator3: Reprodutivo      2  935907.40 467953.70 4.2324219
#> Fator1: 225 Fator3: Reprodutivo     2  486225.50 243112.75 2.1988409
#> Fator1: 675 Fator3: Reprodutivo     2  102906.69  51453.35 0.4653714
#> Fator1: 75 Fator3: Vegetativo       2  236015.40 118007.70 1.0673243
#> Fator1: 225 Fator3: Vegetativo      2 1320014.22 660007.11 5.9694550
#> Fator1: 675 Fator3: Vegetativo      2 1859098.18 929549.09 8.4073359
#>                                          Pr(>F)
#> Fator1: 75 Fator3: Ciclo Completo  0.0271614813
#> Fator1: 225 Fator3: Ciclo Completo 0.5430591078
#> Fator1: 675 Fator3: Ciclo Completo 0.7852629386
#> Fator1: 75 Fator3: Reprodutivo     0.0179864982
#> Fator1: 225 Fator3: Reprodutivo    0.1177618911
#> Fator1: 675 Fator3: Reprodutivo    0.6296338939
#> Fator1: 75 Fator3: Vegetativo      0.3488962873
#> Fator1: 225 Fator3: Vegetativo     0.0038701904
#> Fator1: 675 Fator3: Vegetativo     0.0004937911
#>
#>
#>  F2  inside of each level of  75  of  F1  and  Ciclo Completo  of  F3
#>          resp letters
#> 450  5389.980       a
#> 1350 5305.762      ab
#> 150  4792.932       b
#>
#>
#>  F2  inside of each level of  75  of  F1  and  Reprodutivo  of  F3
#>          resp letters
#> 1350 4984.855       a
#> 450  4847.222      ab
#> 150  4335.730       b
#>
#>
#>  F2  inside of each level of  75  of  F1  and  Vegetativo  of  F3
#>          resp letters
#> 1350 5561.840       a
#> 450  5286.368       a
#> 150  5246.363       a
#>
#>
#>  F2  inside of each level of  225  of  F1  and  Ciclo Completo  of  F3
#>          resp letters
#> 1350 5131.625       a
#> 150  4927.000       a
#> 450  4889.233       a
#>
#>
#>  F2  inside of each level of  225  of  F1  and  Reprodutivo  of  F3
#>          resp letters
#> 1350 5147.488       a
#> 150  4847.748       a
#> 450  4658.573       a
#>
#>
#>  F2  inside of each level of  225  of  F1  and  Vegetativo  of  F3
#>          resp letters
#> 1350 5140.382       a
#> 450  5125.075       a
#> 150  4429.288       b
#>
#>
#>  F2  inside of each level of  675  of  F1  and  Ciclo Completo  of  F3
#>          resp letters
#> 1350 5188.823       a
#> 450  5085.130       a
#> 150  5027.233       a
#>
#>
#>  F2  inside of each level of  675  of  F1  and  Reprodutivo  of  F3
#>          resp letters
#> 150  5056.610       a
#> 450  4968.540       a
#> 1350 4831.542       a
#>
#>
#>  F2  inside of each level of  675  of  F1  and  Vegetativo  of  F3
#>          resp letters
#> 1350 5355.302       a
#> 150  4578.007       b
#> 450  4472.670       b
#>
#> ------------------------------------------
#> Analyzing  F3  within the combination of levels  F1 and F2
#> ------------------------------------------
#>                          Df       Sum Sq     Mean Sq     F value      Pr(>F)
#> Fator1: 75 Fator2: 150    2 1658512.5880 829256.2940 7.500234535 0.001048985
#> Fator1: 225 Fator2: 150   2  572143.2840 286071.6420 2.587383930 0.081661472
#> Fator1: 675 Fator2: 150   2  575635.3215 287817.6608 2.603175851 0.080461250
#> Fator1: 75 Fator2: 450    2  664226.1133 332113.0567 3.003806948 0.055368426
#> Fator1: 225 Fator2: 450   2  435267.0706 217633.5353 1.968393329 0.146558601
#> Fator1: 675 Fator2: 450   2  846116.7155 423058.3577 3.826364573 0.025988577
#> Fator1: 75 Fator2: 1350   2  668625.3330 334312.6665 3.023701388 0.054355301
#> Fator1: 225 Fator2: 1350  2     505.0583    252.5292 0.002284008 0.997718665
#> Fator1: 675 Fator2: 1350  2  572918.8352 286459.4176 2.590891179 0.081393337
#>
#>
#>  F3  inside of each level of  75  of  F1  and  150  of  F2
#>                    resp letters
#> Vegetativo     5246.363       a
#> Ciclo Completo 4792.932      ab
#> Reprodutivo    4335.730       b
#>
#>
#>  F3  inside of each level of  75  of  F1  and  450  of  F2
#>                    resp letters
#> Ciclo Completo 5389.980       a
#> Vegetativo     5286.368       a
#> Reprodutivo    4847.222       a
#>
#>
#>  F3  inside of each level of  75  of  F1  and  1350  of  F2
#>                    resp letters
#> Vegetativo     5561.840       a
#> Ciclo Completo 5305.762      ab
#> Reprodutivo    4984.855       b
#>
#>
#>  F3  inside of each level of  225  of  F1  and  150  of  F2
#>                    resp letters
#> Ciclo Completo 4927.000       a
#> Reprodutivo    4847.748       a
#> Vegetativo     4429.288       a
#>
#>
#>  F3  inside of each level of  225  of  F1  and  450  of  F2
#>                    resp letters
#> Vegetativo     5125.075       a
#> Ciclo Completo 4889.233       a
#> Reprodutivo    4658.573       a
#>
#>
#>  F3  inside of each level of  225  of  F1  and  1350  of  F2
#>                    resp letters
#> Reprodutivo    5147.488       a
#> Vegetativo     5140.382       a
#> Ciclo Completo 5131.625       a
#>
#>
#>  F3  inside of each level of  675  of  F1  and  150  of  F2
#>                    resp letters
#> Reprodutivo    5056.610       a
#> Ciclo Completo 5027.233       a
#> Vegetativo     4578.007       a
#>
#>
#>  F3  inside of each level of  675  of  F1  and  450  of  F2
#>                   resp letters
#> Ciclo Completo 5085.13       a
#> Reprodutivo    4968.54      ab
#> Vegetativo     4472.67       b
#>
#>
#>  F3  inside of each level of  675  of  F1  and  1350  of  F2
#>                    resp letters
#> Vegetativo     5355.302       a
#> Ciclo Completo 5188.823       a
#> Reprodutivo    4831.542       a