| Title: | Comprehensive Statistical Tools for Agricultural Research |
|---|---|
| Description: | A comprehensive suite of statistical and analytical tools for agricultural research. Includes complete analysis of variance (ANOVA) functions for all experimental designs: Completely Randomized Design (CRD), Randomized Block Design (RBD), Pooled RBD, Split Plot with all variations, Split-Split Plot, Strip Plot, Latin Square, Factorial, Augmented, and Alpha Lattice, with proper error terms and comprehensive Standard Error (SE) and Critical Difference (CD) calculations. Features multiple post-hoc tests: Least Significant Difference (LSD), Duncan Multiple Range Test (DMRT), Tukey Honestly Significant Difference (HSD), Student-Newman-Keuls (SNK), Scheffe, Bonferroni, and Dunnett, along with assumption checking and publication-ready output. Advanced methods include stability analysis using Eberhart-Russell regression, Additive Main Effects and Multiplicative Interaction (AMMI), Finlay-Wilkinson regression, Shukla stability variance, Wricke ecovalence, Coefficient of Variation (CV), and Cultivar Superiority Index as described in Eberhart and Russell (1966) <doi:10.2135/cropsci1966.0011183X000600010011x>. Thermal indices include Growing Degree Days (GDD), Heliothermal Units (HTU), Photothermal Units (PTU), and Heat Use Efficiency (HUE). Crop growth analysis covers Crop Growth Rate (CGR), Relative Growth Rate (RGR), Net Assimilation Rate (NAR), and Leaf Area Index (LAI). Also provides harvest index, yield gap analysis, economic efficiency indices (Benefit-Cost ratio), nutrient use efficiency calculations, correlation matrix, Principal Component Analysis (PCA), path analysis, and Structural Equation Modeling (SEM). Statistical methods follow Gomez and Gomez (1984, ISBN:0471870927) and Panse and Sukhatme (1985, ISBN:8170271169). |
| Authors: | Lalit Kumar Rolaniya [aut, cre] (ORCID: <https://orcid.org/0000-0001-8908-1211>), Ram Lal Jat [aut] (ORCID: <https://orcid.org/0009-0003-4339-0555>), Monika Punia [aut] (ORCID: <https://orcid.org/0009-0002-0294-6767>), Raja Ram Choudhary [aut] |
| Maintainer: | Lalit Kumar Rolaniya <[email protected]> |
| License: | GPL-3 |
| Version: | 2.0.3 |
| Built: | 2026-06-08 20:13:58 UTC |
| Source: | https://github.com/lalitrolaniya/aridagri |
The aridagri package provides comprehensive statistical and analytical tools for agricultural research. It includes complete ANOVA functions for all experimental designs, multiple post-hoc tests, stability analysis methods, thermal indices, crop growth analysis, and advanced statistical methods.
anova_crd: Completely Randomized Design
anova_rbd: Randomized Block Design
anova_rbd_pooled: Pooled RBD (Multi-Environment)
anova_latin: Latin Square Design
anova_factorial: Two-Factor Factorial
anova_factorial_3way: Three-Factor Factorial
anova_spd: Split Plot Design
anova_sspd: Split-Split Plot Design
anova_strip: Strip Plot Design
anova_augmented: Augmented Block Design
anova_alpha_lattice: Alpha Lattice Design
perform_posthoc: Multiple comparison tests (LSD, Duncan, Tukey, SNK, Scheffe, Bonferroni, Dunnett)
check_assumptions: ANOVA assumption checking
stability_analysis: Multi-method stability analysis (Eberhart-Russell, AMMI, Finlay-Wilkinson, Shukla, Wricke, CV, Superiority)
thermal_indices: GDD, HTU, PTU, Heat Use Efficiency
crop_growth_analysis: CGR, RGR, NAR, LAI
harvest_index: Harvest index and partitioning
yield_gap_analysis: Yield gap calculations
economic_indices: B:C ratio, net returns
correlation_analysis: Correlation matrix with significance
pca_analysis: Principal component analysis
path_analysis: Path coefficient analysis
sem_analysis: Structural equation modeling
nue_calculate: Nutrient use efficiency calculations
nutrient_response: Response curve analysis
economic_analysis: Economic viability assessment
Lalit Kumar Rolaniya, Ram Lal Jat, Monika Punia, Raja Ram Choudhary
Useful links:
Report bugs at https://github.com/lalitrolaniya/aridagri/issues
Performs ANOVA for Alpha Lattice (Resolvable Incomplete Block) Design.
anova_alpha_lattice( data, response, genotype, replication, block, verbose = TRUE )anova_alpha_lattice( data, response, genotype, replication, block, verbose = TRUE )
data |
Data frame containing the data |
response |
Name of response variable |
genotype |
Name of genotype column |
replication |
Name of replication column |
block |
Name of incomplete block column (nested within replication) |
verbose |
Logical. If TRUE (default), prints formatted output to console. |
List containing ANOVA results
Lalit Kumar Rolaniya, Ram Lal Jat, Monika Punia, Raja Ram Choudhary
data <- expand.grid(rep = 1:2, block = 1:5, entry = 1:4) data$genotype <- paste0("G", 1:nrow(data)) data$yield <- rnorm(nrow(data), 1200, 150)data <- expand.grid(rep = 1:2, block = 1:5, entry = 1:4) data$genotype <- paste0("G", 1:nrow(data)) data$yield <- rnorm(nrow(data), 1200, 150)
Performs ANOVA for Augmented Randomized Block Design where checks are replicated and test entries appear once.
anova_augmented(data, response, genotype, block, check_names, verbose = TRUE)anova_augmented(data, response, genotype, block, check_names, verbose = TRUE)
data |
Data frame containing the data |
response |
Name of response variable |
genotype |
Name of genotype/entry column |
block |
Name of block column |
check_names |
Vector of check variety names |
verbose |
Logical. If TRUE (default), prints formatted output to console. |
List containing ANOVA results and adjusted means
Lalit Kumar Rolaniya, Ram Lal Jat, Monika Punia, Raja Ram Choudhary
data <- data.frame( block = rep(1:5, each = 7), genotype = c(rep(c("C1","C2","C3"), 5), paste0("T", 1:20)), yield = rnorm(35, 1200, 150) ) # Note: This is simplified exampledata <- data.frame( block = rep(1:5, each = 7), genotype = c(rep(c("C1","C2","C3"), 5), paste0("T", 1:20)), yield = rnorm(35, 1200, 150) ) # Note: This is simplified example
Performs complete ANOVA for Completely Randomized Design with post-hoc tests, assumptions checking, and publication-ready output.
anova_crd( data, response, treatment, posthoc = "lsd", alpha = 0.05, verbose = TRUE )anova_crd( data, response, treatment, posthoc = "lsd", alpha = 0.05, verbose = TRUE )
data |
Data frame containing the experimental data |
response |
Name of the response variable (as string) |
treatment |
Name of treatment 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. |
List containing ANOVA table, means, post-hoc results, and diagnostics
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
data <- data.frame( treatment = rep(c("T1", "T2", "T3", "T4"), each = 5), yield = c(rnorm(5, 1200, 50), rnorm(5, 1350, 60), rnorm(5, 1100, 55), rnorm(5, 1450, 65)) ) anova_crd(data, response = "yield", treatment = "treatment", posthoc = "all")data <- data.frame( treatment = rep(c("T1", "T2", "T3", "T4"), each = 5), yield = c(rnorm(5, 1200, 50), rnorm(5, 1350, 60), rnorm(5, 1100, 55), rnorm(5, 1450, 65)) ) anova_crd(data, response = "yield", treatment = "treatment", posthoc = "all")
Performs two-factor factorial ANOVA with interaction analysis.
anova_factorial( data, response, factor1, factor2, replication = NULL, posthoc = "lsd", alpha = 0.05, verbose = TRUE )anova_factorial( data, response, factor1, factor2, replication = NULL, posthoc = "lsd", alpha = 0.05, verbose = TRUE )
data |
Data frame containing the data |
response |
Name of the response variable |
factor1 |
Name of first factor (A) |
factor2 |
Name of second factor (B) |
replication |
Name of replication factor (optional) |
posthoc |
Post-hoc test method |
alpha |
Significance level |
verbose |
Logical. If TRUE (default), prints formatted output to console. |
List containing ANOVA results
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
data <- expand.grid( rep = 1:4, nitrogen = c("N0", "N40", "N80", "N120"), phosphorus = c("P0", "P30", "P60") ) data$yield <- rnorm(nrow(data), 1200, 150) anova_factorial(data, response = "yield", factor1 = "nitrogen", factor2 = "phosphorus", replication = "rep")data <- expand.grid( rep = 1:4, nitrogen = c("N0", "N40", "N80", "N120"), phosphorus = c("P0", "P30", "P60") ) data$yield <- rnorm(nrow(data), 1200, 150) anova_factorial(data, response = "yield", factor1 = "nitrogen", factor2 = "phosphorus", replication = "rep")
Performs three-factor factorial ANOVA with all interactions.
anova_factorial_3way( data, response, factor1, factor2, factor3, replication = NULL, alpha = 0.05, verbose = TRUE )anova_factorial_3way( data, response, factor1, factor2, factor3, replication = NULL, alpha = 0.05, verbose = TRUE )
data |
Data frame containing the data |
response |
Name of the response variable |
factor1 |
Name of first factor (A) |
factor2 |
Name of second factor (B) |
factor3 |
Name of third factor (C) |
replication |
Name of replication factor (optional) |
alpha |
Significance level |
verbose |
Logical. If TRUE (default), prints formatted output to console. |
List containing ANOVA results
Lalit Kumar Rolaniya, Ram Lal Jat, Monika Punia, Raja Ram Choudhary
data <- expand.grid(rep = 1:3, A = c("A1", "A2"), B = c("B1", "B2"), C = c("C1", "C2")) data$yield <- rnorm(nrow(data), 1200, 150) anova_factorial_3way(data, "yield", "A", "B", "C", "rep")data <- expand.grid(rep = 1:3, A = c("A1", "A2"), B = c("B1", "B2"), C = c("C1", "C2")) data$yield <- rnorm(nrow(data), 1200, 150) anova_factorial_3way(data, "yield", "A", "B", "C", "rep")
Performs ANOVA for Latin Square Design with row and column blocking.
anova_latin( data, response, treatment, row, column, posthoc = "lsd", alpha = 0.05, verbose = TRUE )anova_latin( data, response, treatment, row, column, posthoc = "lsd", alpha = 0.05, verbose = TRUE )
data |
Data frame containing the data |
response |
Name of the response variable |
treatment |
Name of treatment factor |
row |
Name of row factor |
column |
Name of column factor |
posthoc |
Post-hoc test method |
alpha |
Significance level |
verbose |
Logical. If TRUE (default), prints formatted output to console. |
List containing ANOVA results
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
# 5x5 Latin Square data <- data.frame( row = rep(1:5, each = 5), col = rep(1:5, 5), treatment = c("A","B","C","D","E", "B","C","D","E","A", "C","D","E","A","B", "D","E","A","B","C", "E","A","B","C","D"), yield = rnorm(25, 1200, 100) ) anova_latin(data, response = "yield", treatment = "treatment", row = "row", column = "col")# 5x5 Latin Square data <- data.frame( row = rep(1:5, each = 5), col = rep(1:5, 5), treatment = c("A","B","C","D","E", "B","C","D","E","A", "C","D","E","A","B", "D","E","A","B","C", "E","A","B","C","D"), yield = rnorm(25, 1200, 100) ) anova_latin(data, response = "yield", treatment = "treatment", row = "row", column = "col")
Performs complete ANOVA for Randomized Block Design (RCBD) with post-hoc tests, assumptions checking, and publication-ready output.
anova_rbd( data, response, treatment, block, posthoc = "lsd", alpha = 0.05, verbose = TRUE )anova_rbd( data, response, treatment, block, posthoc = "lsd", alpha = 0.05, verbose = TRUE )
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. |
List containing ANOVA table, means, post-hoc results
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
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")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")
Performs pooled ANOVA for RBD experiments conducted across multiple environments, years, or locations. Tests homogeneity of error variances using Bartlett's test before pooling.
anova_rbd_pooled( data, response, treatment, environment, block, posthoc = "lsd", alpha = 0.05, verbose = TRUE )anova_rbd_pooled( data, response, treatment, environment, block, posthoc = "lsd", alpha = 0.05, verbose = TRUE )
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. |
List containing pooled ANOVA, individual ANOVAs, and interaction analysis
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
# 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")# 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")
Performs complete ANOVA for Split Plot Design with proper error terms for main plot and sub-plot factors. Includes all standard post-hoc comparisons.
anova_spd( data, response, main_plot, sub_plot, replication, posthoc = "lsd", alpha = 0.05, verbose = TRUE )anova_spd( data, response, main_plot, sub_plot, replication, posthoc = "lsd", alpha = 0.05, verbose = TRUE )
data |
Data frame containing the experimental data |
response |
Name of the response variable |
main_plot |
Name of main plot factor |
sub_plot |
Name of sub-plot factor |
replication |
Name of replication/block factor |
posthoc |
Post-hoc test method |
alpha |
Significance level |
verbose |
Logical. If TRUE (default), prints formatted output to console. |
List containing ANOVA table, means, and post-hoc results
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
data <- data.frame( rep = rep(1:3, each = 12), irrigation = rep(rep(c("I1", "I2", "I3"), each = 4), 3), variety = rep(c("V1", "V2", "V3", "V4"), 9), yield = rnorm(36, 1200, 150) ) anova_spd(data, response = "yield", main_plot = "irrigation", sub_plot = "variety", replication = "rep")data <- data.frame( rep = rep(1:3, each = 12), irrigation = rep(rep(c("I1", "I2", "I3"), each = 4), 3), variety = rep(c("V1", "V2", "V3", "V4"), 9), yield = rnorm(36, 1200, 150) ) anova_spd(data, response = "yield", main_plot = "irrigation", sub_plot = "variety", replication = "rep")
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.
anova_spd_ab_cd( data, response, main_factor1, main_factor2, sub_factor1, sub_factor2, replication, verbose = TRUE )anova_spd_ab_cd( data, response, main_factor1, main_factor2, sub_factor1, sub_factor2, replication, verbose = TRUE )
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. |
List containing ANOVA table and means
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
# 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")# 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")
Performs ANOVA for Split Plot Design where main plot contains factorial combination of two factors (AB) and sub-plot contains factor C. Common in irrigation variety as main plot and nitrogen as sub-plot.
anova_spd_ab_main( data, response, main_factor1, main_factor2, sub_plot, replication, posthoc = "lsd", alpha = 0.05, verbose = TRUE )anova_spd_ab_main( data, response, main_factor1, main_factor2, sub_plot, replication, posthoc = "lsd", alpha = 0.05, verbose = TRUE )
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_plot |
Sub-plot factor (C) |
replication |
Name of replication factor |
posthoc |
Post-hoc test method |
alpha |
Significance level |
verbose |
Logical. If TRUE (default), prints formatted output to console. |
Design structure:
Main Plot: A B factorial
Sub-Plot: C
Error (a): For testing A, B, and AB
Error (b): For testing C and all interactions with C
List containing ANOVA table and means
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
data <- data.frame( rep = rep(1:3, each = 24), irrigation = rep(rep(c("I1", "I2"), each = 12), 3), variety = rep(rep(c("V1", "V2", "V3"), each = 4), 6), nitrogen = rep(c("N0", "N1", "N2", "N3"), 18), yield = rnorm(72, 1200, 150) ) anova_spd_ab_main(data, response = "yield", main_factor1 = "irrigation", main_factor2 = "variety", sub_plot = "nitrogen", replication = "rep")data <- data.frame( rep = rep(1:3, each = 24), irrigation = rep(rep(c("I1", "I2"), each = 12), 3), variety = rep(rep(c("V1", "V2", "V3"), each = 4), 6), nitrogen = rep(c("N0", "N1", "N2", "N3"), 18), yield = rnorm(72, 1200, 150) ) anova_spd_ab_main(data, response = "yield", main_factor1 = "irrigation", main_factor2 = "variety", sub_plot = "nitrogen", replication = "rep")
Performs ANOVA for Split Plot Design where main plot contains single factor C and sub-plot contains factorial combination of AB.
anova_spd_c_main_ab_sub( data, response, main_plot, sub_factor1, sub_factor2, replication, posthoc = "lsd", alpha = 0.05, verbose = TRUE )anova_spd_c_main_ab_sub( data, response, main_plot, sub_factor1, sub_factor2, replication, posthoc = "lsd", alpha = 0.05, verbose = TRUE )
data |
Data frame containing the experimental data |
response |
Name of the response variable |
main_plot |
Main plot factor (C) |
sub_factor1 |
First factor in sub-plot (A) |
sub_factor2 |
Second factor in sub-plot (B) |
replication |
Name of replication factor |
posthoc |
Post-hoc test method |
alpha |
Significance level |
verbose |
Logical. If TRUE (default), prints formatted output to console. |
List containing ANOVA table and means
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
data <- data.frame( rep = rep(1:3, each = 24), irrigation = rep(rep(c("I1", "I2", "I3"), each = 8), 3), variety = rep(rep(c("V1", "V2"), each = 4), 9), nitrogen = rep(c("N1", "N2", "N3", "N4"), 18), yield = rnorm(72, 1200, 150) ) anova_spd_c_main_ab_sub(data, response = "yield", main_plot = "irrigation", sub_factor1 = "variety", sub_factor2 = "nitrogen", replication = "rep")data <- data.frame( rep = rep(1:3, each = 24), irrigation = rep(rep(c("I1", "I2", "I3"), each = 8), 3), variety = rep(rep(c("V1", "V2"), each = 4), 9), nitrogen = rep(c("N1", "N2", "N3", "N4"), 18), yield = rnorm(72, 1200, 150) ) anova_spd_c_main_ab_sub(data, response = "yield", main_plot = "irrigation", sub_factor1 = "variety", sub_factor2 = "nitrogen", replication = "rep")
Performs pooled analysis of Split Plot Design experiments conducted across multiple environments/years/locations.
anova_spd_pooled( data, response, main_plot, sub_plot, environment, replication, verbose = TRUE )anova_spd_pooled( data, response, main_plot, sub_plot, environment, replication, verbose = TRUE )
data |
Data frame containing combined data |
response |
Name of the response variable |
main_plot |
Name of main plot factor |
sub_plot |
Name of sub-plot factor |
environment |
Name of environment factor |
replication |
Name of replication factor (nested within environment) |
verbose |
Logical. If TRUE (default), prints formatted output to console. |
List containing pooled ANOVA and component analyses
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
data <- expand.grid( year = c("Y1", "Y2", "Y3"), rep = 1:3, irrigation = c("I1", "I2", "I3"), variety = c("V1", "V2", "V3", "V4") ) data$yield <- rnorm(nrow(data), 1200, 180) anova_spd_pooled(data, response = "yield", main_plot = "irrigation", sub_plot = "variety", environment = "year", replication = "rep")data <- expand.grid( year = c("Y1", "Y2", "Y3"), rep = 1:3, irrigation = c("I1", "I2", "I3"), variety = c("V1", "V2", "V3", "V4") ) data$yield <- rnorm(nrow(data), 1200, 180) anova_spd_pooled(data, response = "yield", main_plot = "irrigation", sub_plot = "variety", environment = "year", replication = "rep")
Performs complete ANOVA for Split-Split Plot Design with proper error terms for main plot, sub-plot, and sub-sub-plot factors. Generates publication-ready ANOVA table with significance levels.
anova_sspd( data, response, main_plot, sub_plot, sub_sub_plot, replication, verbose = TRUE )anova_sspd( data, response, main_plot, sub_plot, sub_sub_plot, replication, verbose = TRUE )
data |
Data frame containing the experimental data |
response |
Name of the response variable (as string) |
main_plot |
Name of main plot factor |
sub_plot |
Name of sub-plot factor |
sub_sub_plot |
Name of sub-sub-plot factor |
replication |
Name of replication/block factor |
verbose |
Logical. If TRUE (default), prints formatted output to console. |
List containing ANOVA table, means, and significance tests
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
# Example with sample data data <- expand.grid(rep=1:3, A=c('A1','A2'), B=c('B1','B2'), C=c('C1','C2')) data$yield <- rnorm(24, 1200, 150) anova_sspd(data, response='yield', main_plot='A', sub_plot='B', sub_sub_plot='C', replication='rep')# Example with sample data data <- expand.grid(rep=1:3, A=c('A1','A2'), B=c('B1','B2'), C=c('C1','C2')) data$yield <- rnorm(24, 1200, 150) anova_sspd(data, response='yield', main_plot='A', sub_plot='B', sub_sub_plot='C', replication='rep')
Performs pooled ANOVA for SSPD experiments across multiple environments.
anova_sspd_pooled( data, response, main_plot, sub_plot, sub_sub_plot, environment, replication, verbose = TRUE )anova_sspd_pooled( data, response, main_plot, sub_plot, sub_sub_plot, environment, replication, verbose = TRUE )
data |
Data frame containing combined data |
response |
Name of the response variable |
main_plot |
Name of main plot factor |
sub_plot |
Name of sub-plot factor |
sub_sub_plot |
Name of sub-sub-plot factor |
environment |
Name of environment factor |
replication |
Name of replication factor |
verbose |
Logical. If TRUE (default), prints formatted output to console. |
List containing pooled ANOVA results
Lalit Kumar Rolaniya, Ram Lal Jat, Monika Punia, Raja Ram Choudhary
data <- expand.grid(env = c("E1","E2"), rep = 1:3, A = c("A1","A2"), B = c("B1","B2"), C = c("C1","C2")) data$yield <- rnorm(nrow(data), 1200, 150) anova_sspd_pooled(data, "yield", "A", "B", "C", "env", "rep")data <- expand.grid(env = c("E1","E2"), rep = 1:3, A = c("A1","A2"), B = c("B1","B2"), C = c("C1","C2")) data$yield <- rnorm(nrow(data), 1200, 150) anova_sspd_pooled(data, "yield", "A", "B", "C", "env", "rep")
Performs ANOVA for Strip Plot (Strip-Split) Design where two factors are applied in horizontal and vertical strips.
anova_strip( data, response, horizontal_factor, vertical_factor, replication, alpha = 0.05, verbose = TRUE )anova_strip( data, response, horizontal_factor, vertical_factor, replication, alpha = 0.05, verbose = TRUE )
data |
Data frame containing the experimental data |
response |
Name of the response variable |
horizontal_factor |
Factor applied in horizontal strips (A) |
vertical_factor |
Factor applied in vertical strips (B) |
replication |
Name of replication factor |
alpha |
Significance level |
verbose |
Logical. If TRUE (default), prints formatted output to console. |
List containing ANOVA results
Lalit Kumar Rolaniya, Ram Lal Jat, Monika Punia, Raja Ram Choudhary
data <- expand.grid( rep = 1:4, irrigation = c("I1", "I2", "I3"), tillage = c("CT", "MT", "ZT") ) data$yield <- rnorm(nrow(data), 1200, 150) anova_strip(data, response = "yield", horizontal_factor = "irrigation", vertical_factor = "tillage", replication = "rep")data <- expand.grid( rep = 1:4, irrigation = c("I1", "I2", "I3"), tillage = c("CT", "MT", "ZT") ) data$yield <- rnorm(nrow(data), 1200, 150) anova_strip(data, response = "yield", horizontal_factor = "irrigation", vertical_factor = "tillage", replication = "rep")
Generate publication-quality plots for aridagri analyses.
arid_plot(x, type = "bar", ...)arid_plot(x, type = "bar", ...)
x |
An object from aridagri analysis functions |
type |
Plot type: "bar", "line", "interaction", "boxplot" |
... |
Additional arguments passed to plotting functions |
A ggplot2 object
Lalit Kumar Rolaniya, Ram Lal Jat, Monika Punia, Raja Ram Choudhary
df <- data.frame( yield = c(1200, 1350, 1100, 1450, 1280), wue = c(4.2, 4.8, 3.9, 5.1, 4.5), protein = c(22.1, 23.5, 21.8, 24.2, 22.9) ) result <- correlation_analysis(df, plot = FALSE) arid_plot(result)df <- data.frame( yield = c(1200, 1350, 1100, 1450, 1280), wue = c(4.2, 4.8, 3.9, 5.1, 4.5), protein = c(22.1, 23.5, 21.8, 24.2, 22.9) ) result <- correlation_analysis(df, plot = FALSE) arid_plot(result)
Tests assumptions of ANOVA: normality and homogeneity of variances.
check_assumptions(model, verbose = TRUE)check_assumptions(model, verbose = TRUE)
model |
ANOVA model object |
verbose |
Logical. If TRUE (default), prints formatted output to console. |
List containing diagnostic test results
Computes correlation matrix with significance levels and generates publication-ready correlation table and plot.
correlation_analysis( data, method = "pearson", plot = TRUE, digits = 3, verbose = TRUE )correlation_analysis( data, method = "pearson", plot = TRUE, digits = 3, verbose = TRUE )
data |
Data frame with numeric variables |
method |
Correlation method: "pearson", "spearman", or "kendall" |
plot |
Logical, whether to generate correlation plot |
digits |
Number of decimal places |
verbose |
Logical. If TRUE (default), prints formatted output to console. |
List with correlation matrix and significance matrix
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
data <- data.frame( yield = c(1200, 1350, 1100, 1450, 1280), wue = c(4.2, 4.8, 3.9, 5.1, 4.5), protein = c(22.1, 23.5, 21.8, 24.2, 22.9) ) correlation_analysis(data)data <- data.frame( yield = c(1200, 1350, 1100, 1450, 1280), wue = c(4.2, 4.8, 3.9, 5.1, 4.5), protein = c(22.1, 23.5, 21.8, 24.2, 22.9) ) correlation_analysis(data)
Calculates crop growth parameters from sequential harvest data.
crop_growth_analysis(dry_weight, leaf_area, days, verbose = TRUE)crop_growth_analysis(dry_weight, leaf_area, days, verbose = TRUE)
dry_weight |
Vector of dry matter at different stages |
leaf_area |
Vector of leaf area at different stages |
days |
Vector of days after sowing |
verbose |
Logical. If TRUE (default), prints formatted output to console. |
Data frame with growth parameters
Lalit Kumar Rolaniya, Ram Lal Jat, Monika Punia, Raja Ram Choudhary
dry_weight <- c(0.5, 2.1, 8.5, 25, 45, 62, 75) leaf_area <- c(15, 85, 350, 800, 950, 850, 600) days <- c(15, 30, 45, 60, 75, 90, 105) crop_growth_analysis(dry_weight, leaf_area, days)dry_weight <- c(0.5, 2.1, 8.5, 25, 45, 62, 75) leaf_area <- c(15, 85, 350, 800, 950, 850, 600) days <- c(15, 30, 45, 60, 75, 90, 105) crop_growth_analysis(dry_weight, leaf_area, days)
Calculates economic indicators including Cost of Cultivation, Gross Returns, Net Returns, B:C Ratio, and profitability indices for arid farming systems.
economic_analysis( yield, price, cost_fixed, cost_variable, byproduct_yield = 0, byproduct_price = 0, verbose = TRUE )economic_analysis( yield, price, cost_fixed, cost_variable, byproduct_yield = 0, byproduct_price = 0, verbose = TRUE )
yield |
Crop yield (kg/ha) |
price |
Market price (Rs/kg) |
cost_fixed |
Fixed costs (Rs/ha) |
cost_variable |
Variable costs (Rs/ha) |
byproduct_yield |
Byproduct yield (kg/ha), optional |
byproduct_price |
Byproduct price (Rs/kg), optional |
verbose |
Logical. If TRUE (default), prints formatted output to console. |
Data frame with economic analysis
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
economic_analysis(yield = 1200, price = 65, cost_fixed = 15000, cost_variable = 12000) # With byproduct economic_analysis(yield = 1200, price = 65, cost_fixed = 15000, cost_variable = 12000, byproduct_yield = 1800, byproduct_price = 5)economic_analysis(yield = 1200, price = 65, cost_fixed = 15000, cost_variable = 12000) # With byproduct economic_analysis(yield = 1200, price = 65, cost_fixed = 15000, cost_variable = 12000, byproduct_yield = 1800, byproduct_price = 5)
Calculates B:C ratio and economic efficiency metrics.
economic_indices(gross_return, total_cost, verbose = TRUE)economic_indices(gross_return, total_cost, verbose = TRUE)
gross_return |
Gross returns (Rs/ha) |
total_cost |
Total cost (Rs/ha) |
verbose |
Logical. If TRUE (default), prints formatted output to console. |
Data frame with economic indices
Lalit Kumar Rolaniya, Ram Lal Jat, Monika Punia, Raja Ram Choudhary
economic_indices(gross_return = c(75000, 82000), total_cost = c(35000, 38000))economic_indices(gross_return = c(75000, 82000), total_cost = c(35000, 38000))
Exports aridagri analysis results to Excel format for publication.
export_results(x, file, format = "xlsx", digits = 3, verbose = TRUE)export_results(x, file, format = "xlsx", digits = 3, verbose = TRUE)
x |
An object from aridagri analysis functions |
file |
Output file path |
format |
Output format: "xlsx" |
digits |
Number of decimal places |
verbose |
Logical. If TRUE (default), prints formatted output to console. |
Invisibly returns the file path
Lalit Kumar Rolaniya, Ram Lal Jat, Monika Punia, Raja Ram Choudhary
df <- data.frame( yield = c(1200, 1350, 1100, 1450, 1280), wue = c(4.2, 4.8, 3.9, 5.1, 4.5) ) result <- correlation_analysis(df, plot = FALSE) export_results(result, tempfile(fileext = ".xlsx"))df <- data.frame( yield = c(1200, 1350, 1100, 1450, 1280), wue = c(4.2, 4.8, 3.9, 5.1, 4.5) ) result <- correlation_analysis(df, plot = FALSE) export_results(result, tempfile(fileext = ".xlsx"))
Calculates Harvest Index and related partitioning indices.
harvest_index(grain_yield, straw_yield, verbose = TRUE)harvest_index(grain_yield, straw_yield, verbose = TRUE)
grain_yield |
Grain/economic yield |
straw_yield |
Straw/stover yield |
verbose |
Logical. If TRUE (default), prints formatted output to console. |
Data frame with harvest indices
Lalit Kumar Rolaniya, Ram Lal Jat, Monika Punia, Raja Ram Choudhary
harvest_index(grain_yield = c(1200, 1350, 1100), straw_yield = c(2400, 2500, 2300))harvest_index(grain_yield = c(1200, 1350, 1100), straw_yield = c(2400, 2500, 2300))
Comprehensive nutrient use efficiency calculations including Agronomic Efficiency (AE), Physiological Efficiency (PE), Apparent Recovery Efficiency (ARE), and Partial Factor Productivity (PFP). Essential for INM research in arid regions.
nue_calculate( yield_fertilized, yield_control, nutrient_applied, nutrient_uptake_fert = NULL, nutrient_uptake_ctrl = NULL, biomass_fert = NULL, biomass_ctrl = NULL, verbose = TRUE )nue_calculate( yield_fertilized, yield_control, nutrient_applied, nutrient_uptake_fert = NULL, nutrient_uptake_ctrl = NULL, biomass_fert = NULL, biomass_ctrl = NULL, verbose = TRUE )
yield_fertilized |
Yield with fertilizer application (kg/ha) |
yield_control |
Yield in control/unfertilized plot (kg/ha) |
nutrient_applied |
Amount of nutrient applied (kg/ha) |
nutrient_uptake_fert |
Nutrient uptake in fertilized plot (kg/ha), optional |
nutrient_uptake_ctrl |
Nutrient uptake in control plot (kg/ha), optional |
biomass_fert |
Total biomass in fertilized plot (kg/ha), optional |
biomass_ctrl |
Total biomass in control plot (kg/ha), optional |
verbose |
Logical. If TRUE (default), prints formatted output to console. |
Efficiency calculations:
AE (Agronomic Efficiency) = (Yield_fert - Yield_ctrl) / Nutrient_applied
PFP (Partial Factor Productivity) = Yield_fert / Nutrient_applied
ARE (Apparent Recovery Efficiency) = (Uptake_fert - Uptake_ctrl) / Nutrient_applied 100
PE (Physiological Efficiency) = (Yield_fert - Yield_ctrl) / (Uptake_fert - Uptake_ctrl)
Data frame with efficiency indices
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
# Basic NUE calculation nue_calculate(yield_fertilized = 1850, yield_control = 1200, nutrient_applied = 40) # Complete NUE with uptake data nue_calculate( yield_fertilized = 1850, yield_control = 1200, nutrient_applied = 40, nutrient_uptake_fert = 65, nutrient_uptake_ctrl = 35 )# Basic NUE calculation nue_calculate(yield_fertilized = 1850, yield_control = 1200, nutrient_applied = 40) # Complete NUE with uptake data nue_calculate( yield_fertilized = 1850, yield_control = 1200, nutrient_applied = 40, nutrient_uptake_fert = 65, nutrient_uptake_ctrl = 35 )
Fits nutrient response curves using quadratic, linear-plateau, or Mitscherlich models to determine economic optimum dose.
nutrient_response( dose, yield, model = "quadratic", price_output = 50, price_nutrient = 15, verbose = TRUE )nutrient_response( dose, yield, model = "quadratic", price_output = 50, price_nutrient = 15, verbose = TRUE )
dose |
Numeric vector of nutrient doses (kg/ha) |
yield |
Numeric vector of corresponding yields (kg/ha) |
model |
Model type: "quadratic", "linear_plateau", or "mitscherlich" |
price_output |
Price of output (Rs/kg) |
price_nutrient |
Price of nutrient (Rs/kg) |
verbose |
Logical. If TRUE (default), prints formatted output to console. |
List with model parameters and economic optimum
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
dose <- c(0, 20, 40, 60, 80, 100) yield <- c(1100, 1350, 1520, 1610, 1650, 1660) nutrient_response(dose, yield, model = "quadratic", price_output = 60, price_nutrient = 15)dose <- c(0, 20, 40, 60, 80, 100) yield <- c(1100, 1350, 1520, 1610, 1650, 1660) nutrient_response(dose, yield, model = "quadratic", price_output = 60, price_nutrient = 15)
Performs path analysis to determine direct and indirect effects of independent variables on a dependent variable. Essential for understanding yield contributing factors.
path_analysis(data, dependent, independent, digits = 4, verbose = TRUE)path_analysis(data, dependent, independent, digits = 4, verbose = TRUE)
data |
Data frame with numeric variables |
dependent |
Name of dependent variable (e.g., "yield") |
independent |
Character vector of independent variable names |
digits |
Number of decimal places |
verbose |
Logical. If TRUE (default), prints formatted output to console. |
List with direct effects, indirect effects, and correlation breakdown
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
data <- data.frame( yield = c(1200, 1350, 1100, 1450, 1280, 1380, 1220, 1400), pods = c(45, 52, 42, 58, 48, 54, 46, 56), seeds = c(8.2, 9.1, 7.8, 9.5, 8.5, 9.0, 8.3, 9.3), weight = c(32, 35, 30, 38, 33, 36, 31, 37) ) path_analysis(data, dependent = "yield", independent = c("pods", "seeds", "weight"))data <- data.frame( yield = c(1200, 1350, 1100, 1450, 1280, 1380, 1220, 1400), pods = c(45, 52, 42, 58, 48, 54, 46, 56), seeds = c(8.2, 9.1, 7.8, 9.5, 8.5, 9.0, 8.3, 9.3), weight = c(32, 35, 30, 38, 33, 36, 31, 37) ) path_analysis(data, dependent = "yield", independent = c("pods", "seeds", "weight"))
Performs PCA with visualization suitable for agricultural research data. Includes scree plot, biplot, and variable contributions.
pca_analysis(data, scale = TRUE, ncp = 5, plot = TRUE, verbose = TRUE)pca_analysis(data, scale = TRUE, ncp = 5, plot = TRUE, verbose = TRUE)
data |
Data frame with numeric variables |
scale |
Logical, whether to scale variables (default TRUE) |
ncp |
Number of components to retain (default 5) |
plot |
Logical, whether to generate plots |
verbose |
Logical. If TRUE (default), prints formatted output to console. |
PCA results with eigenvalues, loadings, and scores
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
data <- data.frame( yield = rnorm(30, 1200, 200), wue = rnorm(30, 4.5, 0.5), protein = rnorm(30, 22, 2), biomass = rnorm(30, 3500, 500) ) pca_analysis(data)data <- data.frame( yield = rnorm(30, 1200, 200), wue = rnorm(30, 4.5, 0.5), protein = rnorm(30, 22, 2), biomass = rnorm(30, 3500, 500) ) pca_analysis(data)
Performs multiple comparison tests after ANOVA.
perform_posthoc( model, data, response, treatment, mse, df_error, posthoc = "lsd", alpha = 0.05, verbose = TRUE )perform_posthoc( model, data, response, treatment, mse, df_error, posthoc = "lsd", alpha = 0.05, verbose = TRUE )
model |
ANOVA model object |
data |
Data frame |
response |
Response variable name |
treatment |
Treatment factor name |
mse |
Mean square error |
df_error |
Error degrees of freedom |
posthoc |
Test type: "lsd", "duncan", "tukey", "snk", "scheffe", or "all" |
alpha |
Significance level |
verbose |
Logical. If TRUE (default), prints formatted output to console. |
List containing post-hoc test results
Prints a formatted summary of Principal Component Analysis (PCA) results.
## S3 method for class 'aridagri_pca' print(x, ...)## S3 method for class 'aridagri_pca' print(x, ...)
x |
An object of class 'aridagri_pca' from |
... |
Additional arguments (currently unused) |
No return value, called for side effects. Prints the number of components retained by Kaiser criterion and cumulative variance explained to the console. The input object is returned invisibly.
Performs SEM analysis for agricultural field experiments. Allows testing of hypothesized causal relationships among variables.
sem_analysis(data, model, plot = TRUE, verbose = TRUE)sem_analysis(data, model, plot = TRUE, verbose = TRUE)
data |
Data frame with variables |
model |
Model specification in lavaan syntax |
plot |
Logical, whether to generate path diagram |
verbose |
Logical. If TRUE (default), prints formatted output to console. |
SEM results including fit indices and parameter estimates
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
if (requireNamespace("lavaan", quietly = TRUE)) { set.seed(42) n <- 100 nitrogen <- rnorm(n, 60, 10) phosphorus <- rnorm(n, 30, 5) yield <- 0.5 * nitrogen + 0.3 * phosphorus + rnorm(n, 0, 5) df <- data.frame(yield = yield, nitrogen = nitrogen, phosphorus = phosphorus) model <- 'yield ~ nitrogen + phosphorus' result <- sem_analysis(df, model, plot = FALSE) }if (requireNamespace("lavaan", quietly = TRUE)) { set.seed(42) n <- 100 nitrogen <- rnorm(n, 60, 10) phosphorus <- rnorm(n, 30, 5) yield <- 0.5 * nitrogen + 0.3 * phosphorus + rnorm(n, 0, 5) df <- data.frame(yield = yield, nitrogen = nitrogen, phosphorus = phosphorus) model <- 'yield ~ nitrogen + phosphorus' result <- sem_analysis(df, model, plot = FALSE) }
Performs comprehensive stability analysis using multiple established methods for evaluating genotype/treatment performance across environments.
Methods included:
Eberhart & Russell (1966): Regression approach
AMMI: Additive Main effects and Multiplicative Interaction
Finlay & Wilkinson (1963): Linear regression on environmental mean
Shukla (1972): Stability variance
Wricke (1962): Ecovalence
Coefficient of Variation: CV-based ranking
Superiority Index: Lin & Binns (1988)
stability_analysis( data, genotype, environment, replication, trait, method = "all", verbose = TRUE )stability_analysis( data, genotype, environment, replication, trait, method = "all", verbose = TRUE )
data |
Data frame with genotype/treatment, environment, replication, and trait |
genotype |
Name of genotype/treatment column |
environment |
Name of environment/location/year column |
replication |
Name of replication column |
trait |
Name of trait/response variable |
method |
Method: "eberhart", "ammi", "finlay", "shukla", "wricke", "cv", "superiority", or "all" |
verbose |
Logical. If TRUE (default), prints formatted output to console. |
List containing stability parameters and rankings
Lalit Kumar Rolaniya, Ram Lal Jat, Monika Punia, Raja Ram Choudhary
Eberhart, S.A. and Russell, W.A. (1966). Crop Science, 6: 36-40.
data <- expand.grid( variety = paste0("V", 1:10), location = paste0("L", 1:5), rep = 1:3 ) data$yield <- rnorm(nrow(data), 1200, 200) stability_analysis(data, genotype = "variety", environment = "location", replication = "rep", trait = "yield", method = "all")data <- expand.grid( variety = paste0("V", 1:10), location = paste0("L", 1:5), rep = 1:3 ) data$yield <- rnorm(nrow(data), 1200, 200) stability_analysis(data, genotype = "variety", environment = "location", replication = "rep", trait = "yield", method = "all")
Calculates Growing Degree Days, Helio-thermal Units, Photo-thermal Units, and Heat Use Efficiency from temperature data.
thermal_indices( tmax, tmin, base_temp = 10, sunshine_hours = NULL, day_length = NULL, crop_yield = NULL, biomass = NULL, verbose = TRUE )thermal_indices( tmax, tmin, base_temp = 10, sunshine_hours = NULL, day_length = NULL, crop_yield = NULL, biomass = NULL, verbose = TRUE )
tmax |
Vector of daily maximum temperatures (C) |
tmin |
Vector of daily minimum temperatures (C) |
base_temp |
Base temperature (C) |
sunshine_hours |
Vector of daily sunshine hours (optional) |
day_length |
Vector of day length in hours (optional) |
crop_yield |
Crop yield for HUE calculation (optional) |
biomass |
Biomass for HUE calculation (optional) |
verbose |
Logical. If TRUE (default), prints formatted output to console. |
List with thermal indices
Lalit Kumar Rolaniya, Ram Lal Jat, Monika Punia, Raja Ram Choudhary
tmax <- runif(90, 30, 42) tmin <- runif(90, 18, 28) thermal_indices(tmax, tmin, base_temp = 10)tmax <- runif(90, 30, 42) tmin <- runif(90, 18, 28) thermal_indices(tmax, tmin, base_temp = 10)
Calculates yield gaps comparing actual with potential yields.
yield_gap_analysis( actual_yield, potential_yield, attainable_yield = NULL, verbose = TRUE )yield_gap_analysis( actual_yield, potential_yield, attainable_yield = NULL, verbose = TRUE )
actual_yield |
Actual yield (kg/ha) |
potential_yield |
Potential yield (kg/ha) |
attainable_yield |
Attainable yield (kg/ha, optional) |
verbose |
Logical. If TRUE (default), prints formatted output to console. |
Data frame with yield gap analysis
Lalit Kumar Rolaniya, Ram Lal Jat, Monika Punia, Raja Ram Choudhary
yield_gap_analysis(actual_yield = c(800, 950, 720), potential_yield = 1500)yield_gap_analysis(actual_yield = c(800, 950, 720), potential_yield = 1500)