Title: | 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). |
Authors: | Gabriel Danilo Shimizu [aut, cre]
|
Maintainer: | Gabriel Danilo Shimizu <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.3.6 |
Built: | 2025-01-20 04:11:45 UTC |
Source: | https://github.com/cran/AgroR |
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.
aacp(data)
aacp(data)
data |
Data.frame containing evaluations in columns. Column names must be numeric and not dates or characters |
Returns a vector with the area values under the curve
Just enter the data. Exclude treatment columns. See example.
Gabriel Danilo Shimizu, [email protected]
Campbell, C. L., and Madden, L. V. (1990). Introduction to plant disease epidemiology. John Wiley and Sons.
#======================================= # 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)
#======================================= # 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)
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.
data("aristolochia")
data("aristolochia")
data.frame containing data set
trat
numeric vector with factor 1
resp
Numeric vector with response
cloro, laranja, enxofre, laranja, mirtilo, passiflora, phao, porco, pomegranate, simulate1, simulate2, simulate3, tomate, weather
data(aristolochia)
data(aristolochia)
The function performs the construction of a column chart of Dunnett's test.
bar_dunnett( output.dunnett, ylab = "Response", xlab = "", fill = c("#F8766D", "#00BFC4"), sup = NA, add.mean = TRUE, round = 2 )
bar_dunnett( output.dunnett, ylab = "Response", xlab = "", fill = c("#F8766D", "#00BFC4"), sup = NA, add.mean = TRUE, round = 2 )
output.dunnett |
Numerical or complex vector with treatments |
ylab |
Variable response name (Accepts the expression() function) |
xlab |
Treatments name (Accepts the expression() function) |
fill |
Fill column. Use vector with two elements c(control, different 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 |
Returns a column chart of Dunnett's test. The colors indicate difference from the control.
#==================================================== # 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", legend = "Stages",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)
#==================================================== # 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", legend = "Stages",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)
This is a function of the bar graph for one factor
bar_graph( model, fill = "lightblue", horiz = TRUE, width.col = 0.9, axis.0 = FALSE )
bar_graph( model, fill = "lightblue", horiz = TRUE, width.col = 0.9, axis.0 = FALSE )
model |
DIC, DBC or DQL object |
fill |
fill bars |
horiz |
Horizontal Column (default is TRUE) |
width.col |
Width Column |
axis.0 |
If TRUE causes the columns or bars to start just above the axis line. |
Returns a bar chart for one factor
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
radargraph, barplot_positive, plot_TH, plot_TH1, corgraph, spider_graph, line_plot, plot_cor, plot_interaction, plot_jitter, seg_graph, TBARPLOT.reverse
data("laranja") a=with(laranja, DBC(trat, bloco, resp, mcomp = "sk",angle=45, ylab = "Number of fruits/plants")) bar_graph(a,horiz = FALSE)
data("laranja") a=with(laranja, DBC(trat, bloco, resp, mcomp = "sk",angle=45, ylab = "Number of fruits/plants")) bar_graph(a,horiz = FALSE)
This is a function of the bar graph for one factor
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.col = 0.9, width.bar = 0, color.info = "black", fill = "lightblue" )
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.col = 0.9, width.bar = 0, color.info = "black", fill = "lightblue" )
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.col |
Width Column |
width.bar |
Width error bar |
color.info |
Color text information |
fill |
Fill bars |
Returns a bar chart for one factor
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
radargraph, barplot_positive, plot_TH, plot_TH1, corgraph, spider_graph, line_plot, plot_cor, plot_interaction, plot_jitter, seg_graph, TBARPLOT.reverse
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')
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')
This is a function of the bar graph for one factor with facets
barfacet( model, facet = NULL, theme = theme_bw(), horiz = FALSE, geom = "bar", fill = "lightblue", pointsize = 4.5, width.bar = 0.15, facet.background = "gray80" )
barfacet( model, facet = NULL, theme = theme_bw(), horiz = FALSE, geom = "bar", fill = "lightblue", pointsize = 4.5, width.bar = 0.15, facet.background = "gray80" )
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 |
width.bar |
width of the error bars of a regression graph. |
facet.background |
Color background in facet |
Returns a bar chart for one factor
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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"))
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"))
Groups two or more column charts exported from DIC, DBC or DQL function
bargraph_onefactor( analysis, labels = NULL, ocult.facet = FALSE, ocult.box = FALSE, facet.size = 14, ylab = NULL, width.bar = 0.3, width.col = 0.9, sup = NULL )
bargraph_onefactor( analysis, labels = NULL, ocult.facet = FALSE, ocult.box = FALSE, facet.size = 14, ylab = NULL, width.bar = 0.3, width.col = 0.9, sup = NULL )
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 |
width.col |
Width Column |
sup |
Number of units above the standard deviation or average bar on the graph |
Returns a column chart grouped by facets
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)
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)
Groups two or more column charts exported from FAT2DIC, FAT2DBC, PSUBDIC or PSUBDBC function
bargraph_twofactor( analysis, labels = NULL, ocult.facet = FALSE, ocult.box = FALSE, facet.size = 14, ylab = NULL, width.bar = 0.3, sup = NULL )
bargraph_twofactor( analysis, labels = NULL, ocult.facet = FALSE, ocult.box = FALSE, facet.size = 14, ylab = NULL, width.bar = 0.3, sup = NULL )
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 |
Returns a column chart grouped by facets
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)
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)
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
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 )
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 )
a |
Object of DIC, DBC or DQL functions |
b |
Object of DIC, DBC or DQL functions |
ylab |
Y axis names |
var_name |
Name of the variable |
legend.title |
Legend title |
fill_color |
Bar fill color |
width.col |
Width Column |
width.bar |
Width error bar |
The function returns a column chart with two positive sides
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.
Gabriel Danilo Shimizu, [email protected]
radargraph, sk_graph, plot_TH, corgraph, spider_graph, line_plot
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)")
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)")
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).
data("bean")
data("bean")
data.frame containing data set
trat
numeric vector with treatment
prod
Numeric vector with grain production per plant
aristolochia, cloro, laranja, enxofre, laranja, mirtilo, passiflora, phao, porco, pomegranate, simulate1, simulate2, simulate3, tomate, weather
data(bean)
data(bean)
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.
data(cloro)
data(cloro)
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
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.
enxofre, laranja, mirtilo, pomegranate, porco, sensorial, simulate1, simulate2, simulate3, tomate, weather, phao, passiflora, aristolochia
data(cloro)
data(cloro)
Calculates confidence interval for groups
confinterval(resp, group, alpha = 0.95, type = "upper")
confinterval(resp, group, alpha = 0.95, type = "upper")
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 |
returns a numeric vector with confidence interval grouped by treatment.
#=================================== # 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))
#=================================== # 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))
Function of the AgroR package for joint analysis of experiments conducted in a randomized qualitative or quantitative single-block design with balanced data.
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 )
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 )
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 (Accepts the expression() function) |
title |
Graph title |
xlab |
Treatments name (Accepts the expression() 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 |
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.
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.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
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))
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))
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.
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 )
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 )
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 (Accepts the expression() function) |
title |
Graph title |
xlab |
Treatments name (Accepts the expression() 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 |
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.
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.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
library(AgroR) data(mirtilo) with(mirtilo, conjdic(trat, bloco, exp, resp))
library(AgroR) data(mirtilo) with(mirtilo, conjdic(trat, bloco, exp, resp))
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.
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 )
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 )
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) |
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
The function is still limited to analysis of variance and assumptions only.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
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))
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))
Plot Pearson correlation with interval of confidence
cor_ic( data, background = TRUE, axis.size = 12, ylab = "", xlab = "Correlation (r)", theme = theme_classic() )
cor_ic( data, background = TRUE, axis.size = 12, ylab = "", xlab = "Correlation (r)", theme = theme_classic() )
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()) |
The function returns a new graphical approach to correlation.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
data("pomegranate") cor_ic(pomegranate[,-1])
data("pomegranate") cor_ic(pomegranate[,-1])
Correlation analysis function (Pearson or Spearman)
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" )
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" )
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) |
The function returns a correlation matrix
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
data("pomegranate") corgraph(pomegranate[,-1])
data("pomegranate") corgraph(pomegranate[,-1])
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.
data(corn)
data(corn)
data.frame containing data set
A
Categorical vector with hybrids
B
Categorical vector with density
resp
Numeric vector with response
enxofre, laranja, mirtilo, pomegranate, porco, sensorial, simulate1, simulate2, simulate3, tomate, weather, phao, passiflora, aristolochia
data(corn)
data(corn)
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.
data(covercrops)
data(covercrops)
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
enxofre, laranja, mirtilo, pomegranate, porco, sensorial, simulate1, simulate2, simulate3, tomate, weather, phao, passiflora, aristolochia
data(covercrops)
data(covercrops)
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.
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 = NULL, width.bar = 0.3, addmean = TRUE, errorbar = TRUE, posi = "top", point = "mean_sd", pointsize = 5, angle.label = 0, ylim = NA )
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 = NULL, width.bar = 0.3, addmean = TRUE, errorbar = TRUE, posi = "top", point = "mean_sd", pointsize = 5, angle.label = 0, ylim = NA )
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 (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. |
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.
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.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
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=expression("Grain yield"~(kg~ha^-1))))
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=expression("Grain yield"~(kg~ha^-1))))
Statistical analysis of experiments conducted in a randomized block design with an additional treatment and balanced design with a factor considering the fixed model.
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" )
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" )
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 (Accepts the expression() function) |
xlab |
Treatments name (Accepts the expression() 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. |
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.
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.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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)
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)
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.
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 )
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 )
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 (Accepts the expression() function) |
xlab |
Treatments name (Accepts the expression() 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 |
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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")
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")
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.
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 )
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 )
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 (Accepts the expression() function) |
xlab |
Treatments name (Accepts the expression() 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. |
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).
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
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.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Gonçalves
Rodrigo Yudi Palhaci Marubayashi
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.
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")
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")
Performs the descriptive analysis of an experiment with a factor of interest.
desc(trat, response, ylab = "Response", xlab = "Treatment", ylim = NA)
desc(trat, response, ylab = "Response", xlab = "Treatment", ylim = NA)
trat |
Numerical or complex vector with treatments |
response |
Numerical vector containing the response of the experiment. |
ylab |
Variable response name (Accepts the expression() function) |
xlab |
x name (Accepts the expression() function) |
ylim |
y-axis scale |
The function returns exploratory measures of position and dispersion, such as mean, median, maximum, minimum, coefficient of variation, etc ...
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
library(AgroR) data("pomegranate") with(pomegranate, desc(trat,WL))
library(AgroR) data("pomegranate") with(pomegranate, desc(trat,WL))
It performs the descriptive analysis of an experiment with two factors of interest.
desc2fat(f1, f2, response, ylab = "Response", theme = theme_classic())
desc2fat(f1, f2, response, ylab = "Response", theme = theme_classic())
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) |
theme |
ggplot2 theme (default is theme_classic()) |
The function returns exploratory measures of position and dispersion, such as mean, median, maximum, minimum, coefficient of variation, etc ...
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
library(AgroR) data(cloro) with(cloro, desc2fat(f1,f2,resp))
library(AgroR) data(cloro) with(cloro, desc2fat(f1,f2,resp))
Performs the descriptive graphical analysis of an experiment with three factors of interest.
desc3fat( f1, f2, f3, response, legend.title = "Legend", xlab = "", ylab = "Response", theme = theme_classic(), plot = "interaction" )
desc3fat( f1, f2, f3, response, legend.title = "Legend", xlab = "", ylab = "Response", theme = theme_classic(), plot = "interaction" )
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 (Accepts the expression() function) |
ylab |
Variable response name (Accepts the expression() function) |
theme |
ggplot theme |
plot |
"interaction" or "box" |
The function returns a triple interaction graph.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
library(AgroR) data(enxofre) with(enxofre, desc3fat(f1, f2, f3, resp))
library(AgroR) data(enxofre) with(enxofre, desc3fat(f1, f2, f3, resp))
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.
desd_fat2_quant_ad(output, ad.value = 0, design = "FAT2DIC.ad", grau = 1)
desd_fat2_quant_ad(output, ad.value = 0, design = "FAT2DIC.ad", grau = 1)
output |
Output from a FAT2DIC.ad or FAT2DBC.ad function |
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) |
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
#================================================== # 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)
#================================================== # 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)
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.
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 = NULL, width.bar = 0.3, addmean = TRUE, errorbar = TRUE, posi = "top", point = "mean_sd", pointsize = 5, angle.label = 0, ylim = NA )
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 = NULL, width.bar = 0.3, addmean = TRUE, errorbar = TRUE, posi = "top", point = "mean_sd", pointsize = 5, angle.label = 0, ylim = NA )
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 (Accepts the expression() 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 (Accepts the expression() 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. |
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.
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.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
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 = expression("Dose"~(g~vase^-1)), ylab="Leaf length (cm)")) #============================= # data transformation #============================= data("pepper") with(pepper, DIC(Acesso, VitC, transf = 0,ylab="Vitamin C"))
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 = expression("Dose"~(g~vase^-1)), ylab="Leaf length (cm)")) #============================= # data transformation #============================= data("pepper") with(pepper, DIC(Acesso, VitC, transf = 0,ylab="Vitamin C"))
Statistical analysis of experiments conducted in a completely randomized with an additional treatment and balanced design with a factor considering the fixed model.
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" )
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" )
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 (Accepts the expression() function) |
xlab |
Treatments name (Accepts the expression() 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. |
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.
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.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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))
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))
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.
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 )
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 )
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 (Accepts the expression() function) |
xlab |
Treatments name (Accepts the expression() 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 |
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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")
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")
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.
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 )
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 )
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 (Accepts the expression() function) |
ylab |
Variable response name (Accepts the expression() 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. |
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
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.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
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))
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))
It makes a graph with the variables and/or treatments with the standardized data.
dispvar( data, trat = NULL, theme = theme_bw(), ylab = "Standard mean", xlab = "Variable", family = "serif", textsize = 12, fill = "lightblue" )
dispvar( data, trat = NULL, theme = theme_bw(), ylab = "Standard mean", xlab = "Variable", family = "serif", textsize = 12, fill = "lightblue" )
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 |
Returns a chart of boxes with standardized data
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
library(AgroR) data("pomegranate") dispvar(pomegranate[,-1]) trat=pomegranate$trat dispvar(pomegranate[,-1], trat)
library(AgroR) data("pomegranate") dispvar(pomegranate[,-1]) trat=pomegranate$trat dispvar(pomegranate[,-1], trat)
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.
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 = NULL, width.bar = 0.3, addmean = TRUE, errorbar = TRUE, posi = "top", point = "mean_sd", pointsize = 5, angle.label = 0, ylim = NA )
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 = NULL, width.bar = 0.3, addmean = TRUE, errorbar = TRUE, posi = "top", point = "mean_sd", pointsize = 5, angle.label = 0, ylim = NA )
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. |
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.
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.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
library(AgroR) data(porco) with(porco, DQL(trat, linhas, colunas, resp, ylab="Weigth (kg)"))
library(AgroR) data(porco) with(porco, DQL(trat, linhas, colunas, resp, ylab="Weigth (kg)"))
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.
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 )
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 )
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 (Accepts the expression() function) |
ylab |
Variable response name (Accepts the expression() 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. |
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).
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
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.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
rm(list=ls()) data(simulate3) attach(simulate3) DQLT(trat, linhas, colunas, tempo, resp)
rm(list=ls()) data(simulate3) attach(simulate3) DQLT(trat, linhas, colunas, tempo, resp)
Perform Kruskal wallis and dunn post-hoc test
dunn(trat, resp, method = "holm", alpha = 0.05, decreasing = TRUE)
dunn(trat, resp, method = "holm", alpha = 0.05, decreasing = TRUE)
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. |
Kruskal-wallis and dunn's post-hoc test returns
Gabriel Danilo Shimizu, [email protected]
library(AgroR) data(pomegranate) with(pomegranate, dunn(trat, WL))
library(AgroR) data(pomegranate) with(pomegranate, dunn(trat, WL))
The function performs the Dunnett test
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", fontfamily = "sans" )
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", fontfamily = "sans" )
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 |
fontfamily |
font family |
I return the Dunnett test for experiments in a completely randomized design, randomized blocks or Latin square.
Do not use the "-" symbol or space in treatment names
#==================================================== # 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", legend = "Stages",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"))
#==================================================== # 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", legend = "Stages",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"))
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.
data("emerg")
data("emerg")
data.frame containing data set
time
numeric vector with time
resp
Numeric vector with emergence
aristolochia, cloro, laranja, enxofre, laranja, mirtilo, passiflora, phao, porco, pomegranate, simulate1, simulate2, simulate3, tomate, weather
data(emerg)
data(emerg)
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.
data(enxofre)
data(enxofre)
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
cloro, laranja, mirtilo, pomegranate, porco, sensorial, simulate1, simulate2, simulate3, tomate, weather, phao, passiflora, aristolochia
data(enxofre)
data(enxofre)
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.
data("eucalyptus")
data("eucalyptus")
data.frame containing data set
trati
Categorical vector with treatments
bloc
Categorical vector with block
exp
Categorical vector with experiment
resp
Numeric vector
Planejamento e Analise Estatistica de Experimentos Agronomicos (2013) - Decio Barbin - pg. 177
cloro, enxofre, laranja, pomegranate, porco, sensorial, simulate1, simulate2, simulate3, tomate, weather
data(eucalyptus)
data(eucalyptus)
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.
fat2_table(output, nf1, nf2, column = 1)
fat2_table(output, nf1, nf2, column = 1)
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 |
returns a list containing analysis output for experiments in FAT2DIC, FAT2DIC.ad, FAT2DBC, FAT2DBC.ad, PSUBDIC and PSUBDBC design.
Gabriel Danilo Shimizu
#============================================================== 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)
#============================================================== 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)
Analysis of an experiment conducted in a randomized block design in a double factorial scheme using analysis of variance of fixed effects.
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", xlab = "", xlab.factor = c("F1", "F2"), 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 )
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", xlab = "", xlab.factor = c("F1", "F2"), 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 )
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 |
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 (Accepts the expression() function) |
xlab |
Treatments name (Accepts the expression() function) |
xlab.factor |
Provide a vector with two observations referring to the x-axis name of factors 1 and 2, respectively, when there is an isolated effect of the factors. This argument uses 'parse'. |
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 |
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.
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.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
#================================================ # Example cloro #================================================ library(AgroR) data(cloro) attach(cloro) FAT2DBC(f1, f2, bloco, resp, ylab="Number of nodules", legend = "Stages") FAT2DBC(f1, f2, bloco, resp, mcomp="sk", ylab="Number of nodules", legend = "Stages") #================================================ # Example covercrops #================================================ library(AgroR) data(covercrops) attach(covercrops) FAT2DBC(A, B, Bloco, Resp, ylab=expression("Yield"~(Kg~"100 m"^2)), legend = "Cover crops") FAT2DBC(A, B, Bloco, Resp, mcomp="sk", ylab=expression("Yield"~(Kg~"100 m"^2)), legend = "Cover crops")
#================================================ # Example cloro #================================================ library(AgroR) data(cloro) attach(cloro) FAT2DBC(f1, f2, bloco, resp, ylab="Number of nodules", legend = "Stages") FAT2DBC(f1, f2, bloco, resp, mcomp="sk", ylab="Number of nodules", legend = "Stages") #================================================ # Example covercrops #================================================ library(AgroR) data(covercrops) attach(covercrops) FAT2DBC(A, B, Bloco, Resp, ylab=expression("Yield"~(Kg~"100 m"^2)), legend = "Cover crops") FAT2DBC(A, B, Bloco, Resp, mcomp="sk", ylab=expression("Yield"~(Kg~"100 m"^2)), legend = "Cover crops")
Analysis of an experiment conducted in a randomized block design in a double factorial scheme using analysis of variance of fixed effects.
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", xlab = "", xlab.factor = c("F1", "F2"), legend = "Legend", 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 )
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", xlab = "", xlab.factor = c("F1", "F2"), legend = "Legend", 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 )
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 |
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 (Accepts the expression() function) |
xlab |
Treatments name (Accepts the expression() function) |
xlab.factor |
Provide a vector with two observations referring to the x-axis name of factors 1 and 2, respectively, when there is an isolated effect of the factors. This argument uses 'parse'. |
legend |
Legend title name |
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 |
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.
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.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
library(AgroR) data(cloro) respAd=c(268, 322, 275, 350, 320) with(cloro, FAT2DBC.ad(f1, f2, bloco, resp, respAd, ylab="Number of nodules", legend = "Stages"))
library(AgroR) data(cloro) respAd=c(268, 322, 275, 350, 320) with(cloro, FAT2DBC.ad(f1, f2, bloco, resp, respAd, ylab="Number of nodules", legend = "Stages"))
Analysis of an experiment conducted in a completely randomized design in a double factorial scheme using analysis of variance of fixed effects.
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", xlab = "", xlab.factor = c("F1", "F2"), legend = "Legend", 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 )
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", xlab = "", xlab.factor = c("F1", "F2"), legend = "Legend", 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 )
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 |
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 (Accepts the expression() function) |
xlab |
Treatments name (Accepts the expression() function) |
xlab.factor |
Provide a vector with two observations referring to the x-axis name of factors 1 and 2, respectively, when there is an isolated effect of the factors. This argument uses 'parse'. |
legend |
Legend title name |
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 |
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.
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.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
#==================================== # Example cloro #==================================== library(AgroR) data(cloro) with(cloro, FAT2DIC(f1, f2, resp, ylab="Number of nodules", legend = "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)"))
#==================================== # Example cloro #==================================== library(AgroR) data(cloro) with(cloro, FAT2DIC(f1, f2, resp, ylab="Number of nodules", legend = "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 of an experiment conducted in a completely randomized design in a double factorial scheme using analysis of variance of fixed effects.
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", xlab = "", xlab.factor = c("F1", "F2"), legend = "Legend", 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 )
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", xlab = "", xlab.factor = c("F1", "F2"), legend = "Legend", 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 )
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 |
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 (Accepts the expression() function) |
xlab |
Treatments name (Accepts the expression() function) |
xlab.factor |
Provide a vector with two observations referring to the x-axis name of factors 1 and 2, respectively, when there is an isolated effect of the factors. This argument uses 'parse'. |
legend |
Legend title name |
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 |
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.
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.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
library(AgroR) data(cloro) respAd=c(268, 322, 275, 350, 320) with(cloro, FAT2DIC.ad(f1, f2, bloco, resp, respAd, ylab="Number of nodules", legend = "Stages"))
library(AgroR) data(cloro) respAd=c(268, 322, 275, 350, 320) with(cloro, FAT2DIC.ad(f1, f2, bloco, resp, respAd, ylab="Number of nodules", legend = "Stages"))
Analysis of an experiment conducted in a randomized block design in a triple factorial scheme using analysis of variance of fixed effects.
FAT3DBC( f1, f2, f3, block, response, norm = "sw", alpha.f = 0.05, alpha.t = 0.05, quali = c(TRUE, TRUE, TRUE), mcomp = "tukey", transf = 1, constant = 0, names.fat = c("F1", "F2", "F3"), ylab = "Response", xlab = "", xlab.factor = c("F1", "F2", "F3"), sup = NA, grau = c(NA, NA, NA), grau12 = NA, grau13 = NA, grau23 = NA, grau21 = NA, grau31 = NA, grau32 = NA, grau123 = NA, grau213 = NA, grau312 = NA, fill = "lightblue", theme = theme_classic(), angulo = 0, errorbar = TRUE, addmean = TRUE, family = "sans", dec = 3, geom = "bar", textsize = 12, labelsize = 4, point = "mean_sd", angle.label = 0 )
FAT3DBC( f1, f2, f3, block, response, norm = "sw", alpha.f = 0.05, alpha.t = 0.05, quali = c(TRUE, TRUE, TRUE), mcomp = "tukey", transf = 1, constant = 0, names.fat = c("F1", "F2", "F3"), ylab = "Response", xlab = "", xlab.factor = c("F1", "F2", "F3"), sup = NA, grau = c(NA, NA, NA), grau12 = NA, grau13 = NA, grau23 = NA, grau21 = NA, grau31 = NA, grau32 = NA, grau123 = NA, grau213 = NA, grau312 = NA, fill = "lightblue", theme = theme_classic(), angulo = 0, errorbar = TRUE, addmean = TRUE, family = "sans", dec = 3, geom = "bar", textsize = 12, labelsize = 4, point = "mean_sd", angle.label = 0 )
f1 |
Numeric or complex vector with factor 1 levels |
f2 |
Numeric or complex vector with factor 2 levels |
f3 |
Numeric or complex vector with factor 3 levels |
block |
Numerical or complex vector with blocks |
response |
Numerical vector containing the response of the experiment. |
norm |
Error normality test (default is Shapiro-Wilk) |
alpha.f |
Level of significance of the F test (default is 0.05) |
alpha.t |
Significance level of the multiple comparison test (default is 0.05) |
quali |
Defines whether the factor is quantitative or qualitative (qualitative) |
mcomp |
Multiple comparison test (Tukey (default), LSD, Scott-Knott and Duncan) |
transf |
Applies data transformation (default is 1; for log consider 0; 'angular' for angular transformation) |
constant |
Add a constant for transformation (enter value) |
names.fat |
Allows labeling the factors 1, 2 and 3. |
ylab |
Variable response name (Accepts the expression() function) |
xlab |
Treatments name (Accepts the expression() function) |
xlab.factor |
Provide a vector with two observations referring to the x-axis name of factors 1, 2 and 3, respectively, when there is an isolated effect of the factors. This argument uses 'parse'. |
sup |
Number of units above the standard deviation or average bar on the graph |
grau |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with three elements. |
grau12 |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 2, in the case of interaction f1 x f2 and qualitative factor 2 and quantitative factor 1. |
grau13 |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 3, in the case of interaction f1 x f3 and qualitative factor 3 and quantitative factor 1. |
grau23 |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 3, in the case of interaction f2 x f3 and qualitative factor 3 and quantitative factor 2. |
grau21 |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 1, in the case of interaction f1 x f2 and qualitative factor 1 and quantitative factor 2. |
grau31 |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 1, in the case of interaction f1 x f3 and qualitative factor 1 and quantitative factor 3. |
grau32 |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 2, in the case of interaction f2 x f3 and qualitative factor 2 and quantitative factor 3. |
grau123 |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 1, in the case of interaction f1 x f2 x f3 and quantitative factor 1. |
grau213 |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 2, in the case of interaction f1 x f2 x f3 and quantitative factor 2. |
grau312 |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 3, in the case of interaction f1 x f2 x f3 and quantitative factor 3. |
fill |
Defines chart color (to generate different colors for different treatments, define fill = "trat") |
theme |
ggplot2 theme (default is theme_classic()) |
angulo |
x-axis scale text rotation |
errorbar |
Plot the standard deviation bar on the graph (In the case of a segment and column graph) - default is TRUE |
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 |
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.
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.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
library(AgroR) data(enxofre) with(enxofre, FAT3DBC(f1, f2, f3, bloco, resp))
library(AgroR) data(enxofre) with(enxofre, FAT3DBC(f1, f2, f3, bloco, resp))
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.
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", xlab = "", xlab.factor = c("F1", "F2", "F3"), sup = NA, grau = c(NA, NA, NA), grau12 = NA, grau13 = NA, grau23 = NA, grau21 = NA, grau31 = NA, grau32 = NA, grau123 = NA, grau213 = NA, grau312 = NA, fill = "lightblue", theme = theme_classic(), 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 )
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", xlab = "", xlab.factor = c("F1", "F2", "F3"), sup = NA, grau = c(NA, NA, NA), grau12 = NA, grau13 = NA, grau23 = NA, grau21 = NA, grau31 = NA, grau32 = NA, grau123 = NA, grau213 = NA, grau312 = NA, fill = "lightblue", theme = theme_classic(), 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 )
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. |
ylab |
Variable response name (Accepts the expression() function) |
xlab |
Treatments name (Accepts the expression() function) |
xlab.factor |
Provide a vector with two observations referring to the x-axis name of factors 1, 2 and 3, respectively, when there is an isolated effect of the factors. This argument uses 'parse'. |
sup |
Number of units above the standard deviation or average bar on the graph |
grau |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with three elements. |
grau12 |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 2, in the case of interaction f1 x f2 and qualitative factor 2 and quantitative factor 1. |
grau13 |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 3, in the case of interaction f1 x f3 and qualitative factor 3 and quantitative factor 1. |
grau23 |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 3, in the case of interaction f2 x f3 and qualitative factor 3 and quantitative factor 2. |
grau21 |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 1, in the case of interaction f1 x f2 and qualitative factor 1 and quantitative factor 2. |
grau31 |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 1, in the case of interaction f1 x f3 and qualitative factor 1 and quantitative factor 3. |
grau32 |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 2, in the case of interaction f2 x f3 and qualitative factor 2 and quantitative factor 3. |
grau123 |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 1, in the case of interaction f1 x f2 x f3 and quantitative factor 1. |
grau213 |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 2, in the case of interaction f1 x f2 x f3 and quantitative factor 2. |
grau312 |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 3, in the case of interaction f1 x f2 x f3 and quantitative factor 3. |
fill |
Defines chart color (to generate different colors for different treatments, define fill = "trat") |
theme |
ggplot2 theme (default is theme_classic()) |
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 |
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.
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.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
library(AgroR) data(enxofre) respAd=c(2000,2400,2530,2100) attach(enxofre) with(enxofre, FAT3DBC.ad(f1, f2, f3, bloco, resp, respAd))
library(AgroR) data(enxofre) respAd=c(2000,2400,2530,2100) attach(enxofre) with(enxofre, FAT3DBC.ad(f1, f2, f3, bloco, resp, respAd))
Analysis of an experiment conducted in a completely randomized design in a triple factorial scheme using analysis of variance of fixed effects.
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", xlab = "", xlab.factor = c("F1", "F2", "F3"), 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 )
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", xlab = "", xlab.factor = c("F1", "F2", "F3"), 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 )
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. |
ylab |
Variable response name (Accepts the expression() function) |
xlab |
treatments name (Accepts the expression() function) |
xlab.factor |
Provide a vector with two observations referring to the x-axis name of factors 1, 2 and 3, respectively, when there is an isolated effect of the factors. This argument uses 'parse'. |
sup |
Number of units above the standard deviation or average bar on the graph |
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 |
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.
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.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
library(AgroR) data(enxofre) with(enxofre, FAT3DIC(f1, f2, f3, resp))
library(AgroR) data(enxofre) with(enxofre, FAT3DIC(f1, f2, f3, resp))
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.
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", xlab = "", xlab.factor = c("F1", "F2", "F3"), sup = NA, grau = c(NA, NA, NA), grau12 = NA, grau13 = NA, grau23 = NA, grau21 = NA, grau31 = NA, grau32 = NA, grau123 = NA, grau213 = NA, grau312 = NA, fill = "lightblue", theme = theme_classic(), 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 )
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", xlab = "", xlab.factor = c("F1", "F2", "F3"), sup = NA, grau = c(NA, NA, NA), grau12 = NA, grau13 = NA, grau23 = NA, grau21 = NA, grau31 = NA, grau32 = NA, grau123 = NA, grau213 = NA, grau312 = NA, fill = "lightblue", theme = theme_classic(), 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 )
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. |
ylab |
Variable response name (Accepts the expression() function) |
xlab |
Treatments name (Accepts the expression() function) |
xlab.factor |
Provide a vector with two observations referring to the x-axis name of factors 1, 2 and 3, respectively, when there is an isolated effect of the factors. This argument uses 'parse'. |
sup |
Number of units above the standard deviation or average bar on the graph |
grau |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with three elements. |
grau12 |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 2, in the case of interaction f1 x f2 and qualitative factor 2 and quantitative factor 1. |
grau13 |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 3, in the case of interaction f1 x f3 and qualitative factor 3 and quantitative factor 1. |
grau23 |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 3, in the case of interaction f2 x f3 and qualitative factor 3 and quantitative factor 2. |
grau21 |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 1, in the case of interaction f1 x f2 and qualitative factor 1 and quantitative factor 2. |
grau31 |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 1, in the case of interaction f1 x f3 and qualitative factor 1 and quantitative factor 3. |
grau32 |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 2, in the case of interaction f2 x f3 and qualitative factor 2 and quantitative factor 3. |
grau123 |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 1, in the case of interaction f1 x f2 x f3 and quantitative factor 1. |
grau213 |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 2, in the case of interaction f1 x f2 x f3 and quantitative factor 2. |
grau312 |
Polynomial degree in case of quantitative factor (default is 1). Provide a vector with n levels of factor 3, in the case of interaction f1 x f2 x f3 and quantitative factor 3. |
fill |
Defines chart color (to generate different colors for different treatments, define fill = "trat") |
theme |
ggplot2 theme (default is theme_classic()) |
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 |
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.
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.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
library(AgroR) data(enxofre) respAd=c(2000,2400,2530,2100) with(enxofre, FAT3DIC.ad(f1, f2, f3, bloco, resp, respAd))
library(AgroR) data(enxofre) respAd=c(2000,2400,2530,2100) with(enxofre, FAT3DIC.ad(f1, f2, f3, bloco, resp, respAd))
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)
grid.onefactor(output, model = "type1")
grid.onefactor(output, model = "type1")
output |
Vector with the outputs of the DIC, DBC or DQL functions |
model |
Graph arrangement model, see in detail. |
- '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
returns grouped graphs
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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(c(a,b),model = "type1") grid.onefactor(c(a,b),model = "type2") grid.onefactor(c(a,b,c),model = "type3") grid.onefactor(c(a,b,c),model = "type4")
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(c(a,b),model = "type1") grid.onefactor(c(a,b),model = "type2") grid.onefactor(c(a,b,c),model = "type3") grid.onefactor(c(a,b,c),model = "type4")
invert uppercase and lowercase letters in graph for factorial scheme the subdivided plot with significant interaction
ibarplot.double(analysis)
ibarplot.double(analysis)
analysis |
FAT2DIC, FAT2DBC, PSUBDIC or PSUBDBC object |
Return column chart for two factors
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)
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)
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.
jointcluster(qmres, information = "matrix", method.cluster = "ward.D")
jointcluster(qmres, information = "matrix", method.cluster = "ward.D")
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 |
Returns a residual mean square ratio matrix, bar graph with ratios sorted in ascending order, or cluster analysis.
Gabriel Danilo Shimizu, [email protected]
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)
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)
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.
data(laranja)
data(laranja)
data.frame containing data set
f1
Categorical vector with treatments
bloco
Categorical vector with block
resp
Numeric vector with number of fruits per plant
Planejamento e Analise Estatistica de Experimentos Agronomicos (2013) - Decio Barbin - pg. 72
cloro, enxofre, mirtilo, pomegranate, porco, sensorial, simulate1, simulate2, simulate3, tomate, weather, phao, passiflora, aristolochia
data(laranja)
data(laranja)
Performs a descriptive line graph with standard deviation bars
line_plot( time, response, factor = NA, errorbar = "sd", ylab = "Response", xlab = "Time", legend.position = "right", theme = theme_classic() )
line_plot( time, response, factor = NA, errorbar = "sd", ylab = "Response", xlab = "Time", legend.position = "right", theme = theme_classic() )
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 |
xlab |
x axis title |
legend.position |
Legend position |
theme |
ggplot2 theme (default is theme_classic()) |
Returns a line chart with error bars
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
radargraph, sk_graph, plot_TH, corgraph, spider_graph
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)
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)
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).
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" )
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" )
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) |
The three-parameter log-logistic function with lower limit 0 is
The four-parameter log-logistic function is given by the expression
The function is symmetric about the inflection point (e).
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).
Model imported from the drc package (Ritz et al., 2016)
Gabriel Danilo Shimizu
Leandro Simoes Azeredo Goncalves
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.
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 (%)"))
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 (%)"))
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.
data(mirtilo)
data(mirtilo)
data.frame containing data set
trat
Categorical vector with treatments
exp
Categorical vector with experiment
bloco
Categorical vector with block
resp
Numeric vector
cloro, enxofre, laranja, pomegranate, porco, sensorial, simulate1, simulate2, simulate3, tomate, weather
data(mirtilo) attach(mirtilo)
data(mirtilo) attach(mirtilo)
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.
data(orchard)
data(orchard)
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
enxofre, laranja, mirtilo, pomegranate, porco, sensorial, simulate1, simulate2, simulate3, tomate, weather, phao, passiflora, aristolochia
data(orchard)
data(orchard)
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)
data(passiflora)
data(passiflora)
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
cloro, enxofre, laranja, mirtilo, pomegranate, porco, sensorial, simulate1, simulate2, simulate3, tomate, weather
data(passiflora)
data(passiflora)
This function performs principal component analysis.
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" )
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" )
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 |
xlab |
Names x-axis |
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) |
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.
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.
Gabriel Danilo Shimizu
data(pomegranate) medias=tabledesc(pomegranate) PCA_function(medias)
data(pomegranate) medias=tabledesc(pomegranate) PCA_function(medias)
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
data(pepper)
data(pepper)
data.frame containing data set
Acesso
Categorical vector with accessions
MS
Numeric vector com dry mass
VitC
Numeric vector with Vitamin C
enxofre, laranja, mirtilo, pomegranate, porco, sensorial, simulate1, simulate2, simulate3, tomate, weather, phao, passiflora, aristolochia
data(pepper)
data(pepper)
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.
data(phao)
data(phao)
data.frame containing data set
dose
Numeric vector with doses
comp
Numeric vector with leaf length
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.
pomegranate, passiflora, cloro, enxofre, laranja, mirtilo, porco, sensorial, simulate1, simulate2, simulate3, tomate, weather
data(phao)
data(phao)
Correlation analysis function (Pearson or Spearman)
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" )
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" )
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 |
The function returns a graph for correlation
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
data("pomegranate") with(pomegranate, plot_cor(WL, SS, xlab="WL", ylab="SS"))
data("pomegranate") with(pomegranate, plot_cor(WL, SS, xlab="WL", ylab="SS"))
Performs an interaction graph from an output of the FAT2DIC, FAT2DBC, PSUBDIC or PSUBDBC commands.
plot_interaction( a, box_label = TRUE, repel = FALSE, pointsize = 3, linesize = 0.8, width.bar = 0.05, add.errorbar = TRUE )
plot_interaction( a, box_label = TRUE, repel = FALSE, pointsize = 3, linesize = 0.8, width.bar = 0.05, add.errorbar = TRUE )
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. |
Returns an interaction graph with averages and letters from the multiple comparison test
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
data(cloro) a=with(cloro, FAT2DIC(f1, f2, resp)) plot_interaction(a)
data(cloro) a=with(cloro, FAT2DIC(f1, f2, resp)) plot_interaction(a)
The function performs the construction of graphs of boxes, columns or segments with all the observations represented in the graph.
plot_jitter(model)
plot_jitter(model)
model |
DIC, DBC or DQL object |
Returns with graph of boxes, columns or segments with all the observations represented in the graph.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
data("pomegranate") a=with(pomegranate,DIC(trat,WL,geom="point")) plot_jitter(a)
data("pomegranate") a=with(pomegranate,DIC(trat,WL,geom="point")) plot_jitter(a)
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
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() )
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() )
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 |
Returns row and column graphs for graphical representation of air temperature and relative humidity. Graph normally used in scientific articles
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
radargraph, sk_graph, barplot_positive, corgraph, plot_TH1, spider_graph, line_plot
library(AgroR) data(weather) with(weather, plot_TH(tempo, Tmed, Tmax, Tmin, UR))
library(AgroR) data(weather) with(weather, plot_TH(tempo, Tmed, Tmax, Tmin, UR))
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
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) )
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) )
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 |
Returns row and column graphs for graphical representation of air temperature and relative humidity. Graph normally used in scientific articles
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
radargraph, sk_graph, barplot_positive, corgraph, spider_graph, line_plot
library(AgroR) data(weather) with(weather, plot_TH1(tempo, Tmed, Tmax, Tmin, UR))
library(AgroR) data(weather) with(weather, plot_TH1(tempo, Tmed, Tmax, Tmin, UR))
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.
plot_tonetest(tonetest, alpha = 0.95)
plot_tonetest(tonetest, alpha = 0.95)
tonetest |
t.one.test object |
alpha |
confidence level. |
returns a density plot and a column plot to compare a reference value with other treatments.
Gabriel Danilo Shimizu
library(AgroR) data("pomegranate") resu=tonetest(resp=pomegranate$WL, trat=pomegranate$trat, mu=2) plot_tonetest(resu)
library(AgroR) data("pomegranate") resu=tonetest(resp=pomegranate$WL, trat=pomegranate$trat, mu=2) plot_tonetest(resu)
Linear regression analysis of an experiment with a quantitative factor or isolated effect of a quantitative factor
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 )
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 )
trat |
Numerical vector with treatments (Declare as numeric) |
resp |
Numerical vector containing the response of the experiment. |
ylab |
Dependent variable name (Accepts the expression() function) |
xlab |
Independent variable name (Accepts the expression() 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 |
Returns linear, quadratic or cubic regression analysis.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
polynomial2, polynomial2_color
data("phao") with(phao, polynomial(dose,comp, grau = 2))
data("phao") with(phao, polynomial(dose,comp, grau = 2))
Linear regression analysis for significant interaction of an experiment with two factors, one quantitative and one qualitative
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 )
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 )
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 (Accepts the expression() function) |
xlab |
Independent variable name (Accepts the expression() 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 |
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 |
Returns two or more linear, quadratic or cubic regression analyzes.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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))
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))
Linear regression analysis for significant interaction of an experiment with two factors, one quantitative and one qualitative
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 )
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 )
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 (Accepts the expression() function) |
xlab |
Independent variable name (Accepts the expression() 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 |
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 |
Returns two or more linear, quadratic or cubic regression analyzes.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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))
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))
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
data(pomegranate)
data(pomegranate)
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)
cloro, enxofre, laranja, mirtilo, porco, sensorial, simulate1, simulate2, simulate3, tomate, weather, phao, passiflora
data(pomegranate)
data(pomegranate)
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.
data(porco)
data(porco)
data.frame containing data set
trat
Categorical vector with treatments
linhas
Categorical vector with lines
colunas
Categorical vector with columns
resp
Numeric vector
cloro, enxofre, laranja, mirtilo, pomegranate, sensorial, simulate1, simulate2, simulate3, tomate, weather, phao, passiflora, aristolochia
data(porco)
data(porco)
Analysis of an experiment conducted in a randomized block design in a split-plot scheme using fixed effects analysis of variance.
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", xlab = "", xlab.factor = c("F1", "F2"), color = "rainbow", textsize = 12, labelsize = 4, dec = 3, legend = "Legend", errorbar = TRUE, addmean = TRUE, ylim = NA, point = "mean_se", fill = "lightblue", angle = 0, family = "sans", posi = "right", angle.label = 0 )
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", xlab = "", xlab.factor = c("F1", "F2"), color = "rainbow", textsize = 12, labelsize = 4, dec = 3, legend = "Legend", errorbar = TRUE, addmean = TRUE, ylim = NA, point = "mean_se", fill = "lightblue", angle = 0, family = "sans", posi = "right", angle.label = 0 )
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 |
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 (Accepts the expression() function) |
xlab |
Treatments name (Accepts the expression() function) |
xlab.factor |
Provide a vector with two observations referring to the x-axis name of factors 1 and 2, respectively, when there is an isolated effect of the factors. This argument uses 'parse'. |
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) |
legend |
Legend title name |
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 |
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.
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.
Gabriel Danilo Shimizu
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.
#============================== # 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"))
#============================== # 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 of an experiment conducted in a completely randomized design in a split-plot scheme using fixed effects analysis of variance.
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", xlab = "", xlab.factor = c("F1", "F2"), fill = "lightblue", angle = 0, family = "sans", color = "rainbow", legend = "Legend", errorbar = TRUE, addmean = TRUE, textsize = 12, labelsize = 4, dec = 3, ylim = NA, posi = "right", point = "mean_se", angle.label = 0 )
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", xlab = "", xlab.factor = c("F1", "F2"), fill = "lightblue", angle = 0, family = "sans", color = "rainbow", legend = "Legend", errorbar = TRUE, addmean = TRUE, textsize = 12, labelsize = 4, dec = 3, ylim = NA, posi = "right", point = "mean_se", angle.label = 0 )
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 |
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 (Accepts the expression() function) |
xlab |
Treatments name (Accepts the expression() function) |
xlab.factor |
Provide a vector with two observations referring to the x-axis name of factors 1 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") |
legend |
Legend title name |
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 |
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.
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.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
#=================================== # 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)"))
#=================================== # 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)"))
This function performs the analysis of a randomized block design in a split-plot with a subplot in a double factorial scheme.
PSUBFAT2DBC( f1, f2, f3, block, resp, alpha.f = 0.05, alpha.t = 0.05, norm = "sw", homog = "bt", mcomp = "tukey" )
PSUBFAT2DBC( f1, f2, f3, block, resp, alpha.f = 0.05, alpha.t = 0.05, norm = "sw", homog = "bt", mcomp = "tukey" )
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) |
Analysis of variance of fixed effects and multiple comparison test of Tukey, Scott-Knott, LSD or Duncan.
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
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 of an experiment conducted in a randomized block design in a split-split-plot scheme using analysis of variance of fixed effects.
PSUBSUBDBC( f1, f2, f3, block, response, alpha.f = 0.05, alpha.t = 0.05, dec = 3, mcomp = "tukey" )
PSUBSUBDBC( f1, f2, f3, block, response, alpha.f = 0.05, alpha.t = 0.05, dec = 3, mcomp = "tukey" )
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) |
Analysis of variance of fixed effects and multiple comparison test of Tukey, LSD or Duncan.
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.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
library(AgroR) data(enxofre) with(enxofre, PSUBSUBDBC(f1, f2, f3, bloco, resp))
library(AgroR) data(enxofre) with(enxofre, PSUBSUBDBC(f1, f2, f3, bloco, resp))
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.
quant.fat2.desd(factors = list(f1, f2, block), response, dec = 3)
quant.fat2.desd(factors = list(f1, f2, block), response, dec = 3)
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 |
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.
Gabriel Danilo Shimizu, [email protected]
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)
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)
Circular column chart of an experiment with a factor of interest or isolated effect of a factor
radargraph(model, ylim = NA, labelsize = 4, transf = FALSE)
radargraph(model, ylim = NA, labelsize = 4, transf = FALSE)
model |
DIC, DBC or DQL object |
ylim |
y-axis limit |
labelsize |
Font size of the labels |
transf |
If the data has been transformed (default is FALSE) |
Returns pie chart with averages and letters from the Scott-Knott cluster test
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
barplot_positive, sk_graph, plot_TH, corgraph, spider_graph, line_plot
data("laranja") a=with(laranja, DBC(trat,bloco,resp, mcomp = "sk")) radargraph(a)
data("laranja") a=with(laranja, DBC(trat,bloco,resp, mcomp = "sk")) radargraph(a)
This is a function of the point graph for one factor
seg_graph(model, fill = "lightblue", horiz = TRUE, pointsize = 4.5)
seg_graph(model, fill = "lightblue", horiz = TRUE, pointsize = 4.5)
model |
DIC, DBC or DQL object |
fill |
fill bars |
horiz |
Horizontal Column (default is TRUE) |
pointsize |
Point size |
Returns a point chart for one factor
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
radargraph, barplot_positive, plot_TH, corgraph, spider_graph, line_plot
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)
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)
This is a function of the point graph for one factor
seg_graph2( model, theme = theme_gray(), pointsize = 4, pointshape = 16, horiz = TRUE, vjust = -0.6 )
seg_graph2( model, theme = theme_gray(), pointsize = 4, pointshape = 16, horiz = TRUE, vjust = -0.6 )
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 |
Returns a point chart for one factor
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
radargraph, barplot_positive, plot_TH, corgraph, spider_graph, line_plot
data("laranja") a=with(laranja, DBC(trat, bloco, resp, mcomp = "sk",angle=45, ylab = "Number of fruits/plants")) seg_graph2(a,horiz = FALSE)
data("laranja") a=with(laranja, DBC(trat, bloco, resp, mcomp = "sk",angle=45, ylab = "Number of fruits/plants")) seg_graph2(a,horiz = FALSE)
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.
data(sensorial)
data(sensorial)
data.frame containing data set
Blend
Categorical vector with treatment
variable
Categorical vector with variables
resp
Numeric vector
cloro, enxofre, laranja, mirtilo, pomegranate, porco, simulate1, simulate2, simulate3, tomate, weather, phao, passiflora, aristolochia
data(sensorial)
data(sensorial)
Simulated data from a completely randomized experiment with multiple assessments over time
data(simulate1)
data(simulate1)
data.frame containing data set
tempo
Categorical vector with time
trat
Categorical vector with treatment
resp
Categorical vector with response
cloro, enxofre, laranja, mirtilo, pomegranate, porco, sensorial, simulate2, simulate3, tomate, weather, phao, passiflora, aristolochia
data(simulate1)
data(simulate1)
Simulated data from a latin square experiment with multiple assessments over time
data(simulate2)
data(simulate2)
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
cloro, enxofre, laranja, mirtilo, pomegranate, porco, sensorial, simulate1, simulate3, tomate, weather, phao, passiflora, aristolochia
data(simulate2)
data(simulate2)
Simulated data from a completely randomized experiment with multiple assessments over time
data(simulate3)
data(simulate3)
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
cloro, enxofre, laranja, mirtilo, pomegranate, porco, sensorial, simulate1, simulate2, tomate, weather, phao, passiflora, aristolochia
data(simulate3)
data(simulate3)
This is a function of the bar graph for the Scott-Knott test
sk_graph(model, horiz = TRUE, fill.label = "lightyellow")
sk_graph(model, horiz = TRUE, fill.label = "lightyellow")
model |
DIC, DBC or DQL object |
horiz |
Horizontal Column (default is TRUE) |
fill.label |
fill Label box fill color |
Returns a bar chart with columns separated by color according to the Scott-Knott test
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
radargraph, barplot_positive, plot_TH, corgraph, spider_graph, line_plot
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)
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)
Experimental sketching function
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 )
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 )
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 |
Returns an experimental sketch according to the specified design.
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"
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
Mendiburu, F., & de Mendiburu, M. F. (2019). Package ‘agricolae’. R Package, Version, 1-2.
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")
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")
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.
data("soybean")
data("soybean")
data.frame containing data set
cult
numeric vector with treatment
bloc
numeric vector with block
prod
Numeric vector with grain yield
cloro, laranja, enxofre, laranja, mirtilo, passiflora, phao, porco, pomegranate, simulate1, simulate2, simulate3, tomate, weather
data(soybean)
data(soybean)
Spider chart or radar chart. Usually used for graphical representation of acceptability in sensory tests
spider_graph( resp, vari, blend, legend.title = "", xlab = "", ylab = "", ymin = 0 )
spider_graph( resp, vari, blend, legend.title = "", xlab = "", ylab = "", ymin = 0 )
resp |
Vector containing notes |
vari |
Vector containing the variables |
blend |
Vector containing treatments |
legend.title |
Caption title |
xlab |
x axis title |
ylab |
y axis title |
ymin |
Minimum value of y |
Returns a spider or radar chart. This graph is commonly used in studies of sensory analysis.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
radargraph, sk_graph, plot_TH, corgraph, barplot_positive, line_plot
library(AgroR) data(sensorial) with(sensorial, spider_graph(resp, variable, Blend))
library(AgroR) data(sensorial) with(sensorial, spider_graph(resp, variable, Blend))
Analysis of an experiment conducted in a block randomized design in a strit-plot scheme using fixed effects analysis of variance.
STRIPLOT( f1, f2, block, response, norm = "sw", alpha.f = 0.05, transf = 1, textsize = 12, labelsize = 4, constant = 0 )
STRIPLOT( f1, f2, block, response, norm = "sw", alpha.f = 0.05, transf = 1, textsize = 12, labelsize = 4, constant = 0 )
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) |
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.
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
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.
#=================================== # 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))
#=================================== # 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))
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.
summarise_anova(analysis, inf = "p", design = "DIC", round = 3, divisor = TRUE)
summarise_anova(analysis, inf = "p", design = "DIC", round = 3, divisor = TRUE)
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 |
returns a data.frame or print with a summary of the analysis of several experimental projects.
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.
Gabriel Danilo Shimizu
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))}) 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")
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))}) 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")
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.
summarise_conj(analysis, design = "DBC", info = "p")
summarise_conj(analysis, design = "DBC", info = "p")
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") |
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.
Gabriel Danilo Shimizu
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))
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))
Performs a summary in table form from a list of Dunnett's test outputs
summarise_dunnett(variable, colnames = NA, info = "sig")
summarise_dunnett(variable, colnames = NA, info = "sig")
variable |
List object Dunnett test |
colnames |
Names of column |
info |
Information of table |
A summary table from Dunnett's test is returned
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))
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))
Function for generating a data.frame with averages or other descriptive measures grouped by a categorical variable
tabledesc(data, fun = mean)
tabledesc(data, fun = mean)
data |
data.frame containing the first column with the categorical variable and the remaining response columns |
fun |
Function of descriptive statistics (default is mean) |
Returns a data.frame with a measure of dispersion or position from a dataset and separated by a factor
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
data(pomegranate) tabledesc(pomegranate) library(knitr) kable(tabledesc(pomegranate))
data(pomegranate) tabledesc(pomegranate) library(knitr) kable(tabledesc(pomegranate))
The function performs the construction of a reverse graph on the output of DICT, DBCT and DQL when geom="bar".
TBARPLOT.reverse(plot.t)
TBARPLOT.reverse(plot.t)
plot.t |
DICT, DBCT or DQLT output when geom="bar" |
Returns a reverse graph of the output of DICT, DBCT or DQLT when geom="bar".
All layout and subtitles are imported from DICT, DBCT and DQLT functions
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
data(simulate1) a=with(simulate1, DICT(trat, tempo, resp,geom="bar",sup=40)) TBARPLOT.reverse(a)
data(simulate1) a=with(simulate1, DICT(trat, tempo, resp,geom="bar",sup=40)) TBARPLOT.reverse(a)
Test for two samples (paired and unpaired t test, paired and unpaired Wilcoxon test)
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" )
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" )
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 (Accepts the expression() function) |
xlab |
Treatments name (Accepts the expression() 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 |
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.
Returns the test for two samples (paired or unpaired t test, paired or unpaired Wilcoxon test)
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
resp=rnorm(100,100,5) trat=rep(c("A","B"),e=50) test_two(trat,resp) test_two(trat,resp,paired = TRUE)
resp=rnorm(100,100,5) trat=rep(c("A","B"),e=50) test_two(trat,resp) test_two(trat,resp,paired = TRUE)
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.
data(tomate)
data(tomate)
data.frame containing data set
parc
Categorical vector with plot
subp
Categorical vector with split-plot
bloco
Categorical vector with block
resp
Numeric vector
cloro, enxofre, laranja, mirtilo, pomegranate, porco, sensorial, simulate1, simulate2, simulate3, weather, aristolochia, phao, passiflora
data(tomate)
data(tomate)
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.
tonetest(response, trat, mu = 0, alternative = "two.sided", conf.level = 0.95)
tonetest(response, trat, mu = 0, alternative = "two.sided", conf.level = 0.95)
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. |
returns a list with the mean per treatment, maximum, minimum, sample standard deviation, confidence interval, t-test statistic and its p-value.
No treatment can have zero variability. Otherwise the function will result in an error.
Gabriel Danilo Shimizu
library(AgroR) data("pomegranate") tonetest(resp=pomegranate$WL, trat=pomegranate$trat, mu=2, alternative = "greater")
library(AgroR) data("pomegranate") tonetest(resp=pomegranate$WL, trat=pomegranate$trat, mu=2, alternative = "greater")
Estimates the lambda value for data transformation
transf(response, f1, f2 = NA, f3 = NA, block = NA, line = NA, column = NA)
transf(response, f1, f2 = NA, f3 = NA, block = NA, line = NA, column = NA)
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 |
Returns the value of lambda and/or data transformation approximation, according to Box-Cox (1964)
Gabriel Danilo Shimizu, [email protected]
Leandro Simoes Azeredo Goncalves
Rodrigo Yudi Palhaci Marubayashi
Box, G. E., Cox, D. R. (1964). An analysis of transformations. Journal of the Royal Statistical Society: Series B (Methodological), 26(2), 211-243.
#================================================================ # 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))
#================================================================ # 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))
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)
data(weather)
data(weather)
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
cloro, enxofre, laranja, mirtilo, pomegranate, porco, sensorial, simulate1, simulate2, simulate3, tomate, aristolochia, phao, passiflora
data(weather)
data(weather)