Type: | Package |
Title: | Experimental Statistics and Graphics for Agricultural Sciences |
Version: | 1.3.7 |
Date: | 2025-06-10 |
Maintainer: | Gabriel Danilo Shimizu <gabrield.shimizu@gmail.com> |
Description: | Performs the analysis of completely randomized experimental designs (CRD), randomized blocks (RBD) and Latin square (LSD), experiments in double and triple factorial scheme (in CRD and RBD), experiments in subdivided plot scheme (in CRD and RBD), subdivided and joint analysis of experiments in CRD and RBD, linear regression analysis, test for two samples. The package performs analysis of variance, ANOVA assumptions and multiple comparison test of means or regression, according to Pimentel-Gomes (2009, ISBN: 978-85-7133-055-9), nonparametric test (Conover, 1999, ISBN: 0471160687), test for two samples, joint analysis of experiments according to Ferreira (2018, ISBN: 978-85-7269-566-4) and generalized linear model (glm) for binomial and Poisson family in CRD and RBD (Carvalho, FJ (2019), <doi:10.14393/ufu.te.2019.1244>). It can also be used to obtain descriptive measures and graphics, in addition to correlations and creative graphics used in agricultural sciences (Agronomy, Zootechnics, Food Science and related areas). Shimizu, G. D., Marubayashi, R. Y. P., Goncalves, L. S. A. (2025) <doi:10.4025/actasciagron.v47i1.73889>. |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.2 |
Imports: | knitr, ggplot2, nortest, lme4, crayon, lmtest, emmeans, multcomp, ggrepel, MASS, cowplot, multcompView, RColorBrewer, drc, dunn.test, gtools, gridExtra |
Suggests: | rmarkdown, roxygen2 |
Depends: | R (≥ 3.6.0) |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
URL: | https://agronomiar.github.io/AgroR_package/index.html, https://fisher.uel.br/AgroR_shiny, https://fisher.uel.br/AgroR_shiny.pt |
NeedsCompilation: | no |
Packaged: | 2025-07-01 19:52:47 UTC; Administrador |
Author: | Gabriel Danilo Shimizu
|
Repository: | CRAN |
Date/Publication: | 2025-07-02 08:50:05 UTC |
AgroR: Experimental Statistics and Graphics for Agricultural Sciences
Description
Performs the analysis of completely randomized experimental designs (CRD), randomized blocks (RBD) and Latin square (LSD), experiments in double and triple factorial scheme (in CRD and RBD), experiments in subdivided plot scheme (in CRD and RBD), subdivided and joint analysis of experiments in CRD and RBD, linear regression analysis, test for two samples. The package performs analysis of variance, ANOVA assumptions and multiple comparison test of means or regression, according to Pimentel-Gomes (2009, ISBN: 978-85-7133-055-9), nonparametric test (Conover, 1999, ISBN: 0471160687), test for two samples, joint analysis of experiments according to Ferreira (2018, ISBN: 978-85-7269-566-4) and generalized linear model (glm) for binomial and Poisson family in CRD and RBD (Carvalho, FJ (2019), doi:10.14393/ufu.te.2019.1244). It can also be used to obtain descriptive measures and graphics, in addition to correlations and creative graphics used in agricultural sciences (Agronomy, Zootechnics, Food Science and related areas). Shimizu, G. D., Marubayashi, R. Y. P., Goncalves, L. S. A. (2025) doi:10.4025/actasciagron.v47i1.73889.
Author(s)
Maintainer: Gabriel Danilo Shimizu gabrield.shimizu@gmail.com (ORCID)
Authors:
Rodrigo Yudi Palhaci Marubayashi (ORCID) [contributor]
Leandro Simoes Azeredo Goncalves (ORCID) [contributor]
See Also
Useful links:
Analysis: Randomized block design
Description
This is a function of the AgroR package for statistical analysis of experiments conducted in a randomized block and balanced design with a factor considering the fixed model. The function presents the option to use non-parametric method or transform the dataset.
Usage
DBC(
trat,
block,
response,
norm = "sw",
homog = "bt",
alpha.f = 0.05,
alpha.t = 0.05,
quali = TRUE,
mcomp = "tukey",
grau = 1,
transf = 1,
constant = 0,
test = "parametric",
geom = "bar",
theme = theme_classic(),
sup = NA,
CV = TRUE,
ylab = "response",
xlab = "",
textsize = 12,
labelsize = 4,
fill = "lightblue",
angle = 0,
family = "sans",
dec = 3,
width.column = 0.9,
width.bar = 0.3,
addmean = TRUE,
errorbar = TRUE,
posi = "top",
point = "mean_sd",
pointsize = 5,
angle.label = 0,
ylim = NA,
print.on = TRUE,
plot.on = TRUE
)
Arguments
trat |
Numerical or complex vector with treatments |
block |
Numerical or complex vector with blocks |
response |
Numerical vector containing the response of the experiment. |
norm |
Error normality test (default is Shapiro-Wilk) |
homog |
Homogeneity test of variances (default is Bartlett) |
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 (default is qualitative) |
mcomp |
Multiple comparison test (Tukey (default), LSD, Scott-Knott and Duncan) |
grau |
Degree of polynomial in case of quantitative factor (default is 1) |
transf |
Applies data transformation (default is 1; for log consider 0; 'angular' for angular transformation) |
constant |
Add a constant for transformation (enter value) |
test |
"parametric" - Parametric test or "noparametric" - non-parametric test |
geom |
graph type (columns, boxes or segments) |
theme |
ggplot2 theme (default is theme_classic()) |
sup |
Number of units above the standard deviation or average bar on the graph |
CV |
Plotting the coefficient of variation and p-value of Anova (default is TRUE) |
ylab |
Variable response name (this argument uses the parse function) |
xlab |
Treatments name (this argument uses the parse function) |
textsize |
Font size |
labelsize |
Label size |
fill |
Defines chart color (to generate different colors for different treatments, define fill = "trat") |
angle |
x-axis scale text rotation |
family |
Font family |
dec |
Number of cells |
width.column |
Width column if geom="bar" |
width.bar |
Width errorbar |
addmean |
Plot the average value on the graph (default is TRUE) |
errorbar |
Plot the standard deviation bar on the graph (In the case of a segment and column graph) - default is TRUE |
posi |
Legend position |
point |
Defines whether to plot mean ("mean"), mean with standard deviation ("mean_sd" - default) or mean with standard error ("mean_se"). For parametric test it is possible to plot the square root of QMres (mean_qmres). |
pointsize |
Point size |
angle.label |
label angle |
ylim |
Define a numerical sequence referring to the y scale. You can use a vector or the 'seq' command. |
print.on |
Print output |
plot.on |
Plot output |
Value
The table of analysis of variance, the test of normality of errors (Shapiro-Wilk ("sw"), Lilliefors ("li"), Anderson-Darling ("ad"), Cramer-von Mises ("cvm"), Pearson ("pearson") and Shapiro-Francia ("sf")), the test of homogeneity of variances (Bartlett ("bt") or Levene ("levene")), the test of independence of Durbin-Watson errors, the test of multiple comparisons (Tukey ("tukey"), LSD ("lsd"), Scott-Knott ("sk") or Duncan ("duncan")) or adjustment of regression models up to grade 3 polynomial, in the case of quantitative treatments. Non-parametric analysis can be used by the Friedman test. The column, segment or box chart for qualitative treatments is also returned. The function also returns a standardized residual plot.
Note
Enable ggplot2 package to change theme argument.
The ordering of the graph is according to the sequence in which the factor levels are arranged in the data sheet. The bars of the column and segment graphs are standard deviation.
CV and p-value of the graph indicate coefficient of variation and p-value of the F test of the analysis of variance.
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.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
Mendiburu, F., and de Mendiburu, M. F. (2019). Package ‘agricolae’. R Package, Version, 1-2.
See Also
Examples
library(AgroR)
#=============================
# Example laranja
#=============================
data(laranja)
attach(laranja)
DBC(trat, bloco, resp, mcomp = "sk", angle=45, ylab = "Number of fruits/plants")
#=============================
# Friedman test
#=============================
DBC(trat, bloco, resp, test="noparametric", ylab = "Number of fruits/plants")
#=============================
# Example soybean
#=============================
data(soybean)
with(soybean, DBC(cult, bloc, prod,ylab="Grain yield (kg ha^-1)"))
Analysis: Randomized block design by glm
Description
Statistical analysis of experiments conducted in a randomized block design using a generalized linear model. It performs the deviance analysis and the effect is tested by a chi-square test. Multiple comparisons are adjusted by Tukey.
Usage
DBC.glm(
trat,
block,
response,
glm.family = "binomial",
quali = TRUE,
alpha.f = 0.05,
alpha.t = 0.05,
geom = "bar",
theme = theme_classic(),
sup = NA,
ylab = "Response",
xlab = "",
fill = "lightblue",
angle = 0,
family = "sans",
textsize = 12,
labelsize = 5,
dec = 3,
addmean = TRUE,
errorbar = TRUE,
posi = "top",
point = "mean_sd",
angle.label = 0
)
Arguments
trat |
Numerical or complex vector with treatments |
block |
Numerical or complex vector with blocks |
response |
Numerical vector containing the response of the experiment. Use cbind(resp, n-resp) for binomial or quasibinomial family. |
glm.family |
distribution family considered (default is binomial) |
quali |
Defines whether the factor is quantitative or qualitative (default is qualitative) |
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) |
geom |
Graph type (columns, boxes or segments) |
theme |
ggplot2 theme (default is theme_classic()) |
sup |
Number of units above the standard deviation or average bar on the graph |
ylab |
Variable response name (this argument uses the parse function) |
xlab |
Treatments name (this argument uses the parse function) |
fill |
Defines chart color (to generate different colors for different treatments, define fill = "trat") |
angle |
x-axis scale text rotation |
family |
Font family |
textsize |
Font size |
labelsize |
Label size |
dec |
Number of cells |
addmean |
Plot the average value on the graph (default is TRUE) |
errorbar |
Plot the standard deviation bar on the graph (In the case of a segment and column graph) - default is TRUE |
posi |
Legend position |
point |
Defines whether to plot mean ("mean"), mean with standard deviation ("mean_sd" - default) or mean with standard error (default - "mean_se"). |
angle.label |
label angle |
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
Examples
data("aristolochia")
attach(aristolochia)
# Assuming the same aristolochia data set, but considering randomized blocks
bloco=rep(paste("B",1:16),5)
resp=resp/2
DBC.glm(trat,bloco, cbind(resp,50-resp), glm.family="binomial")
Analysis: Randomized block design evaluated over time
Description
Function of the AgroR package for analysis of experiments conducted in a balanced qualitative, single-factorial randomized block design with multiple assessments over time, however without considering time as a factor.
Usage
DBCT(
trat,
block,
time,
response,
alpha.f = 0.05,
alpha.t = 0.05,
mcomp = "tukey",
geom = "bar",
theme = theme_classic(),
fill = "gray",
ylab = "Response",
xlab = "Independent",
textsize = 12,
labelsize = 5,
pointsize = 4.5,
error = TRUE,
family = "sans",
sup = 0,
addmean = FALSE,
posi = c(0.1, 0.8),
legend = "Legend",
ylim = NA,
width.bar = 0.2,
size.bar = 0.8,
dec = 3,
xnumeric = FALSE,
all.letters = FALSE
)
Arguments
trat |
Numerical or complex vector with treatments |
block |
Numerical or complex vector with blocks |
time |
Numerical or complex vector with times |
response |
Numerical vector containing the response of the experiment. |
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) |
mcomp |
Multiple comparison test (Tukey (default), LSD ("lsd"), Scott-Knott ("sk"), Duncan ("duncan") and Friedman ("fd")) |
geom |
Graph type (columns - "bar" or segments "point") |
theme |
ggplot2 theme (default is theme_classic()) |
fill |
Defines chart color (to generate different colors for different treatments, define fill = "trat") |
ylab |
Variable response name (this argument uses the parse function) |
xlab |
Treatments name (this argument uses the parse function) |
textsize |
Font size of the texts and titles of the axes |
labelsize |
Font size of the labels |
pointsize |
Point size |
error |
Add error bar (SD) |
family |
Font family |
sup |
Number of units above the standard deviation or average bar on the graph |
addmean |
Plot the average value on the graph (default is TRUE) |
posi |
Legend position |
legend |
Legend title |
ylim |
Define a numerical sequence referring to the y scale. You can use a vector or the 'seq' command. |
width.bar |
width error bar |
size.bar |
size error bar |
dec |
Number of cells |
xnumeric |
Declare x as numeric (default is FALSE) |
all.letters |
Adds all label letters regardless of whether it is significant or not. |
Details
The p-value of the analysis of variance, the normality test for Shapiro-Wilk errors, the Bartlett homogeneity test of variances, the independence of Durbin-Watson errors and the multiple comparison test (Tukey, Scott-Knott, LSD or Duncan).
Value
The function returns the p-value of Anova, the assumptions of normality of errors, homogeneity of variances and independence of errors, multiple comparison test, as well as a line graph
Note
The ordering of the graph is according to the sequence in which the factor levels are arranged in the data sheet. The bars of the column and segment graphs are standard deviation.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Gonçalves
Rodrigo Yudi Palhaci Marubayashi
References
Principles and procedures of statistics a biometrical approach Steel & Torry & 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.
See Also
Examples
rm(list=ls())
data(simulate2)
attach(simulate2)
#===================================
# default
#===================================
DBCT(trat, bloco, tempo, resp)
DBCT(trat, bloco, tempo, resp,fill="rainbow")
#===================================
# segment chart
#===================================
DBCT(trat, bloco, tempo, resp, geom="point")
Analysis: Completely randomized design
Description
Statistical analysis of experiments conducted in a completely randomized and balanced design with a factor considering the fixed model. The function presents the option to use non-parametric method or transform the dataset.
Usage
DIC(
trat,
response,
norm = "sw",
homog = "bt",
alpha.f = 0.05,
alpha.t = 0.05,
quali = TRUE,
mcomp = "tukey",
grau = 1,
transf = 1,
constant = 0,
test = "parametric",
mcompNP = "LSD",
p.adj = "holm",
geom = "bar",
theme = theme_classic(),
ylab = "Response",
sup = NA,
CV = TRUE,
xlab = "",
fill = "lightblue",
angle = 0,
family = "sans",
textsize = 12,
labelsize = 4,
dec = 3,
width.column = 0.9,
width.bar = 0.3,
addmean = TRUE,
errorbar = TRUE,
posi = "top",
point = "mean_sd",
pointsize = 5,
angle.label = 0,
ylim = NA,
print.on = TRUE,
plot.on = TRUE
)
Arguments
trat |
Numerical or complex vector with treatments |
response |
Numerical vector containing the response of the experiment. |
norm |
Error normality test (default is Shapiro-Wilk) |
homog |
Homogeneity test of variances (default is Bartlett) |
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 (default is qualitative) |
mcomp |
Multiple comparison test (Tukey (default), LSD, Scott-Knott and Duncan) |
grau |
Degree of polynomial in case of quantitative factor (default is 1) |
transf |
Applies data transformation (default is 1; for log consider 0, 'angular' for angular transformation) |
constant |
Add a constant for transformation (enter value) |
test |
"parametric" - Parametric test or "noparametric" - non-parametric test |
mcompNP |
Multiple comparison test (LSD (default) or dunn) |
p.adj |
Method for adjusting p values for Kruskal-Wallis ("none","holm","hommel", "hochberg", "bonferroni", "BH", "BY", "fdr") |
geom |
Graph type (columns, boxes or segments) |
theme |
ggplot2 theme (default is theme_classic()) |
ylab |
Variable response name (this argument uses the parse function) |
sup |
Number of units above the standard deviation or average bar on the graph |
CV |
Plotting the coefficient of variation and p-value of Anova (default is TRUE) |
xlab |
Treatments name (this argument uses the parse function) |
fill |
Defines chart color (to generate different colors for different treatments, define fill = "trat") |
angle |
x-axis scale text rotation |
family |
Font family |
textsize |
Font size |
labelsize |
Label size |
dec |
Number of cells |
width.column |
Width column if geom="bar" |
width.bar |
Width errorbar |
addmean |
Plot the average value on the graph (default is TRUE) |
errorbar |
Plot the standard deviation bar on the graph (In the case of a segment and column graph) - default is TRUE |
posi |
Legend position |
point |
Defines whether to plot mean ("mean"), mean with standard deviation ("mean_sd" - default) or mean with standard error ("mean_se"). For quali=FALSE or quali=TRUE. For parametric test it is possible to plot the square root of QMres (mean_qmres) |
pointsize |
Point size |
angle.label |
label angle |
ylim |
Define a numerical sequence referring to the y scale. You can use a vector or the 'seq' command. |
print.on |
Print output |
plot.on |
Plot output |
Value
The table of analysis of variance, the test of normality of errors (Shapiro-Wilk ("sw"), Lilliefors ("li"), Anderson-Darling ("ad"), Cramer-von Mises ("cvm"), Pearson ("pearson") and Shapiro-Francia ("sf")), the test of homogeneity of variances (Bartlett ("bt") or Levene ("levene")), the test of independence of Durbin-Watson errors, the test of multiple comparisons (Tukey ("tukey"), LSD ("lsd"), Scott-Knott ("sk") or Duncan ("duncan")) or adjustment of regression models up to grade 3 polynomial, in the case of quantitative treatments. Non-parametric analysis can be used by the Kruskal-Wallis test. The column, segment or box chart for qualitative treatments is also returned. The function also returns a standardized residual plot.
Note
Enable ggplot2 package to change theme argument.
The ordering of the graph is according to the sequence in which the factor levels are arranged in the data sheet. The bars of the column and segment graphs are standard deviation.
Post hoc test in nonparametric is using the criterium Fisher's least significant difference (p-adj="holm").
CV and p-value of the graph indicate coefficient of variation and p-value of the F test of the analysis of variance.
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.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
W.J. Conover, Practical Nonparametrics Statistics. 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.
Mendiburu, F., and de Mendiburu, M. F. (2019). Package ‘agricolae’. R Package, Version, 1-2.
Hothorn, T. et al. Package ‘lmtest’. Testing linear regression models. https://cran. r-project. org/web/packages/lmtest/lmtest. pdf. Accessed, v. 6, 2015.
See Also
Examples
library(AgroR)
data(pomegranate)
with(pomegranate, DIC(trat, WL, ylab = "Weight loss ('%')")) # tukey
with(pomegranate, DIC(trat, WL, mcomp = "sk", ylab = "Weight loss ('%')"))
with(pomegranate, DIC(trat, WL, mcomp = "duncan", ylab = "Weight loss ('%')"))
#=============================
# Kruskal-Wallis
#=============================
with(pomegranate, DIC(trat, WL, test = "noparametric", ylab = "Weight loss ('%')"))
#=============================
# chart type
#=============================
with(pomegranate, DIC(trat, WL, geom="point", ylab = "Weight loss ('%')"))
with(pomegranate, DIC(trat, WL, ylab = "Weight loss ('%')", xlab="Treatments"))
#=============================
# quantitative factor
#=============================
data("phao")
with(phao, DIC(dose,comp,quali=FALSE,grau=2,xlab = "Dose (g vase^-1)",ylab="Leaf length (cm)"))
#=============================
# data transformation
#=============================
data("pepper")
with(pepper, DIC(Acesso, VitC, transf = 0,ylab="Vitamin C"))
Analysis: Completely randomized design by glm
Description
Statistical analysis of experiments conducted in a completely randomized design using a generalized linear model. It performs the deviance analysis and the effect is tested by a chi-square test. Multiple comparisons are adjusted by Tukey.
Usage
DIC.glm(
trat,
response,
glm.family = "binomial",
quali = TRUE,
alpha.f = 0.05,
alpha.t = 0.05,
geom = "bar",
theme = theme_classic(),
sup = NA,
ylab = "Response",
xlab = "",
fill = "lightblue",
angle = 0,
family = "sans",
textsize = 12,
labelsize = 5,
dec = 3,
addmean = TRUE,
errorbar = TRUE,
posi = "top",
point = "mean_sd",
angle.label = 0
)
Arguments
trat |
Numerical or complex vector with treatments |
response |
Numerical vector containing the response of the experiment. Use cbind(resp, n-resp) for binomial or quasibinomial family. |
glm.family |
distribution family considered (default is binomial) |
quali |
Defines whether the factor is quantitative or qualitative (default is qualitative) |
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) |
geom |
Graph type (columns, boxes or segments) |
theme |
ggplot2 theme (default is theme_classic()) |
sup |
Number of units above the standard deviation or average bar on the graph |
ylab |
Variable response name (this argument uses the parse function) |
xlab |
Treatments name (this argument uses the parse function) |
fill |
Defines chart color (to generate different colors for different treatments, define fill = "trat") |
angle |
x-axis scale text rotation |
family |
Font family |
textsize |
Font size |
labelsize |
Label size |
dec |
Number of cells |
addmean |
Plot the average value on the graph (default is TRUE) |
errorbar |
Plot the standard deviation bar on the graph (In the case of a segment and column graph) - default is TRUE |
posi |
Legend position |
point |
Defines whether to plot mean ("mean"), mean with standard deviation ("mean_sd" - default) or mean with standard error (default - "mean_se"). |
angle.label |
label angle |
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
Examples
data("aristolochia")
attach(aristolochia)
#=============================
# Use the DIC function
#=============================
DIC(trat, resp)
#=============================
# Use the DIC function noparametric
#=============================
DIC(trat, resp, test="noparametric")
#=============================
# Use the DIC.glm function
#=============================
resp=resp/4 # total germinated seeds
# the value 25 is the total of seeds in the repetition
DIC.glm(trat, cbind(resp,25-resp), glm.family="binomial")
Analysis: Completely randomized design evaluated over time
Description
Function of the AgroR package for the analysis of experiments conducted in a completely randomized, qualitative, uniform qualitative design with multiple assessments over time, however without considering time as a factor.
Usage
DICT(
trat,
time,
response,
alpha.f = 0.05,
alpha.t = 0.05,
mcomp = "tukey",
theme = theme_classic(),
geom = "bar",
xlab = "Independent",
ylab = "Response",
p.adj = "holm",
dec = 3,
fill = "gray",
error = TRUE,
textsize = 12,
labelsize = 5,
pointsize = 4.5,
family = "sans",
sup = 0,
addmean = FALSE,
legend = "Legend",
ylim = NA,
width.bar = 0.2,
size.bar = 0.8,
posi = c(0.1, 0.8),
xnumeric = FALSE,
all.letters = FALSE
)
Arguments
trat |
Numerical or complex vector with treatments |
time |
Numerical or complex vector with times |
response |
Numerical vector containing the response of the experiment. |
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) |
mcomp |
Multiple comparison test (Tukey (default), LSD ("lsd"), Scott-Knott ("sk"), Duncan ("duncan") and Kruskal-Wallis ("kw")) |
theme |
ggplot2 theme (default is theme_classic()) |
geom |
Graph type (columns - "bar" or segments "point") |
xlab |
treatments name (this argument uses the parse function) |
ylab |
Variable response name (this argument uses the parse function) |
p.adj |
Method for adjusting p values for Kruskal-Wallis ("none","holm","hommel", "hochberg", "bonferroni", "BH", "BY", "fdr") |
dec |
Number of cells |
fill |
Defines chart color (to generate different colors for different treatments, define fill = "trat") |
error |
Add error bar |
textsize |
Font size of the texts and titles of the axes |
labelsize |
Font size of the labels |
pointsize |
Point size |
family |
Font family |
sup |
Number of units above the standard deviation or average bar on the graph |
addmean |
Plot the average value on the graph (default is TRUE) |
legend |
Legend title |
ylim |
Define a numerical sequence referring to the y scale. You can use a vector or the 'seq' command. |
width.bar |
width error bar |
size.bar |
size error bar |
posi |
Legend position |
xnumeric |
Declare x as numeric (default is FALSE) |
all.letters |
Adds all label letters regardless of whether it is significant or not. |
Value
The function returns the p-value of Anova, the assumptions of normality of errors, homogeneity of variances and independence of errors, multiple comparison test, as well as a line graph
Note
The ordering of the graph is according to the sequence in which the factor levels are arranged in the data sheet. The bars of the column and segment graphs are standard deviation.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
See Also
Examples
rm(list=ls())
data(simulate1)
attach(simulate1)
with(simulate1, DICT(trat, tempo, resp))
with(simulate1, DICT(trat, tempo, resp, fill="rainbow",family="serif"))
with(simulate1, DICT(trat, tempo, resp,geom="bar",sup=40))
with(simulate1, DICT(trat, tempo, resp,geom="point",sup=40))
Analysis: Latin square design
Description
This is a function of the AgroR package for statistical analysis of experiments conducted in Latin Square and balanced design with a factor considering the fixed model.
Usage
DQL(
trat,
line,
column,
response,
norm = "sw",
homog = "bt",
alpha.f = 0.05,
alpha.t = 0.05,
quali = TRUE,
mcomp = "tukey",
grau = 1,
transf = 1,
constant = 0,
geom = "bar",
theme = theme_classic(),
sup = NA,
CV = TRUE,
ylab = "Response",
xlab = "",
textsize = 12,
labelsize = 4,
fill = "lightblue",
angle = 0,
family = "sans",
dec = 3,
width.column = 0.9,
width.bar = 0.3,
addmean = TRUE,
errorbar = TRUE,
posi = "top",
point = "mean_sd",
pointsize = 5,
angle.label = 0,
ylim = NA,
print.on = TRUE,
plot.on = TRUE
)
Arguments
trat |
Numerical or complex vector with treatments |
line |
Numerical or complex vector with lines |
column |
Numerical or complex vector with columns |
response |
Numerical vector containing the response of the experiment. |
norm |
Error normality test (default is Shapiro-Wilk) |
homog |
Homogeneity test of variances (default is Bartlett) |
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 (default is qualitative) |
mcomp |
Multiple comparison test (Tukey (default), LSD, Scott-Knott and Duncan) |
grau |
Degree of polynomial in case of quantitative factor (default is 1) |
transf |
Applies data transformation (default is 1; for log consider 0; 'angular' for angular transformation) |
constant |
Add a constant for transformation (enter value) |
geom |
Graph type (columns, boxes or segments) |
theme |
ggplot2 theme (default is theme_classic()) |
sup |
Number of units above the standard deviation or average bar on the graph |
CV |
Plotting the coefficient of variation and p-value of Anova (default is TRUE) |
ylab |
Variable response name (Accepts the expression() function) |
xlab |
Treatments name (Accepts the expression() function) |
textsize |
Font size |
labelsize |
Label size |
fill |
Defines chart color (to generate different colors for different treatments, define fill = "trat") |
angle |
x-axis scale text rotation |
family |
Font family |
dec |
Number of cells |
width.column |
Width column if geom="bar" |
width.bar |
Width errorbar |
addmean |
Plot the average value on the graph (default is TRUE) |
errorbar |
Plot the standard deviation bar on the graph (In the case of a segment and column graph) - default is TRUE |
posi |
Legend position |
point |
Defines whether to plot mean ("mean"), mean with standard deviation ("mean_sd" - default) or mean with standard error ("mean_se"). For parametric test it is possible to plot the square root of QMres (mean_qmres). |
pointsize |
Point size |
angle.label |
label angle |
ylim |
Define a numerical sequence referring to the y scale. You can use a vector or the 'seq' command. |
print.on |
Print output |
plot.on |
Plot output |
Value
The table of analysis of variance, the test of normality of errors (Shapiro-Wilk ("sw"), Lilliefors ("li"), Anderson-Darling ("ad"), Cramer-von Mises ("cvm"), Pearson ("pearson") and Shapiro-Francia ("sf")), the test of homogeneity of variances (Bartlett ("bt") or Levene ("levene")), the test of independence of Durbin-Watson errors, the test of multiple comparisons (Tukey ("tukey"), LSD ("lsd"), Scott-Knott ("sk") or Duncan ("duncan")) or adjustment of regression models up to grade 3 polynomial, in the case of quantitative treatments. The column, segment or box chart for qualitative treatments is also returned. The function also returns a standardized residual plot.
Note
The ordering of the graph is according to the sequence in which the factor levels are arranged in the data sheet. The bars of the column and segment graphs are standard deviation.
CV and p-value of the graph indicate coefficient of variation and p-value of the F test of the analysis of variance.
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.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
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.
Mendiburu, F., and de Mendiburu, M. F. (2019). Package ‘agricolae’. R Package, Version, 1-2.
See Also
Examples
library(AgroR)
data(porco)
with(porco, DQL(trat, linhas, colunas, resp, ylab="Weigth (kg)"))
Analysis: Latin square design evaluated over time
Description
Function of the AgroR package for the analysis of experiments conducted in a balanced qualitative single-square Latin design with multiple assessments over time, however without considering time as a factor.
Usage
DQLT(
trat,
line,
column,
time,
response,
alpha.f = 0.05,
alpha.t = 0.05,
mcomp = "tukey",
error = TRUE,
xlab = "Independent",
ylab = "Response",
textsize = 12,
labelsize = 5,
pointsize = 4.5,
family = "sans",
sup = 0,
addmean = FALSE,
posi = c(0.1, 0.8),
geom = "bar",
fill = "gray",
legend = "Legend",
ylim = NA,
width.bar = 0.2,
size.bar = 0.8,
dec = 3,
theme = theme_classic(),
xnumeric = FALSE,
all.letters = FALSE
)
Arguments
trat |
Numerical or complex vector with treatments |
line |
Numerical or complex vector with line |
column |
Numerical or complex vector with column |
time |
Numerical or complex vector with times |
response |
Numerical vector containing the response of the experiment. |
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) |
mcomp |
Multiple comparison test (Tukey (default), LSD, Scott-Knott and Duncan) |
error |
Add error bar (SD) |
xlab |
Treatments name (this argument uses the parse function) |
ylab |
Variable response name (this argument uses the parse function) |
textsize |
Font size of the texts and titles of the axes |
labelsize |
Font size of the labels |
pointsize |
Point size |
family |
Font family |
sup |
Number of units above the standard deviation or average bar on the graph |
addmean |
Plot the average value on the graph (default is TRUE) |
posi |
Legend position |
geom |
Graph type (columns - "bar" or segments "point") |
fill |
Defines chart color (to generate different colors for different treatments, define fill = "trat") |
legend |
Legend title |
ylim |
Define a numerical sequence referring to the y scale. You can use a vector or the 'seq' command. |
width.bar |
width error bar |
size.bar |
size error bar |
dec |
Number of cells |
theme |
ggplot2 theme (default is theme_classic()) |
xnumeric |
Declare x as numeric (default is FALSE) |
all.letters |
Adds all label letters regardless of whether it is significant or not. |
Details
The p-value of the analysis of variance, the normality test for Shapiro-Wilk errors, the Bartlett homogeneity test of variances, the independence of Durbin-Watson errors and the multiple comparison test ( Tukey, Scott-Knott, LSD or Duncan).
Value
The function returns the p-value of Anova, the assumptions of normality of errors, homogeneity of variances and independence of errors, multiple comparison test, as well as a line graph
Note
The ordering of the graph is according to the sequence in which the factor levels are arranged in the data sheet. The bars of the column and segment graphs are standard deviation.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
See Also
Examples
rm(list=ls())
data(simulate3)
attach(simulate3)
DQLT(trat, linhas, colunas, tempo, resp)
Analysis: DBC experiments in double factorial
Description
Analysis of an experiment conducted in a randomized block design in a double factorial scheme using analysis of variance of fixed effects.
Usage
FAT2DBC(
f1,
f2,
block,
response,
norm = "sw",
homog = "bt",
alpha.f = 0.05,
alpha.t = 0.05,
quali = c(TRUE, TRUE),
names.fat = c("F1", "F2"),
mcomp = "tukey",
grau = c(NA, NA),
grau12 = NA,
grau21 = NA,
transf = 1,
constant = 0,
geom = "bar",
theme = theme_classic(),
ylab = "Response",
legend = "Legend",
fill = "lightblue",
angle = 0,
textsize = 12,
labelsize = 4,
dec = 3,
width.column = 0.9,
width.bar = 0.3,
family = "sans",
point = "mean_sd",
addmean = TRUE,
errorbar = TRUE,
CV = TRUE,
sup = NA,
color = "rainbow",
posi = "right",
ylim = NA,
angle.label = 0,
print.on = TRUE,
plot.on = TRUE
)
Arguments
f1 |
Numeric or complex vector with factor 1 levels |
f2 |
Numeric or complex vector with factor 2 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) |
homog |
Homogeneity test of variances (default is Bartlett) |
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) |
names.fat |
Name of factors (this argument uses the parse function) |
mcomp |
Multiple comparison test (Tukey (default), LSD, Scott-Knott and Duncan) |
grau |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with two 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. |
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. |
transf |
Applies data transformation (default is 1; for log consider 0; 'angular' for angular transformation) |
constant |
Add a constant for transformation (enter value) |
geom |
Graph type (columns or segments (For simple effect only)) |
theme |
ggplot2 theme (default is theme_classic()) |
ylab |
Variable response name (this argument uses the parse function) |
legend |
Legend title name |
fill |
Defines chart color (to generate different colors for different treatments, define fill = "trat") |
angle |
x-axis scale text rotation |
textsize |
font size |
labelsize |
label size |
dec |
number of cells |
width.column |
Width column if geom="bar" |
width.bar |
Width errorbar |
family |
font family |
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. |
addmean |
Plot the average value on the graph (default is TRUE) |
errorbar |
Plot the standard deviation bar on the graph (In the case of a segment and column graph) - default is TRUE |
CV |
Plotting the coefficient of variation and p-value of Anova (default is TRUE) |
sup |
Number of units above the standard deviation or average bar on the graph |
color |
Column chart color (default is "rainbow") |
posi |
Legend position |
ylim |
y-axis scale |
angle.label |
label angle |
print.on |
Print output |
plot.on |
Plot output |
Value
The table of analysis of variance, the test of normality of errors (Shapiro-Wilk, Lilliefors, Anderson-Darling, Cramer-von Mises, Pearson and Shapiro-Francia), the test of homogeneity of variances (Bartlett or Levene), the test of independence of Durbin-Watson errors, the test of multiple comparisons (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.
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 quantitative factors.
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.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
Mendiburu, F., and de Mendiburu, M. F. (2019). Package ‘agricolae’. R Package, Version, 1-2.
See Also
Examples
#================================================
# Example cloro
#================================================
library(AgroR)
data(cloro)
with(cloro,FAT2DBC(f1, f2, bloco, resp, ylab="Number of nodules"))
with(cloro,FAT2DBC(f1, f2, bloco, resp, mcomp="sk", ylab="Number of nodules"))
#================================================
# Example covercrops
#================================================
library(AgroR)
data(covercrops)
with(covercrops,FAT2DBC(A, B, Bloco, Resp, ylab="Yield (Kg 100 m^2)"))
with(covercrops,FAT2DBC(A, B, Bloco, Resp, mcomp="sk", ylab="Yield (Kg 100 m^2)"))
Analysis: DBC experiment in double factorial design with an additional treatment
Description
Analysis of an experiment conducted in a randomized block design in a double factorial scheme using analysis of variance of fixed effects.
Usage
FAT2DBC.ad(
f1,
f2,
block,
response,
responseAd,
norm = "sw",
homog = "bt",
alpha.f = 0.05,
alpha.t = 0.05,
quali = c(TRUE, TRUE),
names.fat = c("F1", "F2"),
mcomp = "tukey",
grau = c(NA, NA),
grau12 = NA,
grau21 = NA,
transf = 1,
constant = 0,
geom = "bar",
theme = theme_classic(),
ylab = "Response",
ad.label = "Additional",
color = "rainbow",
fill = "lightblue",
textsize = 12,
labelsize = 4,
addmean = TRUE,
errorbar = TRUE,
CV = TRUE,
dec = 3,
width.column = 0.9,
width.bar = 0.3,
angle = 0,
posi = "right",
family = "sans",
point = "mean_sd",
sup = NA,
ylim = NA,
angle.label = 0,
print.on = TRUE,
plot.on = TRUE
)
Arguments
f1 |
Numeric or complex vector with factor 1 levels |
f2 |
Numeric or complex vector with factor 2 levels |
block |
Numeric or complex vector with repetitions |
response |
Numerical vector containing the response of the experiment. |
responseAd |
Numerical vector with additional treatment responses |
norm |
Error normality test (default is Shapiro-Wilk) |
homog |
Homogeneity test of variances (default is Bartlett) |
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) |
names.fat |
Name of factors (this argument uses the parse function) |
mcomp |
Multiple comparison test (Tukey (default), LSD and Duncan) |
grau |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with two 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. |
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. |
transf |
Applies data transformation (default is 1; for log consider 0; 'angular' for angular transformation) |
constant |
Add a constant for transformation (enter value) |
geom |
Graph type (columns or segments (For simple effect only)) |
theme |
ggplot2 theme (default is theme_classic()) |
ylab |
Variable response name (this argument uses the parse function) |
ad.label |
Aditional label |
color |
Column chart color (default is "rainbow") |
fill |
Defines chart color (to generate different colors for different treatments, define fill = "trat") |
textsize |
Font size |
labelsize |
Label Size |
addmean |
Plot the average value on the graph (default is TRUE) |
errorbar |
Plot the standard deviation bar on the graph (In the case of a segment and column graph) - default is TRUE |
CV |
Plotting the coefficient of variation and p-value of Anova (default is TRUE) |
dec |
Number of cells |
width.column |
Width column if geom="bar" |
width.bar |
Width errorbar |
angle |
x-axis scale text rotation |
posi |
legend position |
family |
Font family |
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. |
sup |
Number of units above the standard deviation or average bar on the graph |
ylim |
y-axis scale |
angle.label |
label angle |
print.on |
Print output |
plot.on |
Plot output |
Value
The table of analysis of variance, the test of normality of errors (Shapiro-Wilk, Lilliefors, Anderson-Darling, Cramer-von Mises, Pearson and Shapiro-Francia), the test of homogeneity of variances (Bartlett or Levene), the test of independence of Durbin-Watson errors, the test of multiple comparisons (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.
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 quantitative factors.
The assumptions of variance analysis disregard additional treatment
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.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
Mendiburu, F., and de Mendiburu, M. F. (2019). Package ‘agricolae’. R Package, Version, 1-2.
See Also
Examples
library(AgroR)
data(cloro)
respAd=c(268, 322, 275, 350, 320)
with(cloro, FAT2DBC.ad(f1, f2, bloco, resp, respAd, ylab="Number of nodules"))
Analysis: DIC experiments in double factorial
Description
Analysis of an experiment conducted in a completely randomized design in a double factorial scheme using analysis of variance of fixed effects.
Usage
FAT2DIC(
f1,
f2,
response,
norm = "sw",
homog = "bt",
alpha.f = 0.05,
alpha.t = 0.05,
quali = c(TRUE, TRUE),
names.fat = c("F1", "F2"),
mcomp = "tukey",
grau = c(NA, NA),
grau12 = NA,
grau21 = NA,
transf = 1,
constant = 0,
geom = "bar",
theme = theme_classic(),
ylab = "Response",
lab.factor = c("F1", "F2"),
color = "rainbow",
fill = "lightblue",
textsize = 12,
labelsize = 4,
addmean = TRUE,
errorbar = TRUE,
CV = TRUE,
dec = 3,
width.column = 0.9,
width.bar = 0.3,
angle = 0,
posi = "right",
family = "sans",
point = "mean_sd",
sup = NA,
ylim = NA,
angle.label = 0,
print.on = TRUE,
plot.on = TRUE
)
Arguments
f1 |
Numeric or complex vector with factor 1 levels |
f2 |
Numeric or complex vector with factor 2 levels |
response |
Numerical vector containing the response of the experiment. |
norm |
Error normality test (default is Shapiro-Wilk) |
homog |
Homogeneity test of variances (default is Bartlett) |
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) |
names.fat |
Name of factors (this argument uses the parse function) |
mcomp |
Multiple comparison test (Tukey (default), LSD, Scott-Knott and Duncan) |
grau |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with two 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. |
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. |
transf |
Applies data transformation (default is 1; for log consider 0; 'angular' for angular transformation) |
constant |
Add a constant for transformation (enter value) |
geom |
Graph type (columns or segments (For simple effect only)) |
theme |
ggplot2 theme (default is theme_classic()) |
ylab |
Variable response name (this argument uses the parse function) |
lab.factor |
Provide a vector with two observations referring to the x-axis name of factors 1 and 2, respectively, when there is an isolated effect of the factors. This argument uses 'parse'. |
color |
Column chart color (default is "rainbow") |
fill |
Defines chart color (to generate different colors for different treatments, define fill = "trat") |
textsize |
Font size |
labelsize |
Label Size |
addmean |
Plot the average value on the graph (default is TRUE) |
errorbar |
Plot the standard deviation bar on the graph (In the case of a segment and column graph) - default is TRUE |
CV |
Plotting the coefficient of variation and p-value of Anova (default is TRUE) |
dec |
Number of cells |
width.column |
Width column if geom="bar" |
width.bar |
Width errorbar |
angle |
x-axis scale text rotation |
posi |
Legend position |
family |
Font family |
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. |
sup |
Number of units above the standard deviation or average bar on the graph |
ylim |
y-axis scale |
angle.label |
Label angle |
print.on |
Print output |
plot.on |
Plot output |
Value
The table of analysis of variance, the test of normality of errors (Shapiro-Wilk, Lilliefors, Anderson-Darling, Cramer-von Mises, Pearson and Shapiro-Francia), the test of homogeneity of variances (Bartlett or Levene), the test of independence of Durbin-Watson errors, the test of multiple comparisons (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.
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 quantitative factors.
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.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
References
Principles and procedures of statistics a biometrical approach Steel & Torry & 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.
Mendiburu, F., & de Mendiburu, M. F. (2019). Package ‘agricolae’. R Package, Version, 1-2.
See Also
Examples
#====================================
# Example cloro
#====================================
library(AgroR)
data(cloro)
with(cloro, FAT2DIC(f1, f2, resp, ylab="Number of nodules", names.fat = c("Inoculation","Stages")))
#====================================
# Example corn
#====================================
library(AgroR)
data(corn)
with(corn, FAT2DIC(A, B, Resp, quali=c(TRUE, TRUE),ylab="Heigth (cm)"))
with(corn, FAT2DIC(A, B, Resp, mcomp="sk", quali=c(TRUE, TRUE),ylab="Heigth (cm)"))
Analysis: DIC experiment in double factorial design with an additional treatment
Description
Analysis of an experiment conducted in a completely randomized design in a double factorial scheme using analysis of variance of fixed effects.
Usage
FAT2DIC.ad(
f1,
f2,
repe,
response,
responseAd,
norm = "sw",
homog = "bt",
alpha.f = 0.05,
alpha.t = 0.05,
quali = c(TRUE, TRUE),
names.fat = c("F1", "F2"),
mcomp = "tukey",
grau = c(NA, NA),
grau12 = NA,
grau21 = NA,
transf = 1,
constant = 0,
geom = "bar",
theme = theme_classic(),
ylab = "Response",
ad.label = "Additional",
color = "rainbow",
fill = "lightblue",
textsize = 12,
labelsize = 4,
addmean = TRUE,
errorbar = TRUE,
CV = TRUE,
dec = 3,
width.column = 0.9,
width.bar = 0.3,
angle = 0,
posi = "right",
family = "sans",
point = "mean_sd",
sup = NA,
ylim = NA,
angle.label = 0,
print.on = TRUE,
plot.on = TRUE
)
Arguments
f1 |
Numeric or complex vector with factor 1 levels |
f2 |
Numeric or complex vector with factor 2 levels |
repe |
Numeric or complex vector with repetitions |
response |
Numerical vector containing the response of the experiment. |
responseAd |
Numerical vector with additional treatment responses |
norm |
Error normality test (default is Shapiro-Wilk) |
homog |
Homogeneity test of variances (default is Bartlett) |
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) |
names.fat |
Name of factors (this argument uses the parse function) |
mcomp |
Multiple comparison test (Tukey (default), LSD and Duncan) |
grau |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with two 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. |
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. |
transf |
Applies data transformation (default is 1; for log consider 0; 'angular' for angular transformation) |
constant |
Add a constant for transformation (enter value) |
geom |
Graph type (columns or segments (For simple effect only)) |
theme |
ggplot2 theme (default is theme_classic()) |
ylab |
Variable response name (this argument uses the parse function) |
ad.label |
Aditional label |
color |
Column chart color (default is "rainbow") |
fill |
Defines chart color (to generate different colors for different treatments, define fill = "trat") |
textsize |
Font size |
labelsize |
Label Size |
addmean |
Plot the average value on the graph (default is TRUE) |
errorbar |
Plot the standard deviation bar on the graph (In the case of a segment and column graph) - default is TRUE |
CV |
Plotting the coefficient of variation and p-value of Anova (default is TRUE) |
dec |
Number of cells |
width.column |
Width column if geom="bar" |
width.bar |
Width errorbar |
angle |
x-axis scale text rotation |
posi |
legend position |
family |
Font family |
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. |
sup |
Number of units above the standard deviation or average bar on the graph |
ylim |
y-axis scale |
angle.label |
label angle |
print.on |
Print output |
plot.on |
Plot output |
Value
The table of analysis of variance, the test of normality of errors (Shapiro-Wilk, Lilliefors, Anderson-Darling, Cramer-von Mises, Pearson and Shapiro-Francia), the test of homogeneity of variances (Bartlett or Levene), the test of independence of Durbin-Watson errors, the test of multiple comparisons (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.
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 quantitative factors.
The assumptions of variance analysis disregard additional treatment
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.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
References
Principles and procedures of statistics a biometrical approach Steel & Torry & 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.
Mendiburu, F., & de Mendiburu, M. F. (2019). Package ‘agricolae’. R Package, Version, 1-2.
See Also
Examples
library(AgroR)
data(cloro)
respAd=c(268, 322, 275, 350, 320)
with(cloro, FAT2DIC.ad(f1, f2, bloco, resp, respAd, ylab="Number of nodules"))
Analysis: DBC experiments in triple factorial
Description
Analysis of an experiment conducted in a randomized block design in a triple factorial scheme using analysis of variance of fixed effects.
Usage
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",
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,
addmean = 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 (this argument uses the parse function). |
ylab |
Variable response name (this argument uses the parse function) |
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 |
addmean |
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.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
Examples
library(AgroR)
data(enxofre)
with(enxofre, FAT3DBC(f1, f2, f3, bloco, resp))
Analysis: DBC experiments in triple factorial with aditional
Description
Analysis of an experiment conducted in a randomized block design in a triple factorial scheme with one aditional control using analysis of variance of fixed effects.
Usage
FAT3DBC.ad(
f1,
f2,
f3,
block,
response,
responseAd,
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",
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(),
ad.label = "Additional",
angulo = 0,
errorbar = TRUE,
addmean = 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. |
responseAd |
Numerical vector containing the aditional response |
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 (this argument uses the parse function). |
ylab |
Variable response name (this argument uses the parse function) |
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()) |
ad.label |
Aditional label |
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 |
addmean |
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.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
Examples
library(AgroR)
data(enxofre)
respAd=c(2000,2400,2530,2100)
attach(enxofre)
with(enxofre, FAT3DBC.ad(f1, f2, f3, bloco, resp, respAd))
Analysis: DIC experiments in triple factorial
Description
Analysis of an experiment conducted in a completely randomized design in a triple factorial scheme using analysis of variance of fixed effects.
Usage
FAT3DIC(
f1,
f2,
f3,
response,
norm = "sw",
alpha.t = 0.05,
alpha.f = 0.05,
quali = c(TRUE, TRUE, TRUE),
mcomp = "tukey",
grau = c(NA, NA, NA),
grau12 = NA,
grau13 = NA,
grau23 = NA,
grau21 = NA,
grau31 = NA,
grau32 = NA,
grau123 = NA,
grau213 = NA,
grau312 = NA,
transf = 1,
constant = 0,
names.fat = c("F1", "F2", "F3"),
ylab = "Response",
sup = NA,
fill = "lightblue",
theme = theme_classic(),
angulo = 0,
family = "sans",
addmean = TRUE,
errorbar = TRUE,
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 |
response |
Numerical vector containing the response of the experiment. |
norm |
Error normality test (default is Shapiro-Wilk) |
alpha.t |
Significance level of the multiple comparison test (default is 0.05) |
alpha.f |
Level of significance of the F 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) |
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. |
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 (this argument uses the parse function). |
ylab |
Variable response name (this argument uses the parse function) |
sup |
Number of units above the standard deviation or average bar on the graph |
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 |
family |
Font family |
addmean |
Plot the average value on the graph (default is TRUE) |
errorbar |
Plot the standard deviation bar on the graph (In the case of a segment and column graph) - default is TRUE |
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.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
Examples
library(AgroR)
data(enxofre)
with(enxofre, FAT3DIC(f1, f2, f3, resp))
Analysis: DIC experiments in triple factorial with aditional
Description
Analysis of an experiment conducted in a completely randomized design in a triple factorial scheme with one aditional control using analysis of variance of fixed effects.
Usage
FAT3DIC.ad(
f1,
f2,
f3,
repe,
response,
responseAd,
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",
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(),
ad.label = "Additional",
angulo = 0,
errorbar = TRUE,
addmean = 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 |
repe |
Numerical or complex vector with blocks |
response |
Numerical vector containing the response of the experiment. |
responseAd |
Numerical vector containing the aditional response |
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 (this argument uses the parse function). |
ylab |
Variable response name (this argument uses the parse function) |
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()) |
ad.label |
Aditional label |
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 |
addmean |
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.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
Examples
library(AgroR)
data(enxofre)
respAd=c(2000,2400,2530,2100)
with(enxofre, FAT3DIC.ad(f1, f2, f3, bloco, resp, respAd))
Analysis: Principal components analysis
Description
This function performs principal component analysis.
Usage
PCA_function(
data,
scale = TRUE,
text = TRUE,
pointsize = 5,
textsize = 12,
labelsize = 4,
linesize = 0.6,
repel = TRUE,
ylab = NA,
xlab = NA,
groups = NA,
sc = 1,
font.family = "sans",
theme = theme_bw(),
label.legend = "Cluster",
type.graph = "biplot"
)
Arguments
data |
Data.frame with data set. Line name must indicate the treatment |
scale |
Performs data standardization (default is TRUE) |
text |
Add label (default is TRUE) |
pointsize |
Point size (default is 5) |
textsize |
Text size (default is 12) |
labelsize |
Label size (default is 4) |
linesize |
Line size (default is 0.8) |
repel |
Avoid text overlay (default is TRUE) |
ylab |
Names y-axis (this argument uses the parse function) |
xlab |
Names x-axis (this argument uses the parse function) |
groups |
Define grouping |
sc |
Secondary axis scale ratio (default is 1) |
font.family |
Font family (default is sans) |
theme |
Theme ggplot2 (default is theme_bw()) |
label.legend |
Legend title (when group is not NA) |
type.graph |
Type of chart (default is biplot) |
Details
The type.graph argument defines the graph that will be returned, in the case of "biplot" the biplot graph is returned with the first two main components and with eigenvalues and eigenvectors. In the case of "scores" only the treatment scores are returned, while for "cor" the correlations are returned. For "corPCA" a correlation between the vectors with the components is returned.
Value
The eigenvalues and eigenvectors, the explanation percentages of each principal component, the correlations between the vectors with the principal components, as well as graphs are returned.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Examples
data(pomegranate)
medias=tabledesc(pomegranate)
PCA_function(medias)
Analysis: DBC experiments in split-plot
Description
Analysis of an experiment conducted in a randomized block design in a split-plot scheme using fixed effects analysis of variance.
Usage
PSUBDBC(
f1,
f2,
block,
response,
norm = "sw",
alpha.f = 0.05,
alpha.t = 0.05,
quali = c(TRUE, TRUE),
names.fat = c("F1", "F2"),
mcomp = "tukey",
grau = c(NA, NA),
grau12 = NA,
grau21 = NA,
transf = 1,
constant = 0,
geom = "bar",
theme = theme_classic(),
ylab = "Response",
color = "rainbow",
textsize = 12,
labelsize = 4,
dec = 3,
errorbar = TRUE,
addmean = TRUE,
ylim = NA,
point = "mean_se",
fill = "lightblue",
angle = 0,
family = "sans",
posi = "right",
angle.label = 0,
print.on = TRUE,
plot.on = TRUE
)
Arguments
f1 |
Numeric or complex vector with plot levels |
f2 |
Numeric or complex vector with subplot levels |
block |
Numeric or complex vector with blocks |
response |
Numeric vector with responses |
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) |
names.fat |
Name of factors (this argument uses the parse function) |
mcomp |
Multiple comparison test (Tukey (default), LSD, Scott-Knott and Duncan) |
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. |
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. |
transf |
Applies data transformation (default is 1; for log consider 0) |
constant |
Add a constant for transformation (enter value) |
geom |
Graph type (columns or segments (For simple effect only)) |
theme |
ggplot2 theme (default is theme_classic()) |
ylab |
Variable response name (this argument uses the parse function) |
color |
When the columns are different colors (Set fill-in argument as "trat") |
textsize |
Font size (default is 12) |
labelsize |
Font size (default is 4) |
dec |
Number of cells (default is 3) |
errorbar |
Plot the standard deviation bar on the graph (In the case of a segment and column graph) - default is TRUE |
addmean |
Plot the average value on the graph (default is TRUE) |
ylim |
y-axis limit |
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. |
fill |
Defines chart color (to generate different colors for different treatments, define fill = "trat") |
angle |
x-axis scale text rotation |
family |
Font family (default is sans) |
posi |
Legend position |
angle.label |
Label angle |
print.on |
Print output |
plot.on |
Plot output |
Value
The table of analysis of variance, the test of normality of errors (Shapiro-Wilk, Lilliefors, Anderson-Darling, Cramer-von Mises, Pearson and Shapiro-Francia), the test of homogeneity of variances (Bartlett), the test of multiple comparisons (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. The function also returns a standardized residual plot.
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.
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.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
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.
Examples
#==============================
# Example tomate
#==============================
library(AgroR)
data(tomate)
with(tomate, PSUBDBC(parc, subp, bloco, resp, ylab="Dry mass (g)"))
#==============================
# Example orchard
#==============================
library(AgroR)
data(orchard)
with(orchard, PSUBDBC(A, B, Bloco, Resp, ylab="CBM"))
Analysis: DIC experiments in split-plot
Description
Analysis of an experiment conducted in a completely randomized design in a split-plot scheme using fixed effects analysis of variance.
Usage
PSUBDIC(
f1,
f2,
block,
response,
norm = "sw",
alpha.f = 0.05,
alpha.t = 0.05,
quali = c(TRUE, TRUE),
names.fat = c("F1", "F2"),
mcomp = "tukey",
grau = c(NA, NA),
grau12 = NA,
grau21 = NA,
transf = 1,
constant = 0,
geom = "bar",
theme = theme_classic(),
ylab = "Response",
lab.factor = c("F1", "F2"),
fill = "lightblue",
angle = 0,
family = "sans",
color = "rainbow",
errorbar = TRUE,
addmean = TRUE,
textsize = 12,
labelsize = 4,
dec = 3,
ylim = NA,
posi = "right",
point = "mean_se",
angle.label = 0,
print.on = TRUE,
plot.on = TRUE
)
Arguments
f1 |
Numeric or complex vector with plot levels |
f2 |
Numeric or complex vector with subplot levels |
block |
Numeric or complex vector with blocks |
response |
Numeric vector with responses |
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) |
names.fat |
Name of factors (this argument uses the parse function) |
mcomp |
Multiple comparison test (Tukey (default), LSD, Scott-Knott and Duncan) |
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. |
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. |
transf |
Applies data transformation (default is 1; for log consider 0) |
constant |
Add a constant for transformation (enter value) |
geom |
Graph type (columns or segments (For simple effect only)) |
theme |
ggplot2 theme (default is theme_classic()) |
ylab |
Variable response name (this argument uses the parse function) |
lab.factor |
Provide a vector with two observations referring to the x-axis name of factors 1 and 2, respectively, when there is an isolated effect of the factors. This argument uses 'parse'. |
fill |
Defines chart color (to generate different colors for different treatments, define fill = "trat") |
angle |
x-axis scale text rotation |
family |
Font family (default is sans) |
color |
When the columns are different colors (Set fill-in argument as "trat") |
errorbar |
Plot the standard deviation bar on the graph (In the case of a segment and column graph) - default is TRUE |
addmean |
Plot the average value on the graph (default is TRUE) |
textsize |
Font size (default is 12) |
labelsize |
Label size (default is 4) |
dec |
Number of cells (default is 3) |
ylim |
y-axis limit |
posi |
Legend position |
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 |
print.on |
Print output |
plot.on |
Plot output |
Value
The table of analysis of variance, the test of normality of errors (Shapiro-Wilk, Lilliefors, Anderson-Darling, Cramer-von Mises, Pearson and Shapiro-Francia), the test of homogeneity of variances (Bartlett), the test of multiple comparisons (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. The function also returns a standardized residual plot.
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.
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.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
Examples
#===================================
# Example tomate
#===================================
# Obs. Consider that the "tomato" experiment is a completely randomized design.
library(AgroR)
data(tomate)
with(tomate, PSUBDIC(parc, subp, bloco, resp, ylab="Dry mass (g)"))
Analysis: Plot subdivided into randomized blocks with a subplot in a double factorial scheme
Description
This function performs the analysis of a randomized block design in a split-plot with a subplot in a double factorial scheme.
Usage
PSUBFAT2DBC(
f1,
f2,
f3,
block,
resp,
alpha.f = 0.05,
alpha.t = 0.05,
norm = "sw",
homog = "bt",
mcomp = "tukey"
)
Arguments
f1 |
Numeric or complex vector with plot levels |
f2 |
Numeric or complex vector with splitplot levels |
f3 |
Numeric or complex vector with splitsplitplot levels |
block |
Numeric or complex vector with blocks |
resp |
Numeric vector with responses |
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) |
norm |
Error normality test (default is Shapiro-Wilk) |
homog |
Homogeneity test of variances (default is Bartlett) |
mcomp |
Multiple comparison test (Tukey (default), LSD and Duncan) |
Value
Analysis of variance of fixed effects and multiple comparison test of Tukey, Scott-Knott, LSD or Duncan.
Examples
f1=rep(c("PD","PDE","C"), e = 40);f1=factor(f1,unique(f1))
f2=rep(c(300,400), e = 20,3);f2=factor(f2,unique(f2))
f3=rep(c("c1", "c2", "c3", "c4"), e = 5,6);f3=factor(f3,unique(f3))
bloco=rep(paste("B",1:5),24); bloco=factor(bloco,unique(bloco))
set.seed(10)
resp=rnorm(120,50,5)
PSUBFAT2DBC(f1,f2,f3,bloco,resp,alpha.f = 0.5) # force triple interaction
PSUBFAT2DBC(f1,f2,f3,bloco,resp,alpha.f = 0.4) # force double interaction
Analysis: DBC experiments in split-split-plot
Description
Analysis of an experiment conducted in a randomized block design in a split-split-plot scheme using analysis of variance of fixed effects.
Usage
PSUBSUBDBC(
f1,
f2,
f3,
block,
response,
alpha.f = 0.05,
alpha.t = 0.05,
dec = 3,
mcomp = "tukey"
)
Arguments
f1 |
Numeric or complex vector with plot levels |
f2 |
Numeric or complex vector with splitplot levels |
f3 |
Numeric or complex vector with splitsplitplot levels |
block |
Numeric or complex vector with blocks |
response |
Numeric vector with responses |
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) |
dec |
Number of cells |
mcomp |
Multiple comparison test (Tukey (default), LSD and Duncan) |
Value
Analysis of variance of fixed effects and multiple comparison test of Tukey, LSD or Duncan.
Note
The PSUBSUBDBC function does not present residual analysis, interaction breakdown, graphs and implementations of various multiple comparison or regression tests. The function only returns the analysis of variance and multiple comparison test of Tukey, LSD or Duncan.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
Examples
library(AgroR)
data(enxofre)
with(enxofre, PSUBSUBDBC(f1, f2, f3, bloco, resp))
Analysis: DBC experiments in strip-plot
Description
Analysis of an experiment conducted in a block randomized design in a strit-plot scheme using fixed effects analysis of variance.
Usage
STRIPLOT(
f1,
f2,
block,
response,
norm = "sw",
alpha.f = 0.05,
transf = 1,
textsize = 12,
labelsize = 4,
constant = 0
)
Arguments
f1 |
Numeric or complex vector with plot levels |
f2 |
Numeric or complex vector with subplot levels |
block |
Numeric or complex vector with blocks |
response |
Numeric vector with responses |
norm |
Error normality test (default is Shapiro-Wilk) |
alpha.f |
Level of significance of the F test (default is 0.05) |
transf |
Applies data transformation (default is 1; for log consider 0) |
textsize |
Font size (default is 12) |
labelsize |
Label size (default is 4) |
constant |
Add a constant for transformation (enter value) |
Value
The table of analysis of variance, the test of normality of errors (Shapiro-Wilk, Lilliefors, Anderson-Darling, Cramer-von Mises, Pearson and Shapiro-Francia), the test of homogeneity of variances (Bartlett). The function also returns a standardized residual plot.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
Examples
#===================================
# Example tomate
#===================================
# Obs. Consider that the "tomato" experiment is a block randomized design in strip-plot.
library(AgroR)
data(tomate)
with(tomate, STRIPLOT(parc, subp, bloco, resp))
Graph: Reverse graph of DICT, DBCT and DQL output when geom="bar"
Description
The function performs the construction of a reverse graph on the output of DICT, DBCT and DQL when geom="bar".
Usage
TBARPLOT.reverse(plot.t)
Arguments
plot.t |
DICT, DBCT or DQLT output when geom="bar" |
Value
Returns a reverse graph of the output of DICT, DBCT or DQLT when geom="bar".
Note
All layout and subtitles are imported from DICT, DBCT and DQLT functions
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
See Also
Examples
data(simulate1)
a=with(simulate1, DICT(trat, tempo, resp,geom="bar",sup=40))
TBARPLOT.reverse(a)
Utils: Area under the curve
Description
Performs the calculation of the area under the progress curve. Initially created for the plant disease area, whose name is "area under the disease progress curve", it can be adapted to various areas of agrarian science.
Usage
aacp(data)
Arguments
data |
Data.frame containing evaluations in columns. Column names must be numeric and not dates or characters |
Value
Returns a vector with the area values under the curve
Note
Just enter the data. Exclude treatment columns. See example.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
References
Campbell, C. L., and Madden, L. V. (1990). Introduction to plant disease epidemiology. John Wiley and Sons.
See Also
Examples
#=======================================
# Using the simulate1 dataset
#=======================================
data("simulate1")
# Converting to readable format for function
dados=cbind(simulate1[simulate1$tempo==1,3],
simulate1[simulate1$tempo==2,3],
simulate1[simulate1$tempo==3,3],
simulate1[simulate1$tempo==4,3],
simulate1[simulate1$tempo==5,3],
simulate1[simulate1$tempo==6,3])
colnames(dados)=c(1,2,3,4,5,6)
dados
# Creating the treatment vector
resp=aacp(dados)
trat=simulate1$trat[simulate1$tempo==1]
# Analyzing by DIC function
DIC(trat,resp)
Dataset: Germination of seeds of Aristolochia sp. as a function of temperature.
Description
The data come from an experiment conducted at the Seed Analysis Laboratory of the Agricultural Sciences Center of the State University of Londrina, in which five temperatures (15, 20, 25, 30 and 35C) were evaluated in the germination of Aristolochia elegans. The experiment was conducted in a completely randomized design with four replications of 25 seeds each.
Usage
data("aristolochia")
Format
data.frame containing data set
trat
numeric vector with factor 1
resp
Numeric vector with response
See Also
cloro, laranja, enxofre, laranja, mirtilo, passiflora, phao, porco, pomegranate, simulate1, simulate2, simulate3, tomate, weather
Examples
data(aristolochia)
Graph: Barplot for Dunnett test
Description
The function performs the construction of a column chart of Dunnett's test.
Usage
bar_dunnett(
output.dunnett,
ylab = "Response",
xlab = "",
fill = c("white", "#F8766D", "#00BFC4"),
sup = NA,
add.mean = TRUE,
round = 2
)
Arguments
output.dunnett |
Numerical or complex vector with treatments |
ylab |
Variable response name (this argument uses the parse function) |
xlab |
Treatments name (this argument uses the parse function) |
fill |
Fill column. Use vector with two elements c(control, different treatment, no difference treatment) |
sup |
Number of units above the standard deviation or average bar on the graph |
add.mean |
Plot the average value on the graph (default is TRUE) |
round |
Number of cells |
Value
Returns a column chart of Dunnett's test. The colors indicate difference from the control.
Examples
#====================================================
# randomized block design in factorial double
#====================================================
library(AgroR)
data(cloro)
attach(cloro)
respAd=c(268, 322, 275, 350, 320)
a=FAT2DBC.ad(f1, f2, bloco, resp, respAd,
ylab="Number of nodules",mcomp="sk")
data=rbind(data.frame(trat=paste(f1,f2,sep = ""),bloco=bloco,resp=resp),
data.frame(trat=c("Test","Test","Test","Test","Test"),
bloco=unique(bloco),resp=respAd))
a= with(data,dunnett(trat = trat,
resp = resp,
control = "Test",
block=bloco,model = "DBC"))
bar_dunnett(a)
Graph: Bar graph for one factor
Description
This is a function of the bar graph for one factor
Usage
bar_graph(model, fill = "lightblue", horiz = TRUE, axis.0 = FALSE)
Arguments
model |
DIC, DBC or DQL object |
fill |
fill bars |
horiz |
Horizontal Column (default is TRUE) |
axis.0 |
If TRUE causes the columns or bars to start just above the axis line. |
Value
Returns a bar chart for one factor
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
See Also
barplot_positive, plot_TH, plot_TH1, corgraph, spider_graph, line_plot, plot_cor, plot_interaction, plot_jitter, seg_graph, TBARPLOT.reverse
Examples
data("laranja")
a=with(laranja, DBC(trat, bloco, resp,
mcomp = "sk",angle=45,
ylab = "Number of fruits/plants"))
bar_graph(a,horiz = FALSE)
Graph: Bar graph for one factor model 2
Description
This is a function of the bar graph for one factor
Usage
bar_graph2(
model,
point.color = "black",
point.size = 2,
point.shape = 16,
text.color = "black",
label.color = "black",
bar.color = "black",
title.size = 14,
y.text = 0,
add.info = NA,
y.info = 0,
width.bar = 0,
color.info = "black",
fill = "lightblue"
)
Arguments
model |
DIC, DBC or DQL object |
point.color |
Point color |
point.size |
Point size |
point.shape |
Format point |
text.color |
Text color |
label.color |
Label color |
bar.color |
Errorbar color |
title.size |
Title size |
y.text |
Y-axis height for x-axis legend |
add.info |
Add other information |
y.info |
Y-axis height for other information |
width.bar |
Width error bar |
color.info |
Color text information |
fill |
Fill bars |
Value
Returns a bar chart for one factor
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
See Also
barplot_positive, plot_TH, plot_TH1, corgraph, spider_graph, line_plot, plot_cor, plot_interaction, plot_jitter, seg_graph, TBARPLOT.reverse
Examples
data("laranja")
a=with(laranja, DBC(trat, bloco, resp,
mcomp = "sk",angle=45,sup = 10,
family = "serif",
ylab = "Number of fruits/plants"))
bar_graph2(a)
bar_graph2(a,fill="darkblue",point.color="orange",text.color='white')
Graph: Bar graph for one factor with facets
Description
This is a function of the bar graph for one factor with facets
Usage
barfacet(
model,
facet = NULL,
theme = theme_bw(),
horiz = FALSE,
geom = "bar",
fill = "lightblue",
pointsize = 4.5,
facet.background = "gray80"
)
Arguments
model |
DIC, DBC or DQL object |
facet |
vector with facets |
theme |
ggplot2 theme |
horiz |
horizontal bar or point (default is FALSE) |
geom |
graph type (columns or segments) |
fill |
fill bars |
pointsize |
Point size |
facet.background |
Color background in facet |
Value
Returns a bar chart for one factor
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
Examples
library(AgroR)
data("laranja")
a=with(laranja, DBC(trat, bloco, resp,
mcomp = "sk",angle=45,sup = 10,family = "serif",
ylab = "Number of fruits/plants"))
barfacet(a,c("S1","S1","S1","S1","S1",
"S2","S2","S3","S3"))
Graph: Group DIC, DBC and DQL functions column charts
Description
Groups two or more column charts exported from DIC, DBC or DQL function
Usage
bargraph_onefactor(
analysis,
labels = NULL,
ocult.facet = FALSE,
ocult.box = FALSE,
facet.size = 14,
ylab = NULL,
width.bar = 0.3,
sup = NULL
)
Arguments
analysis |
List with DIC, DBC or DQL object |
labels |
Vector with the name of the facets |
ocult.facet |
Hide facets |
ocult.box |
Hide box |
facet.size |
Font size facets |
ylab |
Y-axis name |
width.bar |
Width error bar |
sup |
Number of units above the standard deviation or average bar on the graph |
Value
Returns a column chart grouped by facets
Examples
library(AgroR)
data("laranja")
a=with(laranja, DBC(trat, bloco, resp, ylab = "Number of fruits/plants"))
b=with(laranja, DBC(trat, bloco, resp, ylab = "Number of fruits/plants"))
c=with(laranja, DBC(trat, bloco, resp, ylab = "Number of fruits/plants"))
bargraph_onefactor(analysis = list(a,b,c), labels = c("One","Two","Three"),ocult.box = TRUE)
Graph: Group FAT2DIC, FAT2DBC, PSUBDIC or PSUBDBC functions column charts
Description
Groups two or more column charts exported from FAT2DIC, FAT2DBC, PSUBDIC or PSUBDBC function
Usage
bargraph_twofactor(
analysis,
labels = NULL,
ocult.facet = FALSE,
ocult.box = FALSE,
facet.size = 14,
ylab = NULL,
width.bar = 0.3,
sup = NULL
)
Arguments
analysis |
List with DIC, DBC or DQL object |
labels |
Vector with the name of the facets |
ocult.facet |
Hide facets |
ocult.box |
Hide box |
facet.size |
Font size facets |
ylab |
Y-axis name |
width.bar |
Width bar |
sup |
Number of units above the standard deviation or average bar on the graph |
Value
Returns a column chart grouped by facets
Examples
library(AgroR)
data(corn)
a=with(corn, FAT2DIC(A, B, Resp, quali=c(TRUE, TRUE),ylab="Heigth (cm)"))
b=with(corn, FAT2DIC(A, B, Resp, mcomp="sk", quali=c(TRUE, TRUE),ylab="Heigth (cm)"))
bargraph_twofactor(analysis = list(a,b), labels = c("One","Two"),ocult.box = TRUE)
Graph: Positive barplot
Description
Column chart with two variables that assume a positive response and represented by opposite sides, such as dry mass of the area and dry mass of the root
Usage
barplot_positive(
a,
b,
ylab = "Response",
var_name = c("Var1", "Var2"),
legend.title = "Variable",
fill_color = c("darkgreen", "brown"),
width.col = 0.9,
width.bar = 0.2
)
Arguments
a |
Object of DIC, DBC or DQL functions |
b |
Object of DIC, DBC or DQL functions |
ylab |
Y axis names (this argument uses the parse function) |
var_name |
Name of the variable |
legend.title |
Legend title |
fill_color |
Bar fill color |
width.col |
Width Column |
width.bar |
Width error bar |
Value
The function returns a column chart with two positive sides
Note
When there is only an effect of the isolated factor in the case of factorial or subdivided plots, it is possible to use the barplot_positive function.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
See Also
sk_graph, plot_TH, corgraph, spider_graph, line_plot
Examples
data("passiflora")
attach(passiflora)
a=with(passiflora, DBC(trat, bloco, MSPA))
b=with(passiflora, DBC(trat, bloco, MSR))
barplot_positive(a, b, var_name = c("DMAP","DRM"), ylab = "Dry root (g)")
a=with(passiflora, DIC(trat, MSPA,test = "noparametric"))
b=with(passiflora, DIC(trat, MSR))
barplot_positive(a, b, var_name = c("DMAP","DRM"), ylab = "Dry root (g)")
Dataset: Bean
Description
An experiment to evaluate the effect of different strains of Azospirillum on common bean cultivar IPR Sabia was carried out in a greenhouse. A completely randomized design with five strains was used. of Azospirillum (treatments) and five repetitions. The response variable analyzed was grain production per plant (g plant-1).
Usage
data("bean")
Format
data.frame containing data set
trat
numeric vector with treatment
prod
Numeric vector with grain production per plant
See Also
aristolochia, cloro, laranja, enxofre, laranja, mirtilo, passiflora, phao, porco, pomegranate, simulate1, simulate2, simulate3, tomate, weather
Examples
data(bean)
Dataset: Sodium dichloroisocyanurate in soybean
Description
An experiment was conducted in a greenhouse in pots at the State University of Londrina. The work has the objective of evaluating the application of sodium dichloroisocyanurate (DUP) in soybean in 4 periods of application in soybean inoculated or not with Rhizobium and its influence on the number of nodules. The experiment was conducted in a completely randomized design with five replications.
Usage
data(cloro)
Format
data.frame containing data set
f1
Categorical vector with factor 1
f2
Categorical vector with factor 2
bloco
Categorical vector with block
resp
Numeric vector with number nodules
References
Rony Kauling Tonelli. Efeito do uso de dicloroisocianurato de sodio sobre a nodulacao em raizes de soja. 2016. Trabalho de Conclusao de Curso. (Graduacao em Agronomia) - Universidade Estadual de Londrina.
See Also
enxofre, laranja, mirtilo, pomegranate, porco, sensorial, simulate1, simulate2, simulate3, tomate, weather, phao, passiflora, aristolochia
Examples
data(cloro)
Utils: Interval of confidence for groups
Description
Calculates confidence interval for groups
Usage
confinterval(resp, group, alpha = 0.95, type = "upper")
Arguments
resp |
numeric vector with responses |
group |
vector with groups or list with two factors |
alpha |
confidence level of the interval |
type |
lower or upper range |
Value
returns a numeric vector with confidence interval grouped by treatment.
Examples
#===================================
# One factor
#===================================
dados=rnorm(100,10,1)
trat=rep(paste("T",1:10),10)
confinterval(dados,trat)
#===================================
# Two factor
#===================================
f1=rep(c("A","B"),e=50)
f2=rep(paste("T",1:5),e=10,2)
confinterval(dados,list(f1,f2))
Analysis: Joint analysis of experiments in randomized block design
Description
Function of the AgroR package for joint analysis of experiments conducted in a randomized qualitative or quantitative single-block design with balanced data.
Usage
conjdbc(
trat,
block,
local,
response,
transf = 1,
constant = 0,
norm = "sw",
homog = "bt",
homog.value = 7,
theme = theme_classic(),
mcomp = "tukey",
quali = TRUE,
alpha.f = 0.05,
alpha.t = 0.05,
grau = NA,
ylab = "response",
title = "",
xlab = "",
fill = "lightblue",
angulo = 0,
textsize = 12,
dec = 3,
family = "sans",
errorbar = TRUE
)
Arguments
trat |
Numerical or complex vector with treatments |
block |
Numerical or complex vector with blocks |
local |
Numeric or complex vector with locations or times |
response |
Numerical vector containing the response of the experiment. |
transf |
Applies data transformation (default is 1; for log consider 0) |
constant |
Add a constant for transformation (enter value) |
norm |
Error normality test (default is Shapiro-Wilk) |
homog |
Homogeneity test of variances (default is Bartlett) |
homog.value |
Reference value for homogeneity of experiments. By default, this ratio should not be greater than 7 |
theme |
ggplot2 theme (default is theme_classic()) |
mcomp |
Multiple comparison test (Tukey (default), LSD, Scott-Knott and Duncan) |
quali |
Defines whether the factor is quantitative or qualitative (default is qualitative) |
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) |
grau |
Degree of polynomial in case of quantitative factor (default is 1) |
ylab |
Variable response name (this argument uses the parse function) |
title |
Graph title |
xlab |
Treatments name (this argument uses the parse function) |
fill |
Defines chart color (to generate different colors for different treatments, define fill = "trat") |
angulo |
x-axis scale text rotation |
textsize |
Font size |
dec |
Number of cells |
family |
Font family |
errorbar |
Plot the standard deviation bar on the graph (In the case of a segment and column graph) - default is TRUE |
Value
Returns the assumptions of the analysis of variance, the assumption of the joint analysis by means of a QMres ratio matrix, the analysis of variance, the multiple comparison test or regression.
Note
In this function there are three possible outcomes. When the ratio between the experiments is greater than 7, the separate analyzes are returned, without however using the square of the joint residue. When the ratio is less than 7, but with significant interaction, the effects are tested using the square of the joint residual. When there is no significant interaction and the ratio is less than 7, the joint analysis between the experiments is returned.
The ordering of the graph is according to the sequence in which the factor levels are arranged in the data sheet. 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.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
References
Ferreira, P. V. Estatistica experimental aplicada a agronomia. Edufal, 2018.
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.
Examples
library(AgroR)
data(mirtilo)
#===================================
# No significant interaction
#===================================
with(mirtilo, conjdbc(trat, bloco, exp, resp))
#===================================
# Significant interaction
#===================================
data(eucalyptus)
with(eucalyptus, conjdbc(trati, bloc, exp, resp))
Analysis: Joint analysis of experiments in completely randomized design
Description
Function of the AgroR package for joint analysis of experiments conducted in a completely randomized design with a qualitative or quantitative factor with balanced data.
Usage
conjdic(
trat,
repet,
local,
response,
transf = 1,
constant = 0,
norm = "sw",
homog = "bt",
mcomp = "tukey",
homog.value = 7,
quali = TRUE,
alpha.f = 0.05,
alpha.t = 0.05,
grau = NA,
theme = theme_classic(),
ylab = "response",
title = "",
xlab = "",
color = "rainbow",
fill = "lightblue",
angulo = 0,
textsize = 12,
dec = 3,
family = "sans",
errorbar = TRUE
)
Arguments
trat |
Numerical or complex vector with treatments |
repet |
Numerical or complex vector with repetitions |
local |
Numeric or complex vector with locations or times |
response |
Numerical vector containing the response of the experiment. |
transf |
Applies data transformation (default is 1; for log consider 0) |
constant |
Add a constant for transformation (enter value) |
norm |
Error normality test (default is Shapiro-Wilk) |
homog |
Homogeneity test of variances (default is Bartlett) |
mcomp |
Multiple comparison test (Tukey (default), LSD, Scott-Knott and Duncan) |
homog.value |
Reference value for homogeneity of experiments. By default, this ratio should not be greater than 7 |
quali |
Defines whether the factor is quantitative or qualitative (default is qualitative) |
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) |
grau |
Degree of polynomial in case of quantitative factor (default is 1) |
theme |
ggplot2 theme (default is theme_classic()) |
ylab |
Variable response name (this argument uses the parse function) |
title |
Graph title |
xlab |
Treatments name (this argument uses the parse function) |
color |
When the columns are different colors (Set fill-in argument as "trat") |
fill |
Defines chart color (to generate different colors for different treatments, define fill = "trat") |
angulo |
x-axis scale text rotation |
textsize |
Font size |
dec |
Number of cells |
family |
Font family |
errorbar |
Plot the standard deviation bar on the graph (In the case of a segment and column graph) - default is TRUE |
Value
Returns the assumptions of the analysis of variance, the assumption of the joint analysis by means of a QMres ratio matrix, the analysis of variance, the multiple comparison test or regression.
Note
In this function there are three possible outcomes. When the ratio between the experiments is greater than 7, the separate analyzes are returned, without however using the square of the joint residue. When the ratio is less than 7, but with significant interaction, the effects are tested using the square of the joint residual. When there is no significant interaction and the ratio is less than 7, the joint analysis between the experiments is returned.
The ordering of the graph is according to the sequence in which the factor levels are arranged in the data sheet. 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.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
References
Ferreira, P. V. Estatistica experimental aplicada a agronomia. Edufal, 2018.
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.
Examples
library(AgroR)
data(mirtilo)
with(mirtilo, conjdic(trat, bloco, exp, resp))
Analysis: Joint analysis of experiments in randomized block design in scheme factorial double
Description
Function of the AgroR package for joint analysis of experiments conducted in a randomized factorial double in block design with balanced data. The function generates the joint analysis through two models. Model 1: F-test of the effects of Factor 1, Factor 2 and F1 x F2 interaction are used in reference to the mean square of the interaction with the year. Model 2: F-test of the Factor 1, Factor 2 and F1 x F2 interaction effects are used in reference to the mean square of the residual.
Usage
conjfat2dbc(
f1,
f2,
block,
experiment,
response,
transf = 1,
constant = 0,
model = 1,
norm = "sw",
homog = "bt",
homog.value = 7,
alpha.f = 0.05,
alpha.t = 0.05
)
Arguments
f1 |
Numeric or complex vector with factor 1 levels |
f2 |
Numeric or complex vector with factor 2 levels |
block |
Numerical or complex vector with blocks |
experiment |
Numeric or complex vector with locations or times |
response |
Numerical vector containing the response of the experiment. |
transf |
Applies data transformation (default is 1; for log consider 0) |
constant |
Add a constant for transformation (enter value) |
model |
Define model of the analysis of variance |
norm |
Error normality test (default is Shapiro-Wilk) |
homog |
Homogeneity test of variances (default is Bartlett) |
homog.value |
Reference value for homogeneity of experiments. By default, this ratio should not be greater than 7 |
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) |
Value
Returns the assumptions of the analysis of variance, the assumption of the joint analysis by means of a QMres ratio matrix and analysis of variance
Note
The function is still limited to analysis of variance and assumptions only.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
References
Ferreira, P. V. Estatistica experimental aplicada a agronomia. Edufal, 2018.
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.
Examples
library(AgroR)
ano=factor(rep(c(2018,2019,2020),e=48))
f1=rep(rep(c("A","B","C"),e=16),3)
f2=rep(rep(rep(c("a1","a2","a3","a4"),e=4),3),3)
resp=rnorm(48*3,10,1)
bloco=rep(c("b1","b2","b3","b4"),36)
dados=data.frame(ano,f1,f2,resp,bloco)
with(dados,conjfat2dbc(f1,f2,bloco,ano,resp, model=1))
Graph: Plot Pearson correlation with interval of confidence
Description
Plot Pearson correlation with interval of confidence
Usage
cor_ic(
data,
background = TRUE,
axis.size = 12,
ylab = "",
xlab = "Correlation (r)",
theme = theme_classic()
)
Arguments
data |
data.frame with responses |
background |
background fill (default is TRUE) |
axis.size |
Axes font size (default is 12) |
ylab |
Variable response name (Accepts the expression() function) |
xlab |
Treatments name (Accepts the expression() function) |
theme |
ggplot theme (default is theme_classic()) |
Value
The function returns a new graphical approach to correlation.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
Examples
data("pomegranate")
cor_ic(pomegranate[,-1])
Graph: Correlogram
Description
Correlation analysis function (Pearson or Spearman)
Usage
corgraph(
data,
axissize = 12,
legendsize = 12,
legendposition = c(0.9, 0.2),
legendtitle = "Correlation",
method = "pearson",
pallete = "RdBu",
color.marginal = "gray50",
size.tile.lty = 1,
size.label.cor = 1,
fill.label.cor = "lightyellow",
font.family = "sans"
)
Arguments
data |
data.frame with responses |
axissize |
Axes font size (default is 12) |
legendsize |
Legend font size (default is 12) |
legendposition |
Legend position (default is c(0.9,0.2)) |
legendtitle |
Legend title (default is "Correlation") |
method |
Method correlation (default is Pearson) |
pallete |
If a string, will use that named palette. See scale_fill_distiller in the ggplot2. |
color.marginal |
Box border color |
size.tile.lty |
Box margin line thickness |
size.label.cor |
Label font size |
fill.label.cor |
Label fill color |
font.family |
Font family (default is sans) |
Value
The function returns a correlation matrix
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
Examples
data("pomegranate")
corgraph(pomegranate[,-1])
Dataset: Corn
Description
A 3 x 2 factorial experiment was carried out to compare three new corn hybrids considering the change in sowing density, being 55 thousand or 65 thousand seeds per hectare. For this case, the researcher is not interested in estimating values for other densities, but only in verifying if one density differs from the other. The experiment was carried out according to a completely randomized design with 4 repetitions of each treatment.
Usage
data(corn)
Format
data.frame containing data set
A
Categorical vector with hybrids
B
Categorical vector with density
resp
Numeric vector with response
See Also
enxofre, laranja, mirtilo, pomegranate, porco, sensorial, simulate1, simulate2, simulate3, tomate, weather, phao, passiflora, aristolochia
Examples
data(corn)
Dataset: Covercrops
Description
Consider a 3 ×3 factorial experiment in randomized blocks, with 4 replications, on the influence of three new soybean cultivars (A1, A2 and A3) and the use of three types of green manure (B1, B2 and B3) on yield in 100 m2 plots.
Usage
data(covercrops)
Format
data.frame containing data set
A
Categorical vector with cultivars
B
Categorical vector with green manure
Bloco
Categorical vector with block
Resp
Numeric vector with yield
See Also
enxofre, laranja, mirtilo, pomegranate, porco, sensorial, simulate1, simulate2, simulate3, tomate, weather, phao, passiflora, aristolochia
Examples
data(covercrops)
Analysis: Randomized block design with an additional treatment for quantitative factor
Description
Statistical analysis of experiments conducted in a randomized block design with an additional treatment and balanced design with a factor considering the fixed model.
Usage
dbc.ad(
trat,
block,
response,
responsead,
grau = 1,
norm = "sw",
homog = "bt",
alpha.f = 0.05,
theme = theme_classic(),
ylab = "response",
xlab = "independent",
family = "sans",
posi = "top",
pointsize = 4.5,
linesize = 0.8,
width.bar = NA,
point = "mean_sd"
)
Arguments
trat |
Numerical or complex vector with treatments |
block |
Numerical or complex vector with blocks |
response |
Numerical vector containing the response of the experiment. |
responsead |
Numerical vector with additional treatment responses |
grau |
Degree of polynomial in case of quantitative factor (default is 1) |
norm |
Error normality test (default is Shapiro-Wilk) |
homog |
Homogeneity test of variances (default is Bartlett) |
alpha.f |
Level of significance of the F test (default is 0.05) |
theme |
ggplot2 theme (default is theme_classic()) |
ylab |
Variable response name (this argument uses the parse function) |
xlab |
Treatments name (this argument uses the parse function) |
family |
Font family |
posi |
Legend position |
pointsize |
Point size |
linesize |
line size (Trendline and Error Bar) |
width.bar |
width of the error bars of a regression graph. |
point |
Defines whether to plot mean ("mean"), mean with standard deviation ("mean_sd" - default) or mean with standard error (default - "mean_se"). For quali=FALSE or quali=TRUE. |
Value
The table of analysis of variance, the test of normality of errors (Shapiro-Wilk ("sw"), Lilliefors ("li"), Anderson-Darling ("ad"), Cramer-von Mises ("cvm"), Pearson ("pearson") and Shapiro-Francia ("sf")), the test of homogeneity of variances (Bartlett ("bt") or Levene ("levene")), the test of independence of Durbin-Watson errors, adjustment of regression models up to grade 3 polynomial. The function also returns a standardized residual plot.
Note
In some experiments, the researcher may study a quantitative factor, such as fertilizer doses, and present a control, such as a reference fertilizer, treated as a qualitative control. In these cases, there is a difference between considering only the residue in the unfolding of the polynomial, removing or not the qualitative treatment, or since a treatment is excluded from the analysis. In this approach, the residue used is also considering the qualitative treatment, a method similar to the factorial scheme with additional control.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
Examples
doses = c(rep(c(1:5),e=3))
resp = c(3, 4, 3, 5, 5, 6, 7, 7, 8, 4, 4, 5, 2, 2, 3)
bloco = rep(c("B1","B2","B3","B4","B5"),3)
dbc.ad(doses, bloco, resp, responsead=rnorm(3,6,0.1),grau=2)
Descriptive: Descriptive analysis
Description
Performs the descriptive analysis of an experiment with a factor of interest.
Usage
desc(trat, response, ylab = "Response", xlab = "Treatment", ylim = NA)
Arguments
trat |
Numerical or complex vector with treatments |
response |
Numerical vector containing the response of the experiment. |
ylab |
Variable response name (this argument uses the parse function) |
xlab |
x name (this argument uses the parse function) |
ylim |
y-axis scale |
Value
The function returns exploratory measures of position and dispersion, such as mean, median, maximum, minimum, coefficient of variation, etc ...
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
See Also
Examples
library(AgroR)
data("pomegranate")
with(pomegranate, desc(trat,WL))
Descriptive: Descriptive analysis (Two factors)
Description
It performs the descriptive analysis of an experiment with two factors of interest.
Usage
desc2fat(
f1,
f2,
response,
ylab = "Response",
xlab = c("F1", "F2"),
theme = theme_classic()
)
Arguments
f1 |
Numeric or complex vector with factor 1 levels |
f2 |
Numeric or complex vector with factor 2 levels |
response |
Numerical vector containing the response of the experiment. |
ylab |
Variable response name (Accepts the expression() function) |
xlab |
x name (this argument uses the parse function) |
theme |
ggplot2 theme (default is theme_classic()) |
Value
The function returns exploratory measures of position and dispersion, such as mean, median, maximum, minimum, coefficient of variation, etc ...
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
Examples
library(AgroR)
data(cloro)
output=with(cloro, desc2fat(f1,f2,resp))
output$plot_single
output$plot_interaction
Descriptive: Descriptive analysis (Three factors)
Description
Performs the descriptive graphical analysis of an experiment with three factors of interest.
Usage
desc3fat(
f1,
f2,
f3,
response,
legend.title = "Legend",
xlab = c("F1", "F2", "F3"),
ylab = "Response",
theme = theme_classic(),
plot = "interaction"
)
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 |
response |
Numerical vector containing the response of the experiment. |
legend.title |
Legend title |
xlab |
x name (this argument uses the parse function) |
ylab |
Variable response name (this argument uses the parse function) |
theme |
ggplot theme |
plot |
"interaction" or "box" |
Value
The function returns a triple interaction graph.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
Examples
library(AgroR)
data(enxofre)
with(enxofre, desc3fat(f1, f2, f3, resp))
Analysis: Regression analysis by orthogonal polynomials for double factorial scheme with additional control
Description
Regression analysis by orthogonal polynomials for double factorial scheme with additional control. Cases in which the additional belongs to the regression curve, being common to the qualitative levels. In these cases, the additional (usually dose 0/control treatment) is not part of the factor arrangement. One option addressed by this function is to analyze a priori as a double factorial scheme with an additional one and correct the information a posteriore using information from the initial analysis, such as the degree of freedom and the sum of squares of the residue.
Usage
desd_fat2_quant_ad(output, ad.value = 0, design = "FAT2DIC.ad", grau = 1)
Arguments
output |
Output from a FAT2DIC.ad or FAT2DBC.ad function (Use quantity factor as f2). |
ad.value |
Additional treatment quantitative factor level |
design |
Type of experimental project (FAT2DIC.ad or FAT2DBC.ad) |
grau |
Degree of the polynomial (only for the isolated effect of the quantitative factor) |
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
Examples
#==================================================
# Data set
trat=rep(c("A","B","C"),e=12)
dose=rep(rep(c(200,400,600,800),e=3),3)
d0=c(40,45,48)
respo=c(60,55,56, 60,65,66, 70,75,76,
80,85,86, 50,55,56, 70,75,76,
60,65,66, 50,45,46, 50,45,46,
50,55,66, 70,75,76, 80,85,86)
repe=rep(c("R1","R2","R3"),12)
#==================================================
# Analysis FAT2DIC.ad
resu=FAT2DIC.ad(trat,dose,repe = repe,respo,responseAd = d0,quali = c(TRUE,FALSE),grau21 = c(1,2,1))
#==================================================
# Regression analysis
desd_fat2_quant_ad(resu,ad.value=0,design="FAT2DIC.ad")
# Data set
trat=rep(c("A","B"),e=12)
dose=rep(rep(c(200,400,600,800),e=3),2)
d0=c(40,45,48)
respo=c(60,55,56,60,65,66,70,75,76,80,85,86,50,45,46,50,55,66,70,75,76,80,85,86)
repe=rep(c("R1","R2","R3"),8)
#==================================================
# Analysis FAT2DIC.ad
resu=FAT2DIC.ad(trat,dose,repe = repe,respo,responseAd = d0,quali = c(TRUE,FALSE))
#==================================================
# Regression analysis
desd_fat2_quant_ad(resu,ad.value=0,design="FAT2DIC.ad",grau=1)
Analysis: Completely randomized design with an additional treatment for quantitative factor
Description
Statistical analysis of experiments conducted in a completely randomized with an additional treatment and balanced design with a factor considering the fixed model.
Usage
dic.ad(
trat,
response,
responsead,
grau = 1,
norm = "sw",
homog = "bt",
alpha.f = 0.05,
theme = theme_classic(),
ylab = "response",
xlab = "independent",
family = "sans",
posi = "top",
pointsize = 4.5,
linesize = 0.8,
width.bar = NA,
point = "mean_sd"
)
Arguments
trat |
Numerical or complex vector with treatments |
response |
Numerical vector containing the response of the experiment. |
responsead |
Numerical vector with additional treatment responses |
grau |
Degree of polynomial in case of quantitative factor (default is 1) |
norm |
Error normality test (default is Shapiro-Wilk) |
homog |
Homogeneity test of variances (default is Bartlett) |
alpha.f |
Level of significance of the F test (default is 0.05) |
theme |
ggplot2 theme (default is theme_classic()) |
ylab |
Variable response name (this argument uses the parse function) |
xlab |
Treatments name (this argument uses the parse function) |
family |
Font family |
posi |
Legend position |
pointsize |
Point size |
linesize |
line size (Trendline and Error Bar) |
width.bar |
width of the error bars of a regression graph. |
point |
Defines whether to plot mean ("mean"), mean with standard deviation ("mean_sd" - default) or mean with standard error (default - "mean_se"). For quali=FALSE or quali=TRUE. |
Value
The table of analysis of variance, the test of normality of errors (Shapiro-Wilk ("sw"), Lilliefors ("li"), Anderson-Darling ("ad"), Cramer-von Mises ("cvm"), Pearson ("pearson") and Shapiro-Francia ("sf")), the test of homogeneity of variances (Bartlett ("bt") or Levene ("levene")), the test of independence of Durbin-Watson errors, adjustment of regression models up to grade 3 polynomial. The function also returns a standardized residual plot.
Note
In some experiments, the researcher may study a quantitative factor, such as fertilizer doses, and present a control, such as a reference fertilizer, treated as a qualitative control. In these cases, there is a difference between considering only the residue in the unfolding of the polynomial, removing or not the qualitative treatment, or since a treatment is excluded from the analysis. In this approach, the residue used is also considering the qualitative treatment, a method similar to the factorial scheme with additional control.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
Examples
datadicad=data.frame(doses = c(rep(c(1:5),e=3)),
resp = c(3,4,3,5,5,6,7,7,8,4,4,5,2,2,3))
with(datadicad,dic.ad(doses, resp, rnorm(3,6,0.1),grau=2))
Descriptive: Boxplot with standardized data
Description
It makes a graph with the variables and/or treatments with the standardized data.
Usage
dispvar(
data,
trat = NULL,
theme = theme_bw(),
ylab = "Standard mean",
xlab = "Variable",
family = "serif",
textsize = 12,
fill = "lightblue"
)
Arguments
data |
data.frame containing the response of the experiment. |
trat |
Numerical or complex vector with treatments |
theme |
ggplot2 theme (default is theme_bw()) |
ylab |
Variable response name (Accepts the expression() function) |
xlab |
Treatments name (Accepts the expression() function) |
family |
Font family |
textsize |
Font size |
fill |
Defines chart color |
Value
Returns a chart of boxes with standardized data
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
Examples
library(AgroR)
data("pomegranate")
dispvar(pomegranate[,-1])
trat=pomegranate$trat
dispvar(pomegranate[,-1], trat)
Analysis: Post-hoc Dunn
Description
Perform Kruskal wallis and dunn post-hoc test
Usage
dunn(trat, resp, method = "holm", alpha = 0.05, decreasing = TRUE)
Arguments
trat |
Numerical or complex vector with treatments |
resp |
Vector with response |
method |
the p-value for multiple comparisons ("none", "bonferroni", "sidak", "holm", "hs", "hochberg", "bh", "by"). The default is no adjustment for multiple comparisons |
alpha |
Significance level of the post-hoc (default is 0.05) |
decreasing |
Should the order of the letters be increasing or decreasing. |
Value
Kruskal-wallis and dunn's post-hoc test returns
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Examples
library(AgroR)
data(pomegranate)
with(pomegranate, dunn(trat, WL))
Analysis: Dunnett test
Description
The function performs the Dunnett test
Usage
dunnett(
trat,
resp,
control,
model = "DIC",
block = NA,
column = NA,
line = NA,
alpha.t = 0.05,
pointsize = 5,
pointshape = 21,
linesize = 1,
labelsize = 4,
textsize = 12,
errorsize = 1,
widthsize = 0.2,
label = "Response",
family = "sans"
)
Arguments
trat |
Numerical or complex vector with treatments |
resp |
Numerical vector containing the response of the experiment. |
control |
Treatment considered control (write identical to the name in the vector) |
model |
Experimental design (DIC, DBC or DQL) |
block |
Numerical or complex vector with blocks |
column |
Numerical or complex vector with columns |
line |
Numerical or complex vector with lines |
alpha.t |
Significance level (default is 0.05) |
pointsize |
Point size |
pointshape |
Shape |
linesize |
Line size |
labelsize |
Label size |
textsize |
Font size |
errorsize |
Errorbar size |
widthsize |
Width errorbar |
label |
Variable label |
family |
font family |
Value
I return the Dunnett test for experiments in a completely randomized design, randomized blocks or Latin square.
Note
Do not use the "-" symbol or space in treatment names
Examples
#====================================================
# complete randomized design
#====================================================
data("pomegranate")
with(pomegranate,dunnett(trat=trat,resp=WL,control="T1"))
#====================================================
# randomized block design in factorial double
#====================================================
library(AgroR)
data(cloro)
attach(cloro)
respAd=c(268, 322, 275, 350, 320)
a=FAT2DBC.ad(f1, f2, bloco, resp, respAd,
ylab="Number of nodules", mcomp="sk")
data=rbind(data.frame(trat=paste(f1,f2,sep = ""),bloco=bloco,resp=resp),
data.frame(trat=c("Test","Test","Test","Test","Test"),
bloco=unique(bloco),resp=respAd))
with(data,dunnett(trat = trat,
resp = resp,
control = "Test",
block=bloco,model = "DBC"))
Dataset: Emergence of passion fruit seeds over time .
Description
The data come from an experiment conducted at the State University of Londrina, aiming to study the emergence of yellow passion fruit seeds over time. Data are partial from one of the treatments studied. Four replicates with eight seeds each were used.
Usage
data("emerg")
Format
data.frame containing data set
time
numeric vector with time
resp
Numeric vector with emergence
See Also
aristolochia, cloro, laranja, enxofre, laranja, mirtilo, passiflora, phao, porco, pomegranate, simulate1, simulate2, simulate3, tomate, weather
Examples
data(emerg)
Dataset: Sulfur data
Description
The experiment was carried out in a randomized block design in a 3 x 3 x 3 triple factorial scheme: syrup volume (75, 225 and 675 L), sulfur doses (150, 450, 1350) and time of application (vegetative, complete cycle and reproductive system) with four repetitions. Yield in kg / ha of soybean was evaluated.
Usage
data(enxofre)
Format
data.frame containing data set
f1
Categorical vector with factor 1
f2
Categorical vector with factor 2
f2
Categorical vector with factor 3
bloco
Categorical vector with block
resp
Numeric vector
See Also
cloro, laranja, mirtilo, pomegranate, porco, sensorial, simulate1, simulate2, simulate3, tomate, weather, phao, passiflora, aristolochia
Examples
data(enxofre)
Dataset: Eucaliptus grandis Barbin (2013)
Description
The data refer to the height in meters of *Eucalyptus grandis* plants, with 7 years of age, from three trials (Araraquara - Exp 1; Bento Quintino - Exp 2; Mogi-Guacu - Exp 3) in randomized blocks, under 6 progenies. The data were taken from the book by Decio Barbin (2013) and are from the Instituto Florestal de Tupi/SP.
Usage
data("eucalyptus")
Format
data.frame containing data set
trati
Categorical vector with treatments
bloc
Categorical vector with block
exp
Categorical vector with experiment
resp
Numeric vector
References
Planejamento e Analise Estatistica de Experimentos Agronomicos (2013) - Decio Barbin - pg. 177
See Also
cloro, enxofre, laranja, pomegranate, porco, sensorial, simulate1, simulate2, simulate3, tomate, weather
Examples
data(eucalyptus)
Utils: Summary of the analysis for factor arrangement with two qualitative factors.
Description
Summarizes the output returned in the summarise_anova function in list form. The advantage is that the table, in the case of significant interaction, is returned in a format that facilitates assembly in terms of scientific publication.
Usage
fat2_table(output, nf1, nf2, column = 1)
Arguments
output |
Output of summarise_anova function for FAT2DIC, FAT2DIC.ad, FAT2DBC, FAT2DBC.ad, PSUBDIC and PSUBDBC design. |
nf1 |
Number of levels of factor 1 |
nf2 |
Number of levels of factor 2 |
column |
Variable column |
Value
returns a list containing analysis output for experiments in FAT2DIC, FAT2DIC.ad, FAT2DBC, FAT2DBC.ad, PSUBDIC and PSUBDBC design.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Examples
#==============================================================
data(corn)
attach(corn)
a=FAT2DIC(A, B, Resp, quali=c(TRUE, TRUE))
output_1=summarise_anova(list(a),design="FAT2DIC",divisor = FALSE)
fat2_table(output_1,nf1=3,nf2=2,column=1)
#==============================================================
data(cloro)
respAd=c(268, 322, 275, 350, 320)
resu=with(cloro, FAT2DIC.ad(f1, f2, bloco, resp, respAd))
output_2=summarise_anova(list(resu),design="FAT2DIC.ad",divisor = FALSE)
fat2_table(output_2,nf1=2,nf2=4,column=1)
utils: group graphs of the output of simple experiments in dic, dbc or dql
Description
group graphs of the output of simple experiments into dic, dbc or dql. It is possible to group up to 6 graphs in different arrangements (see model argument)
Usage
grid.onefactor(output, model = "type1")
Arguments
output |
List with the outputs of the DIC, DBC or DQL functions |
model |
Graph arrangement model, see in detail. |
Details
- 'type1': Two graphs next to each other - 'type2': Two graphs one below the other - 'type3': Three graphs, two top and one centered below - 'type4': Three graphs one below the other - 'type5': Four graphs, two at the top and two at the bottom - 'type6': Four graphs one below the other - 'type7': Five graphs, two at the top, two in the middle and one centered at the bottom - 'type8': Five graphs, three at the top, two centered at the bottom - 'type9': Six graphs, three at the top, three centered at the bottom - 'type10': Six graphs, two at the top, two in the middle and two at the bottom
Value
returns grouped graphs
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
Examples
data("pomegranate")
attach(pomegranate)
a=DIC(trat, WL, geom = "point", ylab = "WL")
b=DIC(trat, SS, geom = "point", ylab="SS")
c=DIC(trat, AT, geom = "point", ylab = "AT")
grid.onefactor(list(a,b),model = "type1")
grid.onefactor(list(a,b),model = "type2")
grid.onefactor(list(a,b,c),model = "type3")
grid.onefactor(list(a,b,c),model = "type4")
Graph: Invert letters for two factor chart
Description
invert uppercase and lowercase letters in graph for factorial scheme the subdivided plot with significant interaction
Usage
ibarplot.double(analysis)
Arguments
analysis |
FAT2DIC, FAT2DBC, PSUBDIC or PSUBDBC object |
Value
Return column chart for two factors
Examples
data(covercrops)
attach(covercrops)
a=FAT2DBC(A, B, Bloco, Resp, ylab=expression("Yield"~(Kg~"100 m"^2)),
legend = "Cover crops",alpha.f = 0.3,family = "serif")
ibarplot.double(a)
Analysis: Method to evaluate similarity of experiments based on QMres
Description
This function presents a method to evaluate similarity of experiments based on a matrix of QMres of all against all. This is used as a measure of similarity and applied in clustering.
Usage
jointcluster(qmres, information = "matrix", method.cluster = "ward.D")
Arguments
qmres |
Vector containing mean squares of residuals or output from list DIC or DBC function |
information |
Option to choose the return type. 'matrix', 'bar' or 'cluster' |
method.cluster |
Grouping method |
Value
Returns a residual mean square ratio matrix, bar graph with ratios sorted in ascending order, or cluster analysis.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Examples
qmres=c(0.344429, 0.300542, 0.124833, 0.04531, 0.039571, 0.011812, 0.00519)
jointcluster(qmres,information = "cluster")
jointcluster(qmres,information = "matrix")
jointcluster(qmres,information = "bar")
data(mirtilo)
m=lapply(unique(mirtilo$exp),function(x){
m=with(mirtilo[mirtilo$exp==x,],DBC(trat,bloco,resp))})
jointcluster(m)
Dataset: Orange plants under different rootstocks
Description
An experiment was conducted with the objective of studying the behavior of nine rootstocks for the Valencia orange tree. The data set refers to the 1973 evaluation (12 years old). The rootstocks are: T1: Tangerine Sunki; T2: National rough lemon; T3: Florida rough lemon; T4: Cleopatra tangerine; T5: Citranger-troyer; T6: Trifoliata; T7: Clove Tangerine; T8: Country orange; T9: Clove Lemon. The number of fruits per plant was evaluated.
Usage
data(laranja)
Format
data.frame containing data set
f1
Categorical vector with treatments
bloco
Categorical vector with block
resp
Numeric vector with number of fruits per plant
References
Planejamento e Analise Estatistica de Experimentos Agronomicos (2013) - Decio Barbin - pg. 72
See Also
cloro, enxofre, mirtilo, pomegranate, porco, sensorial, simulate1, simulate2, simulate3, tomate, weather, phao, passiflora, aristolochia
Examples
data(laranja)
Graph: Line chart
Description
Performs a descriptive line graph with standard deviation bars
Usage
line_plot(
time,
response,
factor = NA,
errorbar = "sd",
ylab = "Response",
xlab = "Time",
legend.position = "right",
theme = theme_classic()
)
Arguments
time |
Vector containing the x-axis values |
response |
Vector containing the y-axis values |
factor |
Vector containing a categorical factor |
errorbar |
Error bars (sd or se) |
ylab |
y axis title (this argument uses the parse function) |
xlab |
x axis title (this argument uses the parse function) |
legend.position |
Legend position |
theme |
ggplot2 theme (default is theme_classic()) |
Value
Returns a line chart with error bars
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
See Also
sk_graph, plot_TH, corgraph, spider_graph
Examples
dose=rep(c(0,2,4,6,8,10),e=3,2)
resp=c(seq(1,18,1),seq(2,19,1))
fator=rep(c("A","B"),e=18)
line_plot(dose,resp,fator)
Analysis: Logistic regression
Description
Logistic regression is a very popular analysis in agrarian sciences, such as in fruit growth curves, seed germination, etc...The logistic function performs the analysis using 3 or 4 parameters of the logistic model, being imported from the LL function .3 or LL.4 of the drc package (Ritz & Ritz, 2016).
Usage
logistic(
trat,
resp,
npar = "LL.3",
error = "SE",
ylab = "Dependent",
xlab = expression("Independent"),
theme = theme_classic(),
legend.position = "top",
r2 = "all",
width.bar = NA,
scale = "none",
textsize = 12,
font.family = "sans"
)
Arguments
trat |
Numerical or complex vector with treatments |
resp |
Numerical vector containing the response of the experiment. |
npar |
Number of model parameters |
error |
Error bar (It can be SE - default, SD or FALSE) |
ylab |
Variable response name (Accepts the expression() function) |
xlab |
Treatments name (Accepts the expression() function) |
theme |
ggplot2 theme (default is theme_bw()) |
legend.position |
Legend position (default is c(0.3,0.8)) |
r2 |
Coefficient of determination of the mean or all values (default is all) |
width.bar |
Bar width |
scale |
Sets x scale (default is none, can be "log") |
textsize |
Font size |
font.family |
Font family (default is sans) |
Details
The three-parameter log-logistic function with lower limit 0 is
f(x) = 0 + \frac{d}{1+\exp(b(\log(x)-\log(e)))}
The four-parameter log-logistic function is given by the expression
f(x) = c + \frac{d-c}{1+\exp(b(\log(x)-\log(e)))}
The function is symmetric about the inflection point (e).
Value
The function allows the automatic graph and equation construction of the logistic model, provides important statistics, such as the Akaike (AIC) and Bayesian (BIC) inference criteria, coefficient of determination (r2), square root of the mean error ( RMSE).
Author(s)
Model imported from the drc package (Ritz et al., 2016)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
References
Seber, G. A. F. and Wild, C. J (1989) Nonlinear Regression, New York: Wiley and Sons (p. 330).
Ritz, C.; Strebig, J.C.; Ritz, M.C. Package ‘drc’. Creative Commons: Mountain View, CA, USA, 2016.
Examples
data("emerg")
with(emerg, logistic(time, resp,xlab="Time (days)",ylab="Emergence (%)"))
with(emerg, logistic(time, resp,npar="LL.4",xlab="Time (days)",ylab="Emergence (%)"))
Dataset: Cutting blueberry data
Description
An experiment was carried out in order to evaluate the rooting (resp1) of blueberry cuttings as a function of the cutting size (Treatment Colume). This experiment was repeated three times (Location column) and a randomized block design with four replications was adopted.
Usage
data(mirtilo)
Format
data.frame containing data set
trat
Categorical vector with treatments
exp
Categorical vector with experiment
bloco
Categorical vector with block
resp
Numeric vector
See Also
cloro, enxofre, laranja, pomegranate, porco, sensorial, simulate1, simulate2, simulate3, tomate, weather
Examples
data(mirtilo)
attach(mirtilo)
Dataset: Orchard
Description
An experiment was carried out to analyze the treatments in orchards applied in the rows and between the rows, in a split-plot scheme according to a randomized block design. For this case, the line and leading are considered the levels of the factor applied in the plots and the treatments are considered the levels of the factor applied in the subplots. Microbial biomass carbon was analyzed.
Usage
data(orchard)
Format
data.frame containing data set
A
Categorical vector with plot
B
Categorical vector with split-plot
Bloco
Categorical vector with block
Resp
Numeric vector with microbial biomass carbon
See Also
enxofre, laranja, mirtilo, pomegranate, porco, sensorial, simulate1, simulate2, simulate3, tomate, weather, phao, passiflora, aristolochia
Examples
data(orchard)
Dataset: Substrate data in the production of passion fruit seedlings
Description
An experiment was carried out in order to evaluate the influence of the substrate on the dry mass of aerial part and root in yellow sour passion fruit. The experiment was conducted in a randomized block design with four replications. The treatments consisted of five substrates (Vermiculite, MC Normal, Carolina Soil, Mc organic and sand)
Usage
data(passiflora)
Format
data.frame containing data set
trat
Categorical vector with substrate
bloco
Categorical vector with block
MSPA
Numeric vector with dry mass of aerial part
MSR
Numeric vector with dry mass of root
See Also
cloro, enxofre, laranja, mirtilo, pomegranate, porco, sensorial, simulate1, simulate2, simulate3, tomate, weather
Examples
data(passiflora)
Dataset: Pepper
Description
A vegetable breeder is characterizing five mini pepper accessions from the State University of Londrina germplasm bank for agronomic and biochemical variables. The experiment was conducted in a completely randomized design with four replications
Usage
data(pepper)
Format
data.frame containing data set
Acesso
Categorical vector with accessions
MS
Numeric vector com dry mass
VitC
Numeric vector with Vitamin C
See Also
enxofre, laranja, mirtilo, pomegranate, porco, sensorial, simulate1, simulate2, simulate3, tomate, weather, phao, passiflora, aristolochia
Examples
data(pepper)
Dataset: Osmocote in Phalaenopsis sp.
Description
The objective of the work was to evaluate the effect of doses of osmocote (15-09-12-N-P2O5-K2O, respectively) on the initial development of the orchid Phalaenopsis sp. The osmocote fertilizer was added in the following doses: 0, 2, 4, 6 and 8 g vase-1. After twelve months, leaf length was evaluated.
Usage
data(phao)
Format
data.frame containing data set
dose
Numeric vector with doses
comp
Numeric vector with leaf length
References
de Paula, J. C. B., Junior, W. A. R., Shimizu, G. D., Men, G. B., & de Faria, R. T. (2020). Fertilizante de liberacao controlada no crescimento inicial da orquidea Phalaenopsis sp. Revista Cultura Agronomica, 29(2), 289-299.
See Also
pomegranate, passiflora, cloro, enxofre, laranja, mirtilo, porco, sensorial, simulate1, simulate2, simulate3, tomate, weather
Examples
data(phao)
Graph: Climate chart of temperature and humidity
Description
The plot_TH function allows the user to build a column/line graph with climatic parameters of temperature (maximum, minimum and average) and relative humidity (UR) or precipitation. This chart is widely used in scientific work in agrarian science
Usage
plot_TH(
tempo,
Tmed,
Tmax,
Tmin,
UR,
xlab = "Time",
yname1 = expression("Humidity (%)"),
yname2 = expression("Temperature ("^o * "C)"),
legend.H = "Humidity",
legend.tmed = "Tmed",
legend.tmin = "Tmin",
legend.tmax = "Tmax",
colormax = "red",
colormin = "blue",
colormean = "darkgreen",
fillbar = "gray80",
limitsy1 = c(0, 100),
x = "days",
breaks = "1 months",
textsize = 12,
legendsize = 12,
titlesize = 12,
linesize = 1,
date_format = "%m-%Y",
sc = 2.5,
angle = 0,
legend.position = "bottom",
theme = theme_classic()
)
Arguments
tempo |
Vector with times |
Tmed |
Vector with mean temperature |
Tmax |
Vector with maximum temperature |
Tmin |
Vector with minimum temperature |
UR |
Vector with relative humidity or precipitation |
xlab |
x axis name |
yname1 |
y axis name |
yname2 |
Secondary y-axis name |
legend.H |
Legend column |
legend.tmed |
Legend mean temperature |
legend.tmin |
Legend minimum temperature |
legend.tmax |
Legend maximum temperature |
colormax |
Maximum line color (default is "red") |
colormin |
Minimum line color (default is "blue") |
colormean |
Midline color (default is "darkgreen") |
fillbar |
Column fill color (default is "gray80") |
limitsy1 |
Primary y-axis scale (default is c(0,100)) |
x |
x scale type (days or data, default is "days") |
breaks |
Range for x scale when x = "date" (default is 1 months) |
textsize |
Axis text size |
legendsize |
Legend text size |
titlesize |
Axis title size |
linesize |
Line size |
date_format |
Date format for x="data" |
sc |
Scale for secondary y-axis in relation to primary y-axis (declare the number of times that y2 is less than or greater than y1, the default being 2.5) |
angle |
x-axis scale text rotation |
legend.position |
Legend position |
theme |
ggplot2 theme |
Value
Returns row and column graphs for graphical representation of air temperature and relative humidity. Graph normally used in scientific articles
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
See Also
sk_graph, barplot_positive, corgraph, plot_TH1, spider_graph, line_plot
Examples
library(AgroR)
data(weather)
with(weather, plot_TH(tempo, Tmed, Tmax, Tmin, UR))
Graph: Climate chart of temperature and humidity (Model 2)
Description
The plot_TH1 function allows the user to build a column/line graph with climatic parameters of temperature (maximum, minimum and average) and relative humidity (UR) or precipitation. This chart is widely used in scientific work in agrarian science
Usage
plot_TH1(
tempo,
Tmed,
Tmax,
Tmin,
UR,
xlab = "Time",
yname1 = expression("Humidity (%)"),
yname2 = expression("Temperature ("^o * "C)"),
legend.T = "Temperature",
legend.H = "Humidity",
legend.tmed = "Tmed",
legend.tmin = "Tmin",
legend.tmax = "Tmax",
colormax = "red",
colormin = "blue",
colormean = "darkgreen",
fillarea = "darkblue",
facet.fill = "#FF9933",
panel.grid = FALSE,
x = "days",
breaks = "1 months",
textsize = 12,
legendsize = 12,
titlesize = 12,
linesize = 1,
date_format = "%m-%Y",
angle = 0,
legend.position = c(0.1, 0.3)
)
Arguments
tempo |
Vector with times |
Tmed |
Vector with mean temperature |
Tmax |
Vector with maximum temperature |
Tmin |
Vector with minimum temperature |
UR |
Vector with relative humidity or precipitation |
xlab |
x axis name |
yname1 |
y axis name |
yname2 |
Secondary y-axis name |
legend.T |
faceted title legend 1 |
legend.H |
faceted title legend 2 |
legend.tmed |
Legend mean temperature |
legend.tmin |
Legend minimum temperature |
legend.tmax |
Legend maximum temperature |
colormax |
Maximum line color (default is "red") |
colormin |
Minimum line color (default is "blue") |
colormean |
Midline color (default is "darkgreen") |
fillarea |
area fill color (default is "darkblue") |
facet.fill |
faceted title fill color (default is #FF9933) |
panel.grid |
remove grid line (default is FALSE) |
x |
x scale type (days or data, default is "days") |
breaks |
Range for x scale when x = "date" (default is 1 months) |
textsize |
Axis text size |
legendsize |
Legend text size |
titlesize |
Axis title size |
linesize |
Line size |
date_format |
Date format for x="data" |
angle |
x-axis scale text rotation |
legend.position |
Legend position |
Value
Returns row and column graphs for graphical representation of air temperature and relative humidity. Graph normally used in scientific articles
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
See Also
sk_graph, barplot_positive, corgraph, spider_graph, line_plot
Examples
library(AgroR)
data(weather)
with(weather, plot_TH1(tempo, Tmed, Tmax, Tmin, UR))
Graph: Plot correlation
Description
Correlation analysis function (Pearson or Spearman)
Usage
plot_cor(
x,
y,
method = "pearson",
ylab = "Dependent",
xlab = "Independent",
theme = theme_classic(),
pointsize = 5,
shape = 21,
fill = "gray",
color = "black",
axis.size = 12,
ic = TRUE,
title = NA,
family = "sans"
)
Arguments
x |
Numeric vector with independent variable |
y |
Numeric vector with dependent variable |
method |
Method correlation (default is Pearson) |
ylab |
Variable response name (Accepts the expression() function) |
xlab |
Treatments name (Accepts the expression() function) |
theme |
ggplot2 theme (default is theme_classic()) |
pointsize |
Point size |
shape |
shape format |
fill |
Fill point |
color |
Color point |
axis.size |
Axis text size |
ic |
add interval of confidence |
title |
title |
family |
Font family |
Value
The function returns a graph for correlation
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
Examples
data("pomegranate")
with(pomegranate, plot_cor(WL, SS, xlab="WL", ylab="SS"))
Graph: Interaction plot
Description
Performs an interaction graph from an output of the FAT2DIC, FAT2DBC, PSUBDIC or PSUBDBC commands.
Usage
plot_interaction(
a,
box_label = TRUE,
repel = FALSE,
pointsize = 3,
linesize = 0.8,
width.bar = 0.05,
add.errorbar = TRUE,
family = "sans"
)
Arguments
a |
FAT2DIC, FAT2DBC, PSUBDIC or PSUBDBC object |
box_label |
Add box in label |
repel |
a boolean, whether to use ggrepel to avoid overplotting text labels or not. |
pointsize |
Point size |
linesize |
Line size (Trendline and Error Bar) |
width.bar |
width of the error bars. |
add.errorbar |
Add error bars. |
family |
Font family |
Value
Returns an interaction graph with averages and letters from the multiple comparison test
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
Examples
data(cloro)
a=with(cloro, FAT2DIC(f1, f2, resp))
plot_interaction(a)
Graph: Column, box or segment chart with observations
Description
The function performs the construction of graphs of boxes, columns or segments with all the observations represented in the graph.
Usage
plot_jitter(model)
Arguments
model |
DIC, DBC or DQL object |
Value
Returns with graph of boxes, columns or segments with all the observations represented in the graph.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
Examples
data("pomegranate")
a=with(pomegranate,DIC(trat,WL,geom="point"))
plot_jitter(a)
Graphics: Graphic for t test to compare means with a reference value
Description
Sometimes the researcher wants to test whether the treatment mean is greater than/equal to or less than a reference value. For example, I want to know if the average productivity of my treatment is higher than the average productivity of a given country. For this, this function allows comparing the means with a reference value using the t test.
Usage
plot_tonetest(tonetest, alpha = 0.95)
Arguments
tonetest |
t.one.test object |
alpha |
confidence level. |
Value
returns a density plot and a column plot to compare a reference value with other treatments.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Examples
library(AgroR)
data("pomegranate")
resu=tonetest(resp=pomegranate$WL, trat=pomegranate$trat, mu=2)
plot_tonetest(resu)
Analysis: Linear regression graph
Description
Linear regression analysis of an experiment with a quantitative factor or isolated effect of a quantitative factor
Usage
polynomial(
trat,
resp,
ylab = "Response",
xlab = "Independent",
yname.poly = "y",
xname.poly = "x",
grau = NA,
theme = theme_classic(),
point = "mean_sd",
color = "gray80",
posi = "top",
textsize = 12,
se = FALSE,
ylim = NA,
family = "sans",
pointsize = 4.5,
linesize = 0.8,
width.bar = NA,
n = NA,
SSq = NA,
DFres = NA,
print.on = TRUE,
plot.on = TRUE
)
Arguments
trat |
Numerical vector with treatments (Declare as numeric) |
resp |
Numerical vector containing the response of the experiment. |
ylab |
Dependent variable name (this argument uses the parse function) |
xlab |
Independent variable name (this argument uses the parse function) |
yname.poly |
Y name in equation |
xname.poly |
X name in equation |
grau |
Degree of the polynomial (1, 2 or 3) |
theme |
ggplot2 theme (default is theme_classic()) |
point |
Defines whether to plot mean ("mean"), all repetitions ("all"),mean with standard deviation ("mean_sd") or mean with standard error (default - "mean_se"). |
color |
Graph color (default is gray80) |
posi |
Legend position |
textsize |
Font size |
se |
Adds confidence interval (default is FALSE) |
ylim |
y-axis scale |
family |
Font family |
pointsize |
Point size |
linesize |
line size (Trendline and Error Bar) |
width.bar |
width of the error bars of a regression graph. |
n |
Number of decimal places for regression equations |
SSq |
Sum of squares of the residue |
DFres |
Residue freedom degrees |
print.on |
Print output |
plot.on |
Plot output |
Value
Returns linear, quadratic or cubic regression analysis.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
See Also
polynomial2, polynomial2_color
Examples
data("phao")
with(phao, polynomial(dose,comp, grau = 2))
Analysis: Linear regression graph in double factorial
Description
Linear regression analysis for significant interaction of an experiment with two factors, one quantitative and one qualitative
Usage
polynomial2(
fator1,
resp,
fator2,
color = NA,
grau = NA,
ylab = "Response",
xlab = "Independent",
theme = theme_classic(),
se = FALSE,
point = "mean_sd",
legend.title = "Treatments",
posi = "top",
textsize = 12,
ylim = NA,
family = "sans",
width.bar = NA,
pointsize = 3,
linesize = 0.8,
separate = c("(\"", "\")"),
n = NA,
DFres = NA,
SSq = NA,
print.on = TRUE,
plot.on = TRUE
)
Arguments
fator1 |
Numeric or complex vector with factor 1 levels |
resp |
Numerical vector containing the response of the experiment. |
fator2 |
Numeric or complex vector with factor 2 levels |
color |
Graph color (default is NA) |
grau |
Degree of the polynomial (1,2 or 3) |
ylab |
Dependent variable name (this argument uses the parse function) |
xlab |
Independent variable name (this argument uses the parse function) |
theme |
ggplot2 theme (default is theme_classic()) |
se |
Adds confidence interval (default is FALSE) |
point |
Defines whether to plot all points ("all"), mean ("mean"), mean with standard deviation (default - "mean_sd") or mean with standard error ("mean_se"). |
legend.title |
Title legend (this argument uses the parse function) |
posi |
Legend position |
textsize |
Font size (default is 12) |
ylim |
y-axis scale |
family |
Font family (default is sans) |
width.bar |
width of the error bars of a regression graph. |
pointsize |
Point size (default is 4) |
linesize |
line size (Trendline and Error Bar) |
separate |
Separation between treatment and equation (default is c("(\"","\")")) |
n |
Number of decimal places for regression equations |
DFres |
Residue freedom degrees |
SSq |
Sum of squares of the residue |
print.on |
Print output |
plot.on |
Plot output |
Value
Returns two or more linear, quadratic or cubic regression analyzes.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
See Also
Examples
dose=rep(c(0,0,0,2,2,2,4,4,4,6,6,6),3)
resp=c(8,7,5,23,24,25,30,34,36,80,90,80,
12,14,15,23,24,25,50,54,56,80,90,40,
12,14,15,3,4,5,50,54,56,80,90,40)
trat=rep(c("A","B","C"),e=12)
polynomial2(dose, resp, trat, grau=c(1,2,3))
Analysis: Linear regression graph in double factorial with color graph
Description
Linear regression analysis for significant interaction of an experiment with two factors, one quantitative and one qualitative
Usage
polynomial2_color(
fator1,
resp,
fator2,
color = NA,
grau = NA,
ylab = "Response",
xlab = "independent",
theme = theme_classic(),
se = FALSE,
point = "mean_se",
legend.title = "Treatments",
posi = "top",
textsize = 12,
ylim = NA,
family = "sans",
width.bar = NA,
pointsize = 5,
linesize = 0.8,
separate = c("(\"", "\")"),
n = NA,
DFres = NA,
SSq = NA,
print.on = TRUE,
plot.on = TRUE
)
Arguments
fator1 |
Numeric or complex vector with factor 1 levels |
resp |
Numerical vector containing the response of the experiment. |
fator2 |
Numeric or complex vector with factor 2 levels |
color |
Graph color (default is NA) |
grau |
Degree of the polynomial (1,2 or 3) |
ylab |
Dependent variable name (this argument uses the parse function) |
xlab |
Independent variable name (this argument uses the parse function) |
theme |
ggplot2 theme (default is theme_classic()) |
se |
Adds confidence interval (default is FALSE) |
point |
Defines whether to plot all points ("all"), mean ("mean"), mean with standard deviation ("mean_sd") or mean with standard error (default - "mean_se"). |
legend.title |
Title legend (this argument uses the parse function) |
posi |
Legend position |
textsize |
Font size (default is 12) |
ylim |
y-axis scale |
family |
Font family (default is sans) |
width.bar |
width of the error bars of a regression graph. |
pointsize |
Point size (default is 4) |
linesize |
line size (Trendline and Error Bar) |
separate |
Separation between treatment and equation (default is c("(\"","\")")) |
n |
Number of decimal places for regression equations |
DFres |
Residue freedom degrees |
SSq |
Sum of squares of the residue |
print.on |
Print output |
plot.on |
Plot output |
Value
Returns two or more linear, quadratic or cubic regression analyzes.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
See Also
Examples
dose=rep(c(0,0,0,2,2,2,4,4,4,6,6,6),3)
resp=c(8,7,5,23,24,25,30,34,36,80,90,80,
12,14,15,23,24,25,50,54,56,80,90,40,
12,14,15,3,4,5,50,54,56,80,90,40)
trat=rep(c("A","B","C"),e=12)
polynomial2_color(dose, resp, trat, grau=c(1,2,3))
Dataset: Pomegranate data
Description
An experiment was conducted with the objective of studying different products to reduce the loss of mass in postharvest of pomegranate fruits. The experiment was conducted in a completely randomized design with four replications. Treatments are: T1: External Wax; T2: External + Internal Wax; T3: External Orange Oil; T4: Internal + External Orange Oil; T5: External sodium hypochlorite; T6: Internal + External sodium hypochlorite
Usage
data(pomegranate)
Format
data.frame containing data set
trat
Categorical vector with treatments
WL
Numeric vector weights loss
SS
Numeric vector solid soluble
AT
Numeric vector titratable acidity
ratio
Numeric vector with ratio (SS/AT)
See Also
cloro, enxofre, laranja, mirtilo, porco, sensorial, simulate1, simulate2, simulate3, tomate, weather, phao, passiflora
Examples
data(pomegranate)
Dataset: Pig development and production
Description
An experiment whose objective was to study the effect of castration age on the development and production of pigs, evaluating the weight of the piglets. Four treatments were studied: A - castration at 56 days of age; B - castration at 7 days of age; C - castration at 36 days of age; D - whole (not castrated); E - castration at 21 days of age. The Latin square design was used in order to control the variation between litters (lines) and the variation in the initial weight of the piglets (columns), with the experimental portion consisting of a piglet.
Usage
data(porco)
Format
data.frame containing data set
trat
Categorical vector with treatments
linhas
Categorical vector with lines
colunas
Categorical vector with columns
resp
Numeric vector
See Also
cloro, enxofre, laranja, mirtilo, pomegranate, sensorial, simulate1, simulate2, simulate3, tomate, weather, phao, passiflora, aristolochia
Examples
data(porco)
Analysis: Polynomial splitting for double factorial in DIC and DBC
Description
Splitting in polynomials for double factorial in DIC and DBC. Note that f1 must always be qualitative and f2 must always be quantitative. This function is an easier way to visualize trends for dual factor schemes with a quantitative and a qualitative factor.
Usage
quant.fat2.desd(factors = list(f1, f2, block), response, dec = 3)
Arguments
factors |
Define f1 and f2 and/or block factors in list form. Please note that in the list it is necessary to write 'f1', 'f2' and 'block'. See example. |
response |
response variable |
dec |
Number of cells |
Value
Returns the coefficients of the linear, quadratic and cubic models, the p-values of the t test for each coefficient (p.value.test) and the p-values for the linear, quadratic, cubic model splits and the regression deviations.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
See Also
Examples
library(AgroR)
data(cloro)
quant.fat2.desd(factors = list(f1=cloro$f1,
f2=rep(c(1:4),e=5,2), block=cloro$bloco),
response=cloro$resp)
Graph: Point graph for one factor
Description
This is a function of the point graph for one factor
Usage
seg_graph(model, fill = "lightblue", horiz = TRUE, pointsize = 4.5)
Arguments
model |
DIC, DBC or DQL object |
fill |
fill bars |
horiz |
Horizontal Column (default is TRUE) |
pointsize |
Point size |
Value
Returns a point chart for one factor
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
See Also
barplot_positive, plot_TH, corgraph, spider_graph, line_plot
Examples
data("laranja")
a=with(laranja, DBC(trat, bloco, resp,
mcomp = "sk",angle=45,sup=10,
ylab = "Number of fruits/plants"))
seg_graph(a,horiz = FALSE)
Graph: Point graph for one factor model 2
Description
This is a function of the point graph for one factor
Usage
seg_graph2(
model,
theme = theme_gray(),
pointsize = 4,
pointshape = 16,
horiz = TRUE,
vjust = -0.6
)
Arguments
model |
DIC, DBC or DQL object |
theme |
ggplot2 theme |
pointsize |
Point size |
pointshape |
Format point (default is 16) |
horiz |
Horizontal Column (default is TRUE) |
vjust |
vertical adjusted |
Value
Returns a point chart for one factor
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
See Also
barplot_positive, plot_TH, corgraph, spider_graph, line_plot
Examples
data("laranja")
a=with(laranja, DBC(trat, bloco, resp,
mcomp = "sk",angle=45,
ylab = "Number of fruits/plants"))
seg_graph2(a,horiz = FALSE)
Dataset: Sensorial data
Description
Set of data from a sensory analysis with six participants in which different combinations (blend) of the grape cultivar bordo and niagara were evaluated. Color (CR), aroma (AR), flavor (SB), body (CP) and global (GB) were evaluated. The data.frame presents the averages of the evaluators.
Usage
data(sensorial)
Format
data.frame containing data set
Blend
Categorical vector with treatment
variable
Categorical vector with variables
resp
Numeric vector
See Also
cloro, enxofre, laranja, mirtilo, pomegranate, porco, simulate1, simulate2, simulate3, tomate, weather, phao, passiflora, aristolochia
Examples
data(sensorial)
Dataset: Simulated data dict
Description
Simulated data from a completely randomized experiment with multiple assessments over time
Usage
data(simulate1)
Format
data.frame containing data set
tempo
Categorical vector with time
trat
Categorical vector with treatment
resp
Categorical vector with response
See Also
cloro, enxofre, laranja, mirtilo, pomegranate, porco, sensorial, simulate2, simulate3, tomate, weather, phao, passiflora, aristolochia
Examples
data(simulate1)
Dataset: Simulated data dbct
Description
Simulated data from a latin square experiment with multiple assessments over time
Usage
data(simulate2)
Format
data.frame containing data set
tempo
Categorical vector with time
trat
Categorical vector with treatment
bloco
Categorical vector with block
resp
Categorical vector with response
See Also
cloro, enxofre, laranja, mirtilo, pomegranate, porco, sensorial, simulate1, simulate3, tomate, weather, phao, passiflora, aristolochia
Examples
data(simulate2)
Dataset: Simulated data dqlt
Description
Simulated data from a completely randomized experiment with multiple assessments over time
Usage
data(simulate3)
Format
data.frame containing data set
tempo
Categorical vector with time
trat
Categorical vector with treatment
linhas
Categorical vector with line
colunas
Categorical vector with column
resp
Categorical vector with response
See Also
cloro, enxofre, laranja, mirtilo, pomegranate, porco, sensorial, simulate1, simulate2, tomate, weather, phao, passiflora, aristolochia
Examples
data(simulate3)
Graph: Scott-Knott graphics
Description
This is a function of the bar graph for the Scott-Knott test
Usage
sk_graph(model, horiz = TRUE, fill.label = "lightyellow")
Arguments
model |
DIC, DBC or DQL object |
horiz |
Horizontal Column (default is TRUE) |
fill.label |
fill Label box fill color |
Value
Returns a bar chart with columns separated by color according to the Scott-Knott test
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
See Also
barplot_positive, plot_TH, corgraph, spider_graph, line_plot
Examples
data("laranja")
a=with(laranja, DBC(trat, bloco, resp,
mcomp = "sk",angle=45,
ylab = "Number of fruits/plants"))
sk_graph(a,horiz = FALSE)
library(ggplot2)
sk_graph(a,horiz = TRUE)+scale_fill_grey(start=1,end=0.5)
Utils: Experimental sketch
Description
Experimental sketching function
Usage
sketch(
trat,
trat1 = NULL,
trat2 = NULL,
r,
design = "DIC",
pos = "line",
color.sep = "all",
ID = FALSE,
print.ID = TRUE,
add.streets.y = NA,
add.streets.x = NA,
label.x = "",
label.y = "",
axissize = 12,
legendsize = 12,
labelsize = 4,
export.csv = FALSE,
comment.caption = NULL
)
Arguments
trat |
Vector with factor A levels |
trat1 |
Vector with levels of factor B (Set to NULL if not factorial or psub) |
trat2 |
Vector with levels of factor C (Set to NULL if not factorial) |
r |
Number of repetitions |
design |
Experimental design (see note) |
pos |
Repeat position (line or column), |
color.sep |
Color box |
ID |
plot Add only identification in sketch |
print.ID |
Print table ID |
add.streets.y |
Adds streets by separating treatments in row or column. The user must supply a numeric vector grouping the rows or columns that must be together. See the example. |
add.streets.x |
Adds streets by separating treatments in row or column. The user must supply a numeric vector grouping the rows or columns that must be together. See the example. |
label.x |
text in x |
label.y |
text in y |
axissize |
Axis size |
legendsize |
Title legend size |
labelsize |
Label size |
export.csv |
Save table template based on sketch in csv |
comment.caption |
Add comment in caption |
Value
Returns an experimental sketch according to the specified design.
Note
The sketches have only a rectangular shape, and the blocks (in the case of randomized blocks) can be in line or in a column.
For the design argument, you can choose from the following options:
design="DIC"
Completely randomized design
design="DBC"
Randomized block design
design="DQL"
Latin square design
design="FAT2DIC"
DIC experiments in double factorial
design="FAT2DBC"
DBC experiments in double factorial
design="FAT3DIC"
DIC experiments in triple factorial
design="FAT3DBC"
DBC experiments in triple factorial
design="PSUBDIC"
DIC experiments in split-plot
design="PSUBDBC"
DBC experiments in split-plot
design="PSUBSUBDBC"
DBC experiments in split-split-plot
design="STRIP-PLOT"
Strip-plot DBC experiments
For the color.sep argument, you can choose from the following options:
design="DIC"
use "all" or "none"
design="DBC"
use "all","bloco" or "none"
design="DQL"
use "all", "column", "line" or "none"
design="FAT2DIC"
use "all", "f1", "f2" or "none"
design="FAT2DBC"
use "all", "f1", "f2", "block" or "none"
design="FAT3DIC"
use "all", "f1", "f2", "f3" or "none"
design="FAT3DBC"
use "all", "f1", "f2", "f3", "block" or "none"
design="PSUBDIC"
use "all", "f1", "f2" or "none"
design="PSUBDBC"
use "all", "f1", "f2", "block" or "none"
design="PSUBSUBDBC"
use "all", "f1", "f2", "f3", "block" or "none"
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
References
Mendiburu, F., & de Mendiburu, M. F. (2019). Package ‘agricolae’. R Package, Version, 1-2.
Examples
Trat=paste("Tr",1:6)
#=============================
# Completely randomized design
#=============================
sketch(Trat,r=3)
sketch(Trat,r=3,pos="column")
sketch(Trat,r=3,color.sep="none")
sketch(Trat,r=3,color.sep="none",ID=TRUE,print.ID=TRUE)
sketch(Trat,r=3,pos="column",add.streets.x=c(1,1,2,2,3,3))
#=============================
# Randomized block design
#=============================
sketch(Trat, r=3, design="DBC")
sketch(Trat, r=3, design="DBC",pos="column")
sketch(Trat, r=3, design="DBC",pos="column",add.streets.x=c(1,1,2))
sketch(Trat, r=3, design="DBC",pos="column",add.streets.x=c(1,2,3), add.streets.y=1:6)
sketch(Trat, r=3, design="DBC",pos="line",add.streets.y=c(1,2,3), add.streets.x=1:6)
#=============================
# Completely randomized experiments in double factorial
#=============================
sketch(trat=c("A","B"),
trat1=c("A","B","C"),
design = "FAT2DIC",
r=3)
sketch(trat=c("A","B"),
trat1=c("A","B","C"),
design = "FAT2DIC",
r=3,
pos="column")
Dataset: Soybean
Description
An experiment was carried out to evaluate the grain yield (kg ha-1) of ten different commercial soybean cultivars in the municipality of Londrina/Parana. The experiment was carried out in the design of randomized complete blocks with four replicates per treatment.
Usage
data("soybean")
Format
data.frame containing data set
cult
numeric vector with treatment
bloc
numeric vector with block
prod
Numeric vector with grain yield
See Also
cloro, laranja, enxofre, laranja, mirtilo, passiflora, phao, porco, pomegranate, simulate1, simulate2, simulate3, tomate, weather
Examples
data(soybean)
Graph: Spider graph for sensorial analysis
Description
Spider chart or radar chart. Usually used for graphical representation of acceptability in sensory tests
Usage
spider_graph(
resp,
vari,
blend,
legend.title = "",
xlab = "",
ylab = "",
ymin = 0
)
Arguments
resp |
Vector containing notes |
vari |
Vector containing the variables |
blend |
Vector containing treatments |
legend.title |
Caption title |
xlab |
x axis title (this argument uses the parse function) |
ylab |
y axis title (this argument uses the parse function) |
ymin |
Minimum value of y |
Value
Returns a spider or radar chart. This graph is commonly used in studies of sensory analysis.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
See Also
sk_graph, plot_TH, corgraph, barplot_positive, line_plot
Examples
library(AgroR)
data(sensorial)
with(sensorial, spider_graph(resp, variable, Blend))
Utils: Summary of Analysis of Variance and Test of Means
Description
Summarizes the output of the analysis of variance and the multiple comparisons test for completely randomized (DIC), randomized block (DBC) and Latin square (DQL) designs.
Usage
summarise_anova(
analysis,
inf = "p",
design = "DIC",
round = 3,
divisor = FALSE
)
Arguments
analysis |
List with the analysis outputs of the DIC, DBC, DQL, FAT2DIC, FAT2DBC, PSUBDIC and PSUBDBC functions |
inf |
Analysis of variance information (can be "p", "f", "QM" or "SQ") |
design |
Type of experimental project (DIC, DBC, DQL, FAT2DIC, FAT2DBC, PSUBDIC or PSUBDBC) |
round |
Number of decimal places |
divisor |
Add divider between columns |
Value
returns a data.frame or print with a summary of the analysis of several experimental projects.
Note
Adding table divider can help to build tables in microsoft word. Copy console output, paste into MS Word, Insert, Table, Convert text to table, Separated text into:, Other: |.
The column names in the final output are imported from the ylab argument within each function.
This function is only for declared qualitative factors. In the case of a quantitative factor and the other qualitative in projects with two factors, this function will not work.
Triple factorials and split-split-plot do not work in this function.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Examples
library(AgroR)
#=====================================
# DIC
#=====================================
data(pomegranate)
attach(pomegranate)
a=DIC(trat, WL, geom = "point", ylab = "WL")
b=DIC(trat, SS, geom = "point", ylab="SS")
c=DIC(trat, AT, geom = "point", ylab = "AT")
summarise_anova(analysis = list(a,b,c), divisor = TRUE)
library(knitr)
kable(summarise_anova(analysis = list(a,b,c), divisor = FALSE))
#=====================================
vari=c("WL","SS","AT")
output=lapply(vari,function(x){
output=DIC(trat,response = unlist(pomegranate[,x]),ylab = parse(text=x),print.on=FALSE)})
summarise_anova(analysis = output, divisor = TRUE)
#=====================================
# DBC
#=====================================
data(soybean)
attach(soybean)
a=DBC(cult,bloc,prod,ylab = "Yield")
summarise_anova(list(a),design = "DBC")
#=====================================
# FAT2DIC
#=====================================
data(corn)
attach(corn)
a=FAT2DIC(A, B, Resp, quali=c(TRUE, TRUE))
summarise_anova(list(a),design="FAT2DIC")
Utils: Summary of Analysis of Variance and Test of Means for Joint analysis
Description
Summarizes the output of the analysis of variance and the multiple comparisons test for completely randomized (DIC) and randomized block (DBC) designs for Joint analysis with qualitative factor.
Usage
summarise_conj(analysis, design = "DBC", info = "p")
Arguments
analysis |
List with the analysis outputs of the conjdic and conjdbc functions |
design |
Type of experimental project (DIC or DBC) |
info |
Analysis of variance information (can be "p", "f", "QM" or "SQ") |
Note
The column names in the final output are imported from the ylab argument within each function.
This function is only for declared qualitative factors. In the case of a quantitative factor and the other qualitative in projects with two factors, this function will not work.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Examples
library(AgroR)
data(mirtilo)
set.seed(1); resp1=rnorm(36,10,4)
set.seed(4); resp2=rnorm(36,10,3)
set.seed(8); resp3=rnorm(36,100,40)
type1=with(mirtilo, conjdbc(trat, bloco, exp, resp, ylab = "var1"))
type2=with(mirtilo, conjdbc(trat, bloco, exp, resp1, ylab = "var2"))
type3=with(mirtilo, conjdbc(trat, bloco, exp, resp2, ylab = "var3"))
type4=with(mirtilo, conjdbc(trat, bloco, exp, resp3, ylab = "var4"))
summarise_conj(analysis = list(type1,type2,type3,type4))
Utils: Dunnett's Test Summary
Description
Performs a summary in table form from a list of Dunnett's test outputs
Usage
summarise_dunnett(variable, colnames = NA, info = "sig")
Arguments
variable |
List object Dunnett test |
colnames |
Names of column |
info |
Information of table |
Value
A summary table from Dunnett's test is returned
Examples
library(AgroR)
data("pomegranate")
a=with(pomegranate,dunnett(trat=trat,resp=WL,control="T1"))
b=with(pomegranate,dunnett(trat=trat,resp=SS,control="T1"))
c=with(pomegranate,dunnett(trat=trat,resp=AT,control="T1"))
d=with(pomegranate,dunnett(trat=trat,resp=ratio,control="T1"))
summarise_dunnett(list(a,b,c,d))
Descriptive: Table descritive analysis
Description
Function for generating a data.frame with averages or other descriptive measures grouped by a categorical variable
Usage
tabledesc(data, fun = mean)
Arguments
data |
data.frame containing the first column with the categorical variable and the remaining response columns |
fun |
Function of descriptive statistics (default is mean) |
Value
Returns a data.frame with a measure of dispersion or position from a dataset and separated by a factor
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
Examples
data(pomegranate)
tabledesc(pomegranate)
library(knitr)
kable(tabledesc(pomegranate))
Analysis: Test for two samples
Description
Test for two samples (paired and unpaired t test, paired and unpaired Wilcoxon test)
Usage
test_two(
trat,
resp,
paired = FALSE,
correct = TRUE,
test = "t",
alternative = c("two.sided", "less", "greater"),
conf.level = 0.95,
theme = theme_classic(),
ylab = "Response",
xlab = "",
var.equal = FALSE,
pointsize = 2,
yposition.p = NA,
xposition.p = NA,
fill = "white"
)
Arguments
trat |
Categorical vector with the two treatments |
resp |
Numeric vector with the response |
paired |
A logical indicating whether you want a paired t-test. |
correct |
A logical indicating whether to apply continuity correction in the normal approximation for the p-value. |
test |
Test used (t for test t or w for Wilcoxon test) |
alternative |
A character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less". You can specify just the initial letter. |
conf.level |
Confidence level of the interval. |
theme |
ggplot2 theme (default is theme_classic()) |
ylab |
Variable response name (this argument uses the parse function) |
xlab |
Treatments name (this argument uses the parse function) |
var.equal |
A logical variable indicating whether to treat the two variances as being equal. If TRUE then the pooled variance is used to estimate the variance otherwise the Welch (or Satterthwaite) approximation to the degrees of freedom is used. |
pointsize |
Point size |
yposition.p |
Position p-value in y |
xposition.p |
Position p-value in x |
fill |
fill box |
Details
Alternative = "greater" is the alternative that x has a larger mean than y. For the one-sample case: that the mean is positive.
If paired is TRUE then both x and y must be specified and they must be the same length. Missing values are silently removed (in pairs if paired is TRUE). If var.equal is TRUE then the pooled estimate of the variance is used. By default, if var.equal is FALSE then the variance is estimated separately for both groups and the Welch modification to the degrees of freedom is used.
If the input data are effectively constant (compared to the larger of the two means) an error is generated.
Value
Returns the test for two samples (paired or unpaired t test, paired or unpaired Wilcoxon test)
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
Examples
resp=rnorm(100,100,5)
trat=rep(c("A","B"),e=50)
test_two(trat,resp)
test_two(trat,resp,paired = TRUE)
Dataset: Tomato data
Description
An experiment conducted in a randomized block design in a split plot scheme was developed in order to evaluate the efficiency of bacterial isolates in the development of tomato cultivars. The experiment counted a total of 24 trays; each block (in a total of four blocks), composed of 6 trays, in which each tray contained a treatment (6 isolates). Each tray was seeded with 4 different genotypes, each genotype occupying 28 cells per tray. The trays were randomized inside each block and the genotypes were randomized inside each tray.
Usage
data(tomate)
Format
data.frame containing data set
parc
Categorical vector with plot
subp
Categorical vector with split-plot
bloco
Categorical vector with block
resp
Numeric vector
See Also
cloro, enxofre, laranja, mirtilo, pomegranate, porco, sensorial, simulate1, simulate2, simulate3, weather, aristolochia, phao, passiflora
Examples
data(tomate)
Analysis: t test to compare means with a reference value
Description
Sometimes the researcher wants to test whether the treatment mean is greater than/equal to or less than a reference value. For example, I want to know if the average productivity of my treatment is higher than the average productivity of a given country. For this, this function allows comparing the means with a reference value using the t test.
Usage
tonetest(response, trat, mu = 0, alternative = "two.sided", conf.level = 0.95)
Arguments
response |
Numerical vector containing the response of the experiment. |
trat |
Numerical or complex vector with treatments |
mu |
A number indicating the true value of the mean |
alternative |
A character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less" |
conf.level |
confidence level of the interval. |
Value
returns a list with the mean per treatment, maximum, minimum, sample standard deviation, confidence interval, t-test statistic and its p-value.
Note
No treatment can have zero variability. Otherwise the function will result in an error.
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Examples
library(AgroR)
data("pomegranate")
tonetest(resp=pomegranate$WL,
trat=pomegranate$trat,
mu=2,
alternative = "greater")
Utils: Data transformation (Box-Cox, 1964)
Description
Estimates the lambda value for data transformation
Usage
transf(response, f1, f2 = NA, f3 = NA, block = NA, line = NA, column = NA)
Arguments
response |
Numerical vector containing the response of the experiment. |
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 |
line |
Numerical or complex vector with lines |
column |
Numerical or complex vector with columns |
Value
Returns the value of lambda and/or data transformation approximation, according to Box-Cox (1964)
Author(s)
Gabriel Danilo Shimizu, gabrield.shimizu@gmail.com
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
References
Box, G. E., Cox, D. R. (1964). An analysis of transformations. Journal of the Royal Statistical Society: Series B (Methodological), 26(2), 211-243.
Examples
#================================================================
# Completely randomized design
#================================================================
data("pomegranate")
with(pomegranate, transf(WL,f1=trat))
#================================================================
# Randomized block design
#================================================================
data(soybean)
with(soybean, transf(prod, f1=cult, block=bloc))
#================================================================
# Completely randomized design in double factorial
#================================================================
data(cloro)
with(cloro, transf(resp, f1=f1, f2=f2))
#================================================================
# Randomized block design in double factorial
#================================================================
data(cloro)
with(cloro, transf(resp, f1=f1, f2=f2, block=bloco))
Dataset: Weather data
Description
Climatic data from 01 November 2019 to 30 June 2020 in the municipality of Londrina-PR, Brazil. Data from the Instituto de Desenvolvimento Rural do Parana (IDR-PR)
Usage
data(weather)
Format
data.frame containing data set
Data
POSIXct vector with dates
tempo
Numeric vector with time
Tmax
Numeric vector with maximum temperature
Tmed
Numeric vector with mean temperature
Tmin
Numeric vector with minimum temperature
UR
Numeric vector with relative humidity
See Also
cloro, enxofre, laranja, mirtilo, pomegranate, porco, sensorial, simulate1, simulate2, simulate3, tomate, aristolochia, phao, passiflora
Examples
data(weather)