| Title: | Analysis of Experimental Data using ANOVA and Mean Comparison |
|---|---|
| Description: | Provides tools for designing and analyzing agricultural experiments. It includes functions for generating randomized treatment layouts for standard experimental designs such as Completely Randomized Design (CRD), Randomized Block Design (RBD), Latin Square Design (LSD), Factorial Randomized Block Design (FRBD), split-plot design, and strip-plot design. The package implements one-factor and two-factor analysis of variance (ANOVA) and offers multiple comparison procedures, including Least Significant Difference (lsd), Tukey, and Duncan tests, to compare treatment means in single-factor and factorial experiments. The methods follow classical experimental design principles described in Gomez and Gomez (1984, Statistical Procedures for Agricultural Research, John Wiley & Sons, New York). |
| Authors: | Santosh Patil [aut, cre] (ORCID: <https://orcid.org/0000-0002-5370-3522>), Yogesh Garde [aut] (ORCID: <https://orcid.org/0000-0002-0297-316X>) |
| Maintainer: | Santosh Patil <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.1.1 |
| Built: | 2026-05-08 11:15:17 UTC |
| Source: | https://github.com/cran/PGaovR |
Performs analysis of variance for one-factor experiments under Completely Randomized Design (CRD), Randomized Block Design (RBD), and Latin Square Design (LSD). Supports multiple response variables, data transformation, and mean comparison tests.
aov_of( data, design = c("CRD", "RBD", "LSD"), treatment, replication = NULL, row = NULL, column = NULL, responsevar = "all", test = c("lsd", "tukey", "duncan"), transform = NULL, narc = 1, alpha = 0.05 )aov_of( data, design = c("CRD", "RBD", "LSD"), treatment, replication = NULL, row = NULL, column = NULL, responsevar = "all", test = c("lsd", "tukey", "duncan"), transform = NULL, narc = 1, alpha = 0.05 )
data |
A data frame containing experimental data. |
design |
Type of design. One of "CRD", "RBD", or "LSD". |
treatment |
Name of treatment column in the dataset. |
replication |
Name of replication/block column (required for RBD). |
row |
Name of row factor (required for LSD). |
column |
Name of column factor (required for LSD). |
responsevar |
Specific variables c("v1" ,"v2", "v3") or "all". |
test |
Mean comparison test. Options include "lsd", "tukey", or "duncan". |
transform |
List specifying transformations for variables. Options include "log", "sqrt", and "arcsine". |
narc |
Numeric or list specifying denominator for arcsine transformation. |
alpha |
Significance level (e.g., 0.05). |
This function supports:
Analysis for CRD, RBD, and LSD designs
Multiple response variables
Data transformations (log, square root, arcsine)
Mean separation tests (LSD, Tukey, Duncan)
Combined summary table output
A list containing:
Analysis results for each response variable separately.
Arithmetic mean, standard deviation, minimum, and maximum values for each variable.
Results of the Shapiro-Wilk test for normality.
ANOVA table along with mean comparison based on the selected test for each response variable.
A summary table including mean ± SD, grouping letters, SEm, SEd, CD, and CV values for all variables.
# Example data(Gnutdataset) head(Gnutdataset) Out_rbd <- aov_of( Gnutdataset, design = "RBD", treatment = "Trt", replication = "Rep", responsevar = "all", transform = list(Noflwr="sqrt", Germ="arcsine", Disease="arcsine"), narc = list(Germ=10, Disease=5), alpha = 0.05 ) # Single variable result Out_rbd$Germ # Combined table for all varaibles Out_rbd$Combined_table # Entire output Out_rbd #Example without transformation Out_rbd2 <- aov_of( Soildataset, design = "RBD", treatment = "TRT", replication = "REP", responsevar = "all", test = "lsd", alpha = 0.05 ) Out_rbd2$Combined_table# Example data(Gnutdataset) head(Gnutdataset) Out_rbd <- aov_of( Gnutdataset, design = "RBD", treatment = "Trt", replication = "Rep", responsevar = "all", transform = list(Noflwr="sqrt", Germ="arcsine", Disease="arcsine"), narc = list(Germ=10, Disease=5), alpha = 0.05 ) # Single variable result Out_rbd$Germ # Combined table for all varaibles Out_rbd$Combined_table # Entire output Out_rbd #Example without transformation Out_rbd2 <- aov_of( Soildataset, design = "RBD", treatment = "TRT", replication = "REP", responsevar = "all", test = "lsd", alpha = 0.05 ) Out_rbd2$Combined_table
Performs analysis of variance for two-factor experiments Factorial CRD (FCRD), Factorial RBD (FRBD), Split-Plot, and Strip-Plot designs.
aov_tf( data, design = c("FCRD", "FRBD", "SPLIT", "STRIP"), factor_A, factor_B, replication = NULL, responsevar = "all", test = c("lsd", "tukey", "duncan"), transform = NULL, narc = 1, alpha = 0.05 )aov_tf( data, design = c("FCRD", "FRBD", "SPLIT", "STRIP"), factor_A, factor_B, replication = NULL, responsevar = "all", test = c("lsd", "tukey", "duncan"), transform = NULL, narc = 1, alpha = 0.05 )
data |
A data frame containing experimental data. |
design |
Type of design "FCRD", "FRBD", "SPLIT" or "STRIP". |
factor_A |
Name of Factor A column in the dataset. |
factor_B |
Name of Factor B column in the dataset. |
replication |
Name of replication/block column (required for FRBD, SPLIT, STRIP). |
responsevar |
Specific variables c("v1" ,"v2", "v3") or "all". |
test |
Mean comparison test. Options include"lsd", "tukey", or "duncan". |
transform |
List or character specifying transformations ("log", "sqrt", "arcsine"). |
narc |
Numeric or list specifying denominator for arcsine transformation. |
alpha |
Significance level (default 0.05). |
A list containing:
Analysis results for each response variable separately.
Arithmetic mean, standard deviation, minimum, and maximum values for each variable.
Results of the Shapiro-Wilk test for normality.
ANOVA table along with mean comparison based on the selected test for each response variable.
A summary table -two way including mean ± SD, grouping letters, SEm, SEd, CD, and CV values for all variables.
#'
#Rice dataset with Factor A as TRT and Factor B as SPACE and replications in "BLOCK" column data("Gnutdataset") "head(Ricedataset)" #Example: Factorial CRD out <- aov_tf( Ricedataset, design = "FCRD", factor_A = "TRT", factor_B = "SPACE", replication = "BLOCK", responsevar = "all", test = "lsd", transform = NULL, narc = 1, alpha = 0.05 ) #Example: Split-plot with transformation out2 <- aov_tf( Ricedataset, design = "SPLIT", factor_A = "TRT", factor_B = "SPACE", replication = "BLOCK", responsevar = "all", test = "lsd", transform = list(GPP = "log", Disease = "arcsine"), narc = list(Disease = 5), alpha = 0.05 ) out2$PH out2$GPP#Rice dataset with Factor A as TRT and Factor B as SPACE and replications in "BLOCK" column data("Gnutdataset") "head(Ricedataset)" #Example: Factorial CRD out <- aov_tf( Ricedataset, design = "FCRD", factor_A = "TRT", factor_B = "SPACE", replication = "BLOCK", responsevar = "all", test = "lsd", transform = NULL, narc = 1, alpha = 0.05 ) #Example: Split-plot with transformation out2 <- aov_tf( Ricedataset, design = "SPLIT", factor_A = "TRT", factor_B = "SPACE", replication = "BLOCK", responsevar = "all", test = "lsd", transform = list(GPP = "log", Disease = "arcsine"), narc = list(Disease = 5), alpha = 0.05 ) out2$PH out2$GPP
Generates randomized field layouts for agricultural experimental designs including Completely Randomized Design (CRD), Randomized Block Design (RBD), and Latin Square Design (LSD), factorial designs, split-plot, and strip-plot.
fld_layout( design = "RBD", treatments = paste0("T", 1:5), A = c("A1", "A2"), B = c("B1", "B2", "B3"), blocks = 3, replications = 3, plot_length = 2, plot_width = 1, alley = 0.3, block_gap = 0.6, border = NULL, treatment_label_size = NULL, block_label_size = NULL, show_field_dimensions = TRUE, show_plot_dimensions = TRUE, seed = NULL )fld_layout( design = "RBD", treatments = paste0("T", 1:5), A = c("A1", "A2"), B = c("B1", "B2", "B3"), blocks = 3, replications = 3, plot_length = 2, plot_width = 1, alley = 0.3, block_gap = 0.6, border = NULL, treatment_label_size = NULL, block_label_size = NULL, show_field_dimensions = TRUE, show_plot_dimensions = TRUE, seed = NULL )
design |
Type of design. Options include" "CRD", "RBD", "LSD", "FCRD","FRBD", "SPLIT", or "STRIP". |
treatments |
Vector of treatment labels (used in CRD, RBD, LSD). |
A |
Vector of Factor A levels (for factorial, split, strip designs). |
B |
Vector of Factor B levels (for factorial, split, strip designs). |
blocks |
Number of blocks (required for RBD, SPLIT, STRIP). |
replications |
Number of replications. Can be a single number (equal replication) or a vector (unequal replication, e.g., c(2,3,4,2)). |
plot_length |
Length of each plot |
plot_width |
Width of each plot |
alley |
Spacing between adjacent plots. |
block_gap |
Gap between blocks. |
border |
Border area around the field layout. |
treatment_label_size |
Size of treatment labels in the layout |
block_label_size |
Size of block labels |
show_field_dimensions |
Logical; display field dimensions |
show_plot_dimensions |
Logical; display plot dimensions |
seed |
Random seed for reproducibility. Optional random seed to ensure reproducibility of randomization; same seed gives the same layout/results across runs. |
This function supports:
Completely Randomized Design (CRD)
Randomized Block Design (RBD)
Latin Square Design (LSD)
Factorial CRD and RBD (FCRD, FRBD)
Split-plot and strip-plot designs
Unequal and equal replication structures in CRD
Custom plot dimensions and spacing
A list containing:
A ggplot object showing field layout
Data frame containing plot arrangement
layout_crd <- fld_layout( design = "CRD", treatments = paste0("T", 1:7), replications = c(2,3,4,2,1,5,4), plot_length = 2.5, plot_width = 1.8, alley = 0.3, border = 1.5, seed = 123 ) layout_crd$plot # RBD example layout_rbd <- fld_layout( design = "RBD", treatments = paste0("T",1:7), blocks = 4, seed = 123 ) layout_rbd$plot layout_rbd <- fld_layout( design = "RBD", treatments = paste0("T",1:7), blocks = 4, treatment_label_size = 4, block_label_size = 3, show_field_dimensions = FALSE, show_plot_dimensions = FALSE, seed = 123 ) layout_rbd$plot # Latin Square Design layout_lsd <- fld_layout( design = "LSD", treatments = paste0("T", 1:6), seed = 123 ) layout_lsd$plot # Factorial CRD result <- fld_layout( design = "FCRD", A = c("A1", "A2", "A3"), B = c("B1", "B2", "B3", "B4"), replications = 3, seed = 101 ) result$plot # Split plot result2 <- fld_layout( design = "SPLIT", A = c("A1", "A2", "A3"), B = c("B1", "B2", "B3", "B4"), blocks = 3, seed = 101 ) result2$plotlayout_crd <- fld_layout( design = "CRD", treatments = paste0("T", 1:7), replications = c(2,3,4,2,1,5,4), plot_length = 2.5, plot_width = 1.8, alley = 0.3, border = 1.5, seed = 123 ) layout_crd$plot # RBD example layout_rbd <- fld_layout( design = "RBD", treatments = paste0("T",1:7), blocks = 4, seed = 123 ) layout_rbd$plot layout_rbd <- fld_layout( design = "RBD", treatments = paste0("T",1:7), blocks = 4, treatment_label_size = 4, block_label_size = 3, show_field_dimensions = FALSE, show_plot_dimensions = FALSE, seed = 123 ) layout_rbd$plot # Latin Square Design layout_lsd <- fld_layout( design = "LSD", treatments = paste0("T", 1:6), seed = 123 ) layout_lsd$plot # Factorial CRD result <- fld_layout( design = "FCRD", A = c("A1", "A2", "A3"), B = c("B1", "B2", "B3", "B4"), replications = 3, seed = 101 ) result$plot # Split plot result2 <- fld_layout( design = "SPLIT", A = c("A1", "A2", "A3"), B = c("B1", "B2", "B3", "B4"), blocks = 3, seed = 101 ) result2$plot
Hypothetical dataset for single-factor groundnut experiment.
GnutdatasetGnutdataset
A data frame with 24 observations and 10 variables:
Treatment levels
Replication
Germination percentage
Plant height (cm)
Number of flowers per plant
Plant spread (cm)
Leaf length (cm)
Number of pods per plant
Pod weight per plant (g)
Disease incidence
Used for demonstration of one-factor ANOVA.
Simulated data
Hypothetical dataset for two-factor experiment (treatment and spacing).
RicedatasetRicedataset
A data frame with 96 observations and 11 variables:
Treatment
Spacing
Block
Days to flowering
Plant height
Tillers per plant
Panicle length
Grains per panicle
Hundred seed weight
Grain yield
Disease incidence
Used for two-factor ANOVA demonstration.
Simulated data
Hypothetical dataset for single-factor soil experiment.
SoildatasetSoildataset
A data frame with 33 observations and 15 variables:
Treatment
Replication
Bulk density
Particle density
Porosity
Hydraulic conductivity
Soil pH
Cation exchange capacity
Nitrogen
Phosphorus
Potassium
Sulfur
Organic carbon
Microbial biomass nitrogen
Microbial biomass carbon
Used for soil analysis demonstration.
Simulated data