Learn R Programming

aridagri (version 2.0.3)

anova_rbd_pooled: Pooled Analysis of RBD Experiments (Multi-Environment/Year)

Description

Performs pooled ANOVA for RBD experiments conducted across multiple environments, years, or locations. Tests homogeneity of error variances using Bartlett's test before pooling.

Usage

anova_rbd_pooled(
  data,
  response,
  treatment,
  environment,
  block,
  posthoc = "lsd",
  alpha = 0.05,
  verbose = TRUE
)

Value

List containing pooled ANOVA, individual ANOVAs, and interaction analysis

Arguments

data

Data frame containing combined data from all environments

response

Name of the response variable

treatment

Name of treatment factor

environment

Name of environment/year/location factor

block

Name of block factor (nested within environment)

posthoc

Post-hoc test method

alpha

Significance level

verbose

Logical. If TRUE (default), prints formatted output to console.

Author

Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner

Examples

Run this code
# Data from 3 years
data <- data.frame(
  year = rep(c("Y1", "Y2", "Y3"), each = 20),
  rep = rep(rep(1:4, each = 5), 3),
  treatment = rep(c("T1", "T2", "T3", "T4", "T5"), 12),
  yield = rnorm(60, 1200, 150)
)
anova_rbd_pooled(data, response = "yield", treatment = "treatment",
                 environment = "year", block = "rep")

Run the code above in your browser using DataLab