Package 'ammiBayes'

Title: Bayesian Ammi Model for Continuous Data
Description: Flexible multi-environment trials analysis via MCMC method for Additive Main Effects and Multiplicative Model (AMMI) for continuous data. Biplot with the averages and regions of confidence can be generated. The chains run in parallel on Linux systems and run serially on Windows.
Authors: Luciano A. Oliveira [aut], Carlos P. Silva [aut], Cristian T. E. Mendes [aut], Alessandra Q. Silva [aut], Joel J. Nuvunga [aut], Marcio Balestre [ths], Julio S. S. Bueno-Filho [ths], Fabio M. Correa [aut, cre]
Maintainer: Fabio M. Correa <[email protected]>
License: GPL (>= 2)
Version: 1.0-2
Built: 2024-11-29 09:02:56 UTC
Source: CRAN

Help Index


Bayesian AMMI for continuous data

Description

Run the AMMI Bayesian model for continuous data.

Usage

ammiBayes(Y=Y, Gen=Gen, Env=Env, Rep=Rep, 
          iterations=3000, jump=2, burn=500,
          Var.error=0.5, Var.env=0.5, Var.gen=0.5,
          chains=2)

Arguments

Y

Response variable vector

Gen

Genotype effects vector. Must be defined as factor

Env

Environmental effects vector. Must be defined as factor

Rep

Repetition vector. Must be defined as factor

iterations

Total of iterations after burnin and jumo

jump

Jump of iterations

burn

Initial burn

Var.error

Priori for the variance of error. Default is 0.5

Var.env

Priori for the variance of environment. Default is 0.5

Var.gen

Priori for the variance of genotype. Default is 0.5

chains

Number of chains. See details.

Details

The code is run in parallel for linux SO. If you are using Windows, the execution of the code will be serially.

Author(s)

Luciano A. Oliveira
Carlos P. Silva
Cristian T. E. Mendes
Alessandra Q. Silva
Joel J. Nuvunga
Marcio Balestre
Julio S. S. Bueno-Filho
Fabio M. Correa

References

OLIVEIRA,L.A.; SILVA, C. P.; NUVUNGA, J. J.; SILVA, A. Q.; BALESTRE, M. Credible Intervals for Scores in the AMMI with Random Effects for Genotype. Crop Science, v. 55, p. 465-476, 2015. doi: https://doi.org/10.2135/cropsci2014.05.0369

SILVA, C. P.; OLIVEIRA, L. A.; NUVUNGA, J. J.; PAMPLONA, A. K. A.; BALESTRE, M. A Bayesian Shrinkage Approach for AMMI Models. Plos One, v. 10, p. e0131414, 2015. doi: https://doi.org/10.1371/journal.pone.0131414.

Examples

library(ammiBayes)
data(ammiData)

Env  <- factor(ammiData$amb)
Rep <- factor(ammiData$rep)
Gen  <- factor(ammiData$gen)
Y  <- ammiData$prod

model <- ammiBayes(Y=Y, Gen=Gen, Env=Env, Rep=Rep, iter=10, 
									 burn=1, jump=2, chains=2)

summary(model)

Plot ammiBayes object with confidence region

Description

Plot the confidence regions for genotype and environment effects

Usage

ammiBayes.conf.plot(model, conf=0.95, pars.gen=NULL, pars.env=NULL,
              gen.labels=NULL, env.labels=NULL,
              col.env="red", col.gen="green", 
              alpha.env=80, alpha.gen=80, 
              col.text.env="black", col.text.gen="black",
              border.gen="transparent", border.env="transparent", 
              cex.env=1, cex.gen=1, lty.gen=1, lty.env=1, 
              lwd.gen=1, lwd.env=1, xlab, ylab, col.grid="grey", 
              lty.grid=2, lwd.grid=1, change.signal=FALSE, 
              plot.gen=TRUE, plot.env=TRUE)

Arguments

model

An object of the ammiBayes class

conf

Significant level for the confidence region. By default is 0.95.

pars.gen

An optional character vector of genotype names. If pars is omitted all genotypes are included.

pars.env

An optional character vector of environment names. If pars is omitted all environments are included.

gen.labels

Optional vector for the name of the genotypes.

env.labels

Optional vector for the name of the environments.

col.env

Color for the confidence region of the environment. Default is "red".

col.gen

Color for the confidence region of the genotype. Default is "green".

alpha.env

Specifies the opacity of the confidence region for the environment. Default is 80.

alpha.gen

Specifies the opacity of the confidence region for the genotype. Default is 80.

col.text.env

Define the color of environment names.

col.text.gen

Define the color of genotype names.

border.gen

Define the color for the border of the confidence region of genotype. Default is "transparent".

border.env

