Learn R Programming

aridagri (version 2.0.3)

anova_rbd: Randomized Block Design (RBD) ANOVA

Description

Performs complete ANOVA for Randomized Block Design (RCBD) with post-hoc tests, assumptions checking, and publication-ready output.

Usage

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

Value

List containing ANOVA table, means, post-hoc results

Arguments

data

Data frame containing the experimental data

response

Name of the response variable

treatment

Name of treatment factor

block

Name of block/replication factor

posthoc

Post-hoc test: "lsd", "duncan", "tukey", "snk", "scheffe", or "all"

alpha

Significance level (default 0.05)

verbose

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

Author

Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner

Examples

Run this code
data <- data.frame(
  rep = rep(1:4, each = 5),
  treatment = rep(c("T1", "T2", "T3", "T4", "T5"), 4),
  yield = c(rnorm(5, 1200, 50), rnorm(5, 1250, 55),
            rnorm(5, 1180, 45), rnorm(5, 1270, 60))
)
anova_rbd(data, response = "yield", treatment = "treatment", 
          block = "rep", posthoc = "duncan")

Run the code above in your browser using DataLab