Learn R Programming

aridagri (version 2.0.3)

anova_spd_ab_cd: Split Plot Design with (AB) Main and (CD) Sub

Description

Performs ANOVA for Split Plot Design where main plot contains factorial combination of AB and sub-plot contains factorial combination of CD. Complex design for multi-factor experiments.

Usage

anova_spd_ab_cd(
  data,
  response,
  main_factor1,
  main_factor2,
  sub_factor1,
  sub_factor2,
  replication,
  verbose = TRUE
)

Value

List containing ANOVA table and means

Arguments

data

Data frame containing the experimental data

response

Name of the response variable

main_factor1

First factor in main plot (A)

main_factor2

Second factor in main plot (B)

sub_factor1

First factor in sub-plot (C)

sub_factor2

Second factor in sub-plot (D)

replication

Name of replication factor

verbose

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

Author

Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner

Examples

Run this code
# Example: Irrigation  Tillage (main), Variety  Nitrogen (sub)
data <- expand.grid(
  rep = 1:3,
  irrigation = c("I1", "I2"),
  tillage = c("CT", "ZT"),
  variety = c("V1", "V2"),
  nitrogen = c("N1", "N2", "N3")
)
data$yield <- rnorm(nrow(data), 1200, 150)

anova_spd_ab_cd(data, response = "yield",
                main_factor1 = "irrigation", main_factor2 = "tillage",
                sub_factor1 = "variety", sub_factor2 = "nitrogen",
                replication = "rep")

Run the code above in your browser using DataLab