Define the color for the border of the confidence region of environment. Default is "transparent".

cex.env

Scale for the font size of the environment names. Default is 1

cex.gen

Scale for the font size of the genotype names. Default is 1

lty.gen

Line type for the border of confidence region of genotype. Default is 1

lty.env

Line type for the border of confidence region of environment. Default is 1

lwd.gen

Line width for the border of confidence region of genotype. Default is 1

lwd.env

Line width for the border of confidence region of environment. Default is 1

xlab

Label for the x-axis

ylab

Label for the y-axis

col.grid

Define the color for the grid. Default is "grey"

lty.grid

Line type of grid. Default is 2

lwd.grid

Line width of grid. Default is 1

change.signal

Changes the signal of the chain for better visualization of the sample. By default is FALSE

plot.gen

Plot effects of genotypes. By default is TRUE

plot.env

PLot effects of environment. By default is TRUE

Details

The confidence regions are defined using the package distfree.cr.

Author(s)

Luciano A. Oliveira
Carlos P. Silva
Cristian T. E. Mendes
Alessandra Q. Silva
Joel J. Nuvunga
Marcio Balestre
Julio S. S. Bueno-Filho
Fabio M. Correa

References

OLIVEIRA,L.A.; SILVA, C. P.; NUVUNGA, J. J.; SILVA, A. Q.; BALESTRE, M. Credible Intervals for Scores in the AMMI with Random Effects for Genotype. Crop Science, v. 55, p. 465-476, 2015. doi: https://doi.org/10.2135/cropsci2014.05.0369

SILVA, C. P.; OLIVEIRA, L. A.; NUVUNGA, J. J.; PAMPLONA, A. K. A.; BALESTRE, M. A Bayesian Shrinkage Approach for AMMI Models. Plos One, v. 10, p. e0131414, 2015. doi: https://doi.org/10.1371/journal.pone.0131414.

See Also

lattice

Examples

library(ammiBayes)
data(ammiData)

Env  <- factor(ammiData$amb)
Rep <- factor(ammiData$rep)
Gen  <- factor(ammiData$gen)
Y  <- ammiData$prod

model <- ammiBayes(Y=Y, Gen=Gen, Env=Env, Rep=Rep, iter=10, burn=1, jump=2, chains=2)

ammiBayes.conf.plot(model)

Plot genotype effects from ammiBayes object

Description

Plot the posterior mean for an ammiBayes object

Usage

ammiBayes.gen.plot(x, lwd=1, lty=1, pch=18, method="bars",
                  col.bands=NULL, ylim=NULL,
                  xlab=NULL, ylab=NULL, gen.names=NULL)

Arguments

x

An object from gen.effects function.

lwd

A line width, a positive number, default is 1.

lty

The line type. Default is 1.

pch

Either an integer specifying a symbol or a single character to be used as the default in plotting points.

method

Defaults to "bars" to draw error-bar type plots. See panel.xYplot.

col.bands

Define the color of genotype bands.See xYplot.

ylim

A numeric vector of length 2 giving minimum and maximum for the y-axis.

xlab

Label for the x-axis.

ylab

Label for the y-axis.

gen.names

Define the names of genotypes on the x-axis. By default are the levels of the Genotypes.

Author(s)

Luciano A. Oliveira
Carlos P. Silva
Cristian T. E. Mendes
Alessandra Q. Silva
Joel J. Nuvunga
Marcio Balestre
Julio S. S. Bueno-Filho
Fabio M. Correa

References

OLIVEIRA,L.A.; SILVA, C. P.; NUVUNGA, J. J.; SILVA, A. Q.; BALESTRE, M. Credible Intervals for Scores in the AMMI with Random Effects for Genotype. Crop Science, v. 55, p. 465-476, 2015. doi: https://doi.org/10.2135/cropsci2014.05.0369

SILVA, C. P.; OLIVEIRA, L. A.; NUVUNGA, J. J.; PAMPLONA, A. K. A.; BALESTRE, M. A Bayesian Shrinkage Approach for AMMI Models. Plos One, v. 10, p. e0131414, 2015. doi: https://doi.org/10.1371/journal.pone.0131414.

See Also

xYplot

Examples

library(ammiBayes)
data(ammiData)


Env  <- factor(ammiData$amb)
Rep <- factor(ammiData$rep)
Gen  <- factor(ammiData$gen)
Y  <- ammiData$prod

model <- ammiBayes(Y=Y, Gen=Gen, Env=Env, Rep=Rep, iter=10, burn=1, jump=2, chains=2)

genot.effects <- gen.effects(model)


ammiBayes.gen.plot(genot.effects)

Plot ammiBayes object

Description

Plot the means for the ammiBayes object

Usage

ammiBayes.mean.plot(model, pars.gen=NULL, pars.env=NULL,
              gen.labels=NULL, env.labels=NULL, 
              col.text.gen="darkgreen", col.text.env="red",
              ylim=NULL, xlim=NULL, cex.env=1, cex.gen=1,
              xlab,	ylab, col.grid="grey", lty.grid=2, lwd.grid=1)

Arguments

model

An object of the ammiBayes class

pars.gen

An optional character vector of genotype names. If pars is omitted all genotypes are included.

pars.env

An optional character vector of environment names. If pars is omitted all environments are included.

gen.labels

Optional vector for the name of the genotypes

env.labels

Optional vector for the name of the environments

col.text.gen

Define the color of genotype names

col.text.env

Define the color of environment names

ylim

Define the limites applied to the y-axis

xlim

Define the limites applied to the x-axis

cex.env

Scale for the font size of the environment names. Default is 1

cex.gen

Scale for the font size of the genotype names. Default is 1

xlab

Label for the x-axis

ylab

Label for the y-axis

col.grid

Define the color for the grid. Default is "grey"

lty.grid

Line type of grid

lwd.grid

Line width of grid

Author(s)

Luciano A. Oliveira
Carlos P. Silva
Cristian T. E. Mendes
Alessandra Q. Silva
Joel J. Nuvunga
Marcio Balestre
Julio S. S. Bueno-Filho
Fabio M. Correa

References

OLIVEIRA,L.A.; SILVA, C. P.; NUVUNGA, J. J.; SILVA, A. Q.; BALESTRE, M. Credible Intervals for Scores in the AMMI with Random Effects for Genotype. Crop Science, v. 55, p. 465-476, 2015. doi: https://doi.org/10.2135/cropsci2014.05.0369

SILVA, C. P.; OLIVEIRA, L. A.; NUVUNGA, J. J.; PAMPLONA, A. K. A.; BALESTRE, M. A Bayesian Shrinkage Approach for AMMI Models. Plos One, v. 10, p. e0131414, 2015. doi: https://doi.org/10.1371/journal.pone.0131414.

See Also

lattice

Examples

library(ammiBayes)
data(ammiData)


Env  <- factor(ammiData$amb)
Rep <- factor(ammiData$rep)
Gen  <- factor(ammiData$gen)
Y  <- ammiData$prod

model <- ammiBayes(Y=Y, Gen=Gen, Env=Env, Rep=Rep, iter=10, burn=1, jump=2, chains=2)

ammiBayes.mean.plot(model)

Dataset for example

Description

Simulated dataset in completely randomized design to illustrate the resources of the ammiBayes package.

Usage

data(ammiData)

Details

amb = Environment (4 environments)

rep = Repetition (9 repetitions)

gen = Genotype (6 genotypes)

prod = Variabel response


Bayesian AMMI for ordinal data

Description

Extract the MCMC chain for diagnosis

Usage

diagnosis.ammiBayes(x, pars=NULL)

Arguments

x

An object of class ammiBayes

pars

It should be set, such as "Genotype", "Rep", "L", "Gen.PC1", "Gen.PC2", "Env.PC1", "Env.PC2", "Comp.var". See details

Details

The output is compatible for diagnosis with the coda and bayesplot packages. Examples can be seen on the website: bayesplot

Author(s)

Luciano A. Oliveira
Carlos P. Silva
Cristian T. E. Mendes
Alessandra Q. Silva
Joel J. Nuvunga
Marcio Balestre
Julio S. S. Bueno-Filho
Fabio M. Correa

References

OLIVEIRA,L.A.; SILVA, C. P.; NUVUNGA, J. J.; SILVA, A. Q.; BALESTRE, M. Credible Intervals for Scores in the AMMI with Random Effects for Genotype. Crop Science, v. 55, p. 465-476, 2015. doi: https://doi.org/10.2135/cropsci2014.05.0369

SILVA, C. P.; OLIVEIRA, L. A.; NUVUNGA, J. J.; PAMPLONA, A. K. A.; BALESTRE, M. A Bayesian Shrinkage Approach for AMMI Models. Plos One, v. 10, p. e0131414, 2015. doi: https://doi.org/10.1371/journal.pone.0131414.

Examples

# Not run
library(ammiBayes)
library(bayesplot)
library(ggpubr)

data(ammiData)

Env  <- factor(ammiData$amb)
Rep <- factor(ammiData$rep)
Gen  <- factor(ammiData$gen)
Y  <- ammiData$prod

model <- ammiBayes(Y=Y, Gen=Gen, Env=Env, Rep=Rep, iter=1000, burn=10, jump=2, chains=2)

gen.diagnosis <- diagnosis.ammiBayes(model, pars="Genotype")


mcmc_trace(gen.diagnosis)
mcmc_dens_overlay(gen.diagnosis)
mcmc_areas(gen.diagnosis)

dens <- bayesplot::mcmc_dens_overlay(gen.diagnosis)
trac <- bayesplot::mcmc_trace(gen.diagnosis, facet_args=list(ncol=1))

ggpubr::ggarrange(trac,dens, common.legend=TRUE)

Bayesian AMMI for continous data

Description

Extract the effects of genotypes and HPD interval

Usage

gen.effects(x, prob=0.95)

Arguments

x

An object of class ammiBayes

prob

Probability for HPD interval. Default is 0.95

Author(s)

Luciano A. Oliveira
Carlos P. Silva
Cristian T. E. Mendes
Alessandra Q. Silva
Joel J. Nuvunga
Marcio Balestre
Julio S. S. Bueno-Filho
Fabio M. Correa

References

OLIVEIRA,L.A.; SILVA, C. P.; NUVUNGA, J. J.; SILVA, A. Q.; BALESTRE, M. Credible Intervals for Scores in the AMMI with Random Effects for Genotype. Crop Science, v. 55, p. 465-476, 2015. doi: https://doi.org/10.2135/cropsci2014.05.0369

SILVA, C. P.; OLIVEIRA, L. A.; NUVUNGA, J. J.; PAMPLONA, A. K. A.; BALESTRE, M. A Bayesian Shrinkage Approach for AMMI Models. Plos One, v. 10, p. e0131414, 2015. doi: https://doi.org/10.1371/journal.pone.0131414.

Examples

library(ammiBayes)
data(ammiData)

Env  <- factor(ammiData$amb)
Rep <- factor(ammiData$rep)
Gen  <- factor(ammiData$gen)
Y  <- ammiData$prod

model <- ammiBayes(Y=Y, Gen=Gen, Env=Env, Rep=Rep, iter=10, burn=1, jump=2, chains=2)

gen.effects(model)

Bayesian AMMI for continuous data

Description

Extract predict values and HPD interval

Usage

## S3 method for class 'ammiBayes'
predict(object, prob=0.95, ...)

Arguments

object

An object of class ammiBayes

prob

Probability for HPD interval. Default is 0.95

...

Potential further arguments (required by generic).

Author(s)

Luciano A. Oliveira
Carlos P. Silva
Cristian T. E. Mendes
Alessandra Q. Silva
Joel J. Nuvunga
Marcio Balestre
Julio S. S. Bueno-Filho
Fabio M. Correa

References

OLIVEIRA,L.A.; SILVA, C. P.; NUVUNGA, J. J.; SILVA, A. Q.; BALESTRE, M. Credible Intervals for Scores in the AMMI with Random Effects for Genotype. Crop Science, v. 55, p. 465-476, 2015. doi: https://doi.org/10.2135/cropsci2014.05.0369

SILVA, C. P.; OLIVEIRA, L. A.; NUVUNGA, J. J.; PAMPLONA, A. K. A.; BALESTRE, M. A Bayesian Shrinkage Approach for AMMI Models. Plos One, v. 10, p. e0131414, 2015. doi: https://doi.org/10.1371/journal.pone.0131414.

Examples

library(ammiBayes)
data(ammiData)

Env  <- factor(ammiData$amb)
Rep <- factor(ammiData$rep)
Gen  <- factor(ammiData$gen)
Y  <- ammiData$prod

model <- ammiBayes(Y=Y, Gen=Gen, Env=Env, Rep=Rep, iter=10, burn=1, jump=2, chains=2)

predict(model)

Summary Method for ammiBayes object

Description

Returns (and prints) a summary list for ammiBayes object.

Usage

## S3 method for class 'ammiBayes'
summary(object, ...)

Arguments

object

A given object of the class ammiBayes.

...

Potential further arguments (required by generic).

Author(s)

Luciano A. Oliveira
Carlos P. Silva
Cristian T. E. Mendes
Alessandra Q. Silva
Joel J. Nuvunga
Marcio Balestre
Julio S. S. Bueno-Filho
Fabio M. Correa

References

OLIVEIRA,L.A.; SILVA, C. P.; NUVUNGA, J. J.; SILVA, A. Q.; BALESTRE, M. Credible Intervals for Scores in the AMMI with Random Effects for Genotype. Crop Science, v. 55, p. 465-476, 2015. doi: https://doi.org/10.2135/cropsci2014.05.0369

SILVA, C. P.; OLIVEIRA, L. A.; NUVUNGA, J. J.; PAMPLONA, A. K. A.; BALESTRE, M. A Bayesian Shrinkage Approach for AMMI Models. Plos One, v. 10, p. e0131414, 2015. doi: https://doi.org/10.1371/journal.pone.0131414.

See Also

ammiBayes