| Title: | Comprehensive Statistical Tools for Agricultural Research |
|---|---|
| Description: | Analysis of variance for the experimental designs used in agricultural research, with the correct error term for every stratum, standard error of mean (SEm), standard error of difference (SEd), critical difference (CD), coefficient of variation (CV) and letter groupings: completely randomized design (CRD), randomized complete block design (RCBD) with missing plots, Latin square, two- and three-factor factorials, split-plot designs (including factorial main or sub-plots), split-split-plot and strip-plot designs, and combined analysis over environments. Also covers the augmented randomized complete block design with adjusted means and genetic parameters (Federer, 1961 <doi:10.2307/2527837>), alpha lattice designs with intra-block or residual maximum likelihood (REML) analysis (Patterson and Williams, 1976 <doi:10.1093/biomet/63.1.83>) and repeated measures with Greenhouse-Geisser and Huynh-Feldt corrections and covariance structure models. Mean comparisons (least significant difference, Duncan, Tukey, Student-Newman-Keuls, Scheffe, Bonferroni and Dunnett) follow Gomez and Gomez (1984, ISBN:0471870927), with letters assigned by the algorithm of Piepho (2004) <doi:10.1198/1061860043515>. Stability analysis includes Eberhart and Russell (1966) <doi:10.2135/cropsci1966.0011183X000600010011x> regression, additive main effects and multiplicative interaction (AMMI), Finlay-Wilkinson, Shukla, Wricke, coefficient of variation and Lin-Binns methods, and genotype plus genotype-by-environment (GGE) biplots (Yan et al., 2000 <doi:10.2135/cropsci2000.403597x>). Further tools compute growing degree days, helio-thermal and photo-thermal units, crop growth rate, relative growth rate, net assimilation rate, leaf area index and leaf area duration, harvest index, yield gaps with the technology index, nutrient use efficiency, quadratic, plateau and Mitscherlich response curves with the economic optimum dose, benefit-cost ratio, correlation, principal component, path and structural equation analysis, publication tables for many traits and figures. |
| 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>, deceased), Raja Ram Choudhary [aut], Hemant Poonia [aut] (ORCID: <https://orcid.org/0000-0002-0945-8793>, deceased) |
| Maintainer: | Lalit Kumar Rolaniya <[email protected]> |
| License: | GPL-3 |
| Version: | 2.1.0 |
| Built: | 2026-11-11 01:15:01 UTC |
| Source: | https://github.com/lalitrolaniya/aridagri |
Analysis of variance for the common field designs with correct error terms, standard errors, critical differences and letter groupings, plus stability analysis, repeated measures, thermal indices, crop growth analysis, nutrient use efficiency, response curves and economics.
anova_crd, anova_rbd,
anova_latin: single-factor designs (missing plots and
unequal replication handled exactly)
anova_factorial, anova_factorial_3way:
factorial experiments
anova_spd, anova_spd_ab_main,
anova_spd_c_main_ab_sub, anova_spd_ab_cd,
anova_sspd, anova_strip: split-plot
family with SE and CD for every comparison
anova_rbd_pooled, anova_spd_pooled,
anova_sspd_pooled: combined analysis over environments
anova_augmented, anova_alpha_lattice:
designs for germplasm and breeding trials
anova_repeated: repeated measures with sphericity
corrections and covariance-structure models
anova_traits: publication table for many traits
perform_posthoc, compare_means,
check_assumptions.
stability_analysis (Eberhart-Russell, AMMI,
Finlay-Wilkinson, Shukla, Wricke, CV, Lin-Binns) and
gge_biplot.
thermal_indices, day_length,
crop_growth_analysis, harvest_index,
yield_gap_analysis, economic_indices,
economic_analysis, nue_calculate,
nutrient_response.
correlation_analysis, pca_analysis,
path_analysis, sem_analysis.
plot_means, plot_interaction,
plot_stability, plot_response,
plot() methods, theme_aridagri (ggplot2);
arid_plot (base graphics); export_results.
Lalit Kumar Rolaniya (maintainer), Ram Lal Jat, Monika Punia (deceased), Raja Ram Choudhary and Hemant Poonia (deceased)
Useful links:
Report bugs at https://github.com/lalitrolaniya/aridagri/issues
Analysis of an alpha lattice (resolvable incomplete block) design.
Gives the intra-block ANOVA, genotype means adjusted for incomplete
blocks with exact standard errors and letter groupings, and the
efficiency of the design relative to a randomized complete block design.
By default replications and blocks are treated as random (REML), so
that inter-block information is recovered (Patterson and Williams,
1976); analysis = "intra" gives the classical intra-block
estimates.
anova_alpha_lattice( data, response, genotype, replication, block, verbose = TRUE, analysis = c("reml", "intra"), posthoc = "lsd", alpha = 0.05 )anova_alpha_lattice( data, response, genotype, replication, block, verbose = TRUE, analysis = c("reml", "intra"), posthoc = "lsd", alpha = 0.05 )
data |
Data frame containing the data. |
response |
Name of the response variable. |
genotype |
Name of the genotype column. |
replication |
Name of the replication column. |
block |
Name of the incomplete block column (nested within replication; labels may repeat across replications). |
verbose |
Logical. If TRUE (default), prints the report. |
analysis |
|
posthoc |
Method for the letters (default |
alpha |
Significance level. Default 0.05. |
The intra-block ANOVA is the sequential analysis of the model
replication + block(replication) + genotype: genotypes are tested after
blocks. Blocks within replications are also shown adjusted for
genotypes. Adjusted means are least-squares means. The efficiency
relative to an RCBD is the average variance of a difference under the
RCBD analysis () divided by the average variance
of a difference of adjusted means. With REML, letters and CD use the
intra-block error degrees of freedom, an approximation.
An object of class aridagri_alpha with
anova_table, genotype_means (adjusted means with SE and
letters, highest first), avg_sed, cd (from the average
SEd), efficiency (percent, relative to RCBD), cv,
grand_mean, posthoc, variance_components (REML)
and model.
Lalit Kumar Rolaniya, Ram Lal Jat, Monika Punia, Raja Ram Choudhary, Hemant Poonia
Patterson, H.D. and Williams, E.R. (1976). A new class of resolvable incomplete block designs. Biometrika, 63(1), 83-92. doi:10.1093/biomet/63.1.83
data(cowpea_alpha) res <- anova_alpha_lattice(cowpea_alpha, response = "grain_yield", genotype = "genotype", replication = "rep", block = "block") head(res$genotype_means)data(cowpea_alpha) res <- anova_alpha_lattice(cowpea_alpha, response = "grain_yield", genotype = "genotype", replication = "rep", block = "block") head(res$genotype_means)
Analysis of an augmented randomized complete block design (Federer, 1956), where a few check varieties are replicated in every block and the new (test) entries appear once. Gives the ANOVA with the treatment sum of squares split into checks, tests and checks vs tests, adjusted means of all entries, the four standard errors of difference, a comparison of every test entry with the checks, and genetic parameters of the test entries.
anova_augmented( data, response, genotype, block, check_names, verbose = TRUE, alpha = 0.05, k = 2.063 )anova_augmented( data, response, genotype, block, check_names, verbose = TRUE, alpha = 0.05, k = 2.063 )
data |
Data frame containing the data. |
response |
Name of the response variable. |
genotype |
Name of the entry (genotype) column. |
block |
Name of the block column. |
check_names |
Character vector with the names of the check entries. |
verbose |
Logical. If TRUE (default), prints the report. |
alpha |
Significance level for CD. Default 0.05. |
k |
Standardized selection differential for genetic advance. Default 2.063 (5% selection intensity). |
Block effects are estimated from the checks and removed from the test
entries: adjusted value = observed value - (mean of checks in its block -
overall check mean). This equals the least-squares mean from the model
response ~ block + genotype, which is used here, so the standard
errors are exact. With blocks and checks the four
standard errors of difference are: two check means
; two test entries in the same block
; two test entries in different blocks
; a test entry and a check mean
.
Two ANOVA tables are given. In the first, treatments are fitted after blocks and their sum of squares is split into tests vs checks, checks and tests, each adjusted for blocks. In the second, blocks are fitted after treatments and the treatment sum of squares (ignoring blocks) is split into checks, tests and checks vs tests (Federer, 1961).
Genetic parameters of the test entries use the block-adjusted mean
square among tests from the first table: phenotypic variance
= MS(tests), error variance = MSE,
genotypic variance ,
broad-sense heritability , GCV and
PCV in percent of the mean of the adjusted test values, and genetic
advance .
An object of class aridagri_augmented with
anova_adjusted (treatments after blocks),
anova_partitioned (blocks after treatments, treatments split),
adjusted_means (all entries with type, raw and adjusted mean,
SE and block), se_diff and cd (the four comparisons),
test_vs_checks (difference of each test entry from the check
mean and the best check, with significance), block_effects,
genetic_parameters, mse, df_error,
anova_checks and model.
Lalit Kumar Rolaniya, Ram Lal Jat, Monika Punia, Raja Ram Choudhary, Hemant Poonia
Federer, W.T. (1956). Augmented (or hoonuiaku) designs. Hawaiian Planters' Record, 55, 191-208.
Federer, W.T. (1961). Augmented designs with one-way elimination of heterogeneity. Biometrics, 17(3), 447-473. doi:10.2307/2527837
data(chickpea_augmented) res <- anova_augmented(chickpea_augmented, response = "seed_yield", genotype = "entry", block = "block", check_names = c("C1", "C2", "C3", "C4")) head(res$test_vs_checks) res$genetic_parametersdata(chickpea_augmented) res <- anova_augmented(chickpea_augmented, response = "seed_yield", genotype = "entry", block = "block", check_names = c("C1", "C2", "C3", "C4")) head(res$test_vs_checks) res$genetic_parameters
Analysis of variance for a completely randomized design with standard errors, critical difference, coefficient of variation, post-hoc letter groupings and assumption checks. Unequal replication is handled exactly.
anova_crd( data, response, treatment, posthoc = "lsd", alpha = 0.05, verbose = TRUE, control = NULL )anova_crd( data, response, treatment, posthoc = "lsd", alpha = 0.05, verbose = TRUE, control = NULL )
data |
Data frame containing the experimental data. |
response |
Name of the response variable (character). |
treatment |
Name of the treatment column. |
posthoc |
Post-hoc test(s): |
alpha |
Significance level for the CD and the post-hoc tests (default 0.05). |
verbose |
Logical. If TRUE (default), prints the report. |
control |
Control level for Dunnett's test (default: first level). |
SEm = sqrt(MSE / r), SEd = sqrt(2 MSE / r) and CD = t(alpha/2, error df) x SEd, where r is the number of replications (the harmonic mean when replication is unequal; the letters then use the exact SE of each pair). CV = 100 sqrt(MSE) / grand mean. Rows with a missing response are dropped with a message.
An object of class aridagri_anova with
anova_table, model, grand_mean, cv,
ms_error, df_error, se_mean (SEm),
se_diff (SEd), cd (at alpha), cd_5,
cd_1, treatment_means (mean, SD, N, SE and letters),
posthoc, diagnostics, significance and
balanced.
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
Gomez, K.A. and Gomez, A.A. (1984). Statistical Procedures for Agricultural Research, 2nd ed. John Wiley and Sons, New York.
data <- data.frame( treatment = rep(c("T1", "T2", "T3", "T4"), each = 5), yield = c(1210, 1185, 1242, 1198, 1225, 1340, 1362, 1318, 1375, 1350, 1105, 1090, 1122, 1131, 1098, 1445, 1462, 1430, 1471, 1452) ) res <- anova_crd(data, response = "yield", treatment = "treatment", posthoc = "duncan") res$treatment_meansdata <- data.frame( treatment = rep(c("T1", "T2", "T3", "T4"), each = 5), yield = c(1210, 1185, 1242, 1198, 1225, 1340, 1362, 1318, 1375, 1350, 1105, 1090, 1122, 1131, 1098, 1445, 1462, 1430, 1471, 1452) ) res <- anova_crd(data, response = "yield", treatment = "treatment", posthoc = "duncan") res$treatment_means
Analysis of variance for a two-factor factorial experiment in a
randomized complete block design (when replication is given) or
a completely randomized design, with SEm, SEd and CD for both main
effects and the interaction, and letter groupings for factor means and
treatment combinations.
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 the first factor (A). |
factor2 |
Name of the second factor (B). |
replication |
Name of the replication (block) column, or
|
posthoc |
Post-hoc method for the letters (see
|
alpha |
Significance level for CD and letters. Default 0.05. |
verbose |
Logical. If TRUE (default), prints the report. |
An object of class aridagri_factorial with
anova_table, model, grand_mean, cv,
ms_error, df_error, comparisons (SEm, SEd and CD
for A, B and A x B), se_a, cd_a, se_b,
cd_b, se_ab, cd_ab, mean_a,
mean_b (with letters), interaction_means (all
combinations with letters), mean_ab (two-way table) and
posthoc.
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
data <- expand.grid(rep = 1:4, nitrogen = c("N0", "N40", "N80"), phosphorus = c("P0", "P30")) set.seed(1) data$yield <- 900 + 3 * as.numeric(sub("N", "", data$nitrogen)) + 2 * as.numeric(sub("P", "", data$phosphorus)) + rnorm(nrow(data), 0, 40) res <- anova_factorial(data, response = "yield", factor1 = "nitrogen", factor2 = "phosphorus", replication = "rep") res$interaction_meansdata <- expand.grid(rep = 1:4, nitrogen = c("N0", "N40", "N80"), phosphorus = c("P0", "P30")) set.seed(1) data$yield <- 900 + 3 * as.numeric(sub("N", "", data$nitrogen)) + 2 * as.numeric(sub("P", "", data$phosphorus)) + rnorm(nrow(data), 0, 40) res <- anova_factorial(data, response = "yield", factor1 = "nitrogen", factor2 = "phosphorus", replication = "rep") res$interaction_means
Analysis of variance for a three-factor factorial experiment in a
randomized complete block design (when replication is given) or
a completely randomized design, with SEm, SEd and CD for every main
effect and interaction and letter groupings for main-effect means and
treatment combinations.
anova_factorial_3way( data, response, factor1, factor2, factor3, replication = NULL, alpha = 0.05, verbose = TRUE, posthoc = "lsd" )anova_factorial_3way( data, response, factor1, factor2, factor3, replication = NULL, alpha = 0.05, verbose = TRUE, posthoc = "lsd" )
data |
Data frame containing the data. |
response |
Name of the response variable. |
factor1 |
Name of the first factor (A). |
factor2 |
Name of the second factor (B). |
factor3 |
Name of the third factor (C). |
replication |
Name of the replication (block) column, or
|
alpha |
Significance level for CD and letters. Default 0.05. |
verbose |
Logical. If TRUE (default), prints the report. |
posthoc |
Post-hoc method for the letters (see
|
An object of class aridagri_factorial3 with
anova_table, model, grand_mean, cv,
ms_error, df_error, comparisons (SEm, SEd and CD
for all seven effects), means (a list of tables for A, B, C,
A x B, A x C, B x C and A x B x C, with letters) and posthoc.
Lalit Kumar Rolaniya, Ram Lal Jat, Monika Punia, Raja Ram Choudhary, Hemant Poonia
data <- expand.grid(rep = 1:3, A = c("A1", "A2"), B = c("B1", "B2"), C = c("C1", "C2", "C3")) set.seed(2) data$yield <- rnorm(nrow(data), 1200, 60) res <- anova_factorial_3way(data, "yield", "A", "B", "C", "rep") res$comparisonsdata <- expand.grid(rep = 1:3, A = c("A1", "A2"), B = c("B1", "B2"), C = c("C1", "C2", "C3")) set.seed(2) data$yield <- rnorm(nrow(data), 1200, 60) res <- anova_factorial_3way(data, "yield", "A", "B", "C", "rep") res$comparisons
Analysis of variance for a Latin square design with row and column blocking, SEm, SEd, CD, CV, the efficiency of the Latin square relative to a CRD and to an RCBD, and post-hoc letter groupings.
anova_latin( data, response, treatment, row, column, posthoc = "lsd", alpha = 0.05, verbose = TRUE, control = NULL )anova_latin( data, response, treatment, row, column, posthoc = "lsd", alpha = 0.05, verbose = TRUE, control = NULL )
data |
Data frame containing the data. |
response |
Name of the response variable. |
treatment |
Name of the treatment column. |
row |
Name of the row column. |
column |
Name of the column column. |
posthoc |
Post-hoc method(s); see |
alpha |
Significance level. Default 0.05. |
verbose |
Logical. If TRUE (default), prints the report. |
control |
Control level for Dunnett's test. |
Relative efficiencies (Cochran and Cox, 1957; Gomez and Gomez, 1984)
use the row (), column () and error () mean
squares: versus a CRD, ;
versus an RCBD with rows as blocks, ;
versus an RCBD with columns as blocks, ,
each multiplied by the precision adjustment factor when the error
degrees of freedom are below 20.
An object of class aridagri_anova with the components
of anova_crd and relative_efficiency (a named
vector, percent).
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
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 = c(1180, 1265, 1342, 1410, 1238, 1270, 1335, 1402, 1251, 1176, 1340, 1415, 1245, 1190, 1258, 1405, 1232, 1178, 1262, 1339, 1236, 1183, 1271, 1348, 1398) ) anova_latin(data, response = "yield", treatment = "treatment", row = "row", column = "col")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 = c(1180, 1265, 1342, 1410, 1238, 1270, 1335, 1402, 1251, 1176, 1340, 1415, 1245, 1190, 1258, 1405, 1232, 1178, 1262, 1339, 1236, 1183, 1271, 1348, 1398) ) anova_latin(data, response = "yield", treatment = "treatment", row = "row", column = "col")
Analysis of variance for a randomized complete block design with standard errors, critical difference, CV, relative efficiency over a CRD, post-hoc letter groupings and assumption checks. Missing plots are handled by least squares: treatments are tested after blocks, means are least-squares (adjusted) means and every pair is compared with its own standard error.
anova_rbd( data, response, treatment, block, posthoc = "lsd", alpha = 0.05, verbose = TRUE, control = NULL )anova_rbd( data, response, treatment, block, posthoc = "lsd", alpha = 0.05, verbose = TRUE, control = NULL )
data |
Data frame containing the experimental data. |
response |
Name of the response variable (character). |
treatment |
Name of the treatment column. |
block |
Name of the block (replication) column. |
posthoc |
Post-hoc test(s): |
alpha |
Significance level for the CD and the post-hoc tests (default 0.05). |
verbose |
Logical. If TRUE (default), prints the report. |
control |
Control level for Dunnett's test (default: first level). |
Relative efficiency of the RCBD over a CRD follows Gomez and Gomez (1984):
where and are the block and error mean squares,
multiplied by the precision adjustment factor
when the error degrees of freedom are below 20. Values above 100% mean
that blocking reduced the error.
An object of class aridagri_anova. In addition to the
components described in anova_crd it contains
relative_efficiency (percent, adjusted),
relative_efficiency_unadjusted and missing_plots.
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
Gomez, K.A. and Gomez, A.A. (1984). Statistical Procedures for Agricultural Research, 2nd ed. John Wiley and Sons, New York.
data(mothbean_rbd) res <- anova_rbd(mothbean_rbd, response = "seed_yield", treatment = "treatment", block = "block", posthoc = "duncan") res$treatment_means res$relative_efficiencydata(mothbean_rbd) res <- anova_rbd(mothbean_rbd, response = "seed_yield", treatment = "treatment", block = "block", posthoc = "duncan") res$treatment_means res$relative_efficiency
Combined analysis of variance for the same set of treatments tested in a randomized complete block design in several environments (years, seasons or locations). Gives the analysis of each environment, Bartlett's test of homogeneity of error variances, the combined ANOVA with the correct error term for every source, SE and CD for treatment, environment and interaction means, and letter groupings for the treatment means.
anova_rbd_pooled( data, response, treatment, environment, block, posthoc = "lsd", alpha = 0.05, verbose = TRUE, env_effect = c("fixed", "random"), control = NULL )anova_rbd_pooled( data, response, treatment, environment, block, posthoc = "lsd", alpha = 0.05, verbose = TRUE, env_effect = c("fixed", "random"), control = NULL )
data |
Data frame containing the experimental data. |
response |
Name of the response variable (character). |
treatment |
Name of the treatment column. |
environment |
Name of the environment (year, season or location) column. |
block |
Name of the block column (blocks are nested within environments; labels may repeat across environments). |
posthoc |
Post-hoc test(s): |
alpha |
Significance level for the CD and the post-hoc tests (default 0.05). |
verbose |
Logical. If TRUE (default), prints the report. |
env_effect |
Either |
control |
Control level for Dunnett's test (default: first level). |
Sources and their F-tests (McIntosh, 1983; Gomez and Gomez, 1984): environment is tested against blocks within environments; the treatment x environment interaction against the pooled error; the treatment effect against the pooled error when environments are fixed and against the treatment x environment mean square when they are random. With random environments the usual restricted mixed model is assumed, so environment is still tested against blocks within environments. The SE and CD of treatment means use the same denominator as the treatment F-test. Bartlett's chi-square tests whether the error variances of the environments can be pooled; when it is significant, interpret the combined analysis with care.
An object of class aridagri_pooled with
pooled_anova (combined ANOVA with correct F-tests),
individual_anovas, environment_summary (mean, MSE, CV,
F, p and CD of each environment), bartlett_test,
treatment_means (with letters), interaction_means,
se_treatment, cd_treatment, se_environment,
cd_environment, se_interaction, cd_interaction,
posthoc, cv, grand_mean, mse_values and
model.
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
McIntosh, M.S. (1983). Analysis of combined experiments. Agronomy Journal, 75(1), 153-155. doi:10.2134/agronj1983.00021962007500010041x
Gomez, K.A. and Gomez, A.A. (1984). Statistical Procedures for Agricultural Research, 2nd ed. John Wiley and Sons, New York.
data(pearlmillet_met) res <- anova_rbd_pooled(pearlmillet_met, response = "grain_yield", treatment = "genotype", environment = "environment", block = "rep", verbose = FALSE) res$pooled_anova res$bartlett_testdata(pearlmillet_met) res <- anova_rbd_pooled(pearlmillet_met, response = "grain_yield", treatment = "genotype", environment = "environment", block = "rep", verbose = FALSE) res$pooled_anova res$bartlett_test
Analysis of experiments in which the same experimental units (plots, animals, trees) are measured on several occasions: plant height or LAI at successive dates, soil moisture through the season, or body weight, heart rate or blood metabolites over time. Gives the univariate split-plot-in-time ANOVA, Mauchly's test of sphericity with Greenhouse-Geisser and Huynh-Feldt corrected p-values, a comparison of covariance structures by mixed models (compound symmetry, first-order autoregressive and unstructured), SE and CD for every comparison, letter groupings, and a separate analysis at each time.
anova_repeated( data, response, treatment, time, subject = NULL, block = NULL, posthoc = "lsd", alpha = 0.05, covariance = TRUE, verbose = TRUE )anova_repeated( data, response, treatment, time, subject = NULL, block = NULL, posthoc = "lsd", alpha = 0.05, covariance = TRUE, verbose = TRUE )
data |
Data frame in long format (one row per unit per time). |
response |
Name of the response variable. |
treatment |
Name of the treatment column. |
time |
Name of the time (occasion) column. Times are taken in the order of their levels (numeric times are sorted). |
subject |
Name of the column identifying the experimental unit that
is measured repeatedly. If |
block |
Name of the block column for units laid out in randomized
complete blocks, or |
posthoc |
Method for the letters (default |
alpha |
Significance level. Default 0.05. |
covariance |
Logical. If TRUE (default), fits mixed models with different covariance structures using nlme. |
verbose |
Logical. If TRUE (default), prints the report. |
Univariate analysis. Treatment (and block) are tested against
the between-unit error, Error(a). Time and the treatment x time
interaction are tested against the within-unit error, Error(b). With
blocks, the block x time interaction is fitted as a separate
within-unit term, as in the univariate tests of SAS PROC GLM with a
REPEATED statement, so that the sphericity corrections apply to the
same error term. This is
valid when the covariance of the repeated measurements is spherical.
Mauchly's test checks this, and the Greenhouse-Geisser (1959) and
Huynh-Feldt (1976) epsilons, the latter with the correction of Lecoutre
(1991) as in anova.mlm(), scale the degrees of freedom of the
within-unit tests when it fails. A common rule is to use the
Greenhouse-Geisser p-value when epsilon is below 0.75 and the
Huynh-Feldt p-value otherwise.
Mixed models. Generalized least squares models with the same fixed effects are fitted by REML with compound symmetry (CS), first-order autoregressive (AR1, on the time order) and unstructured (UN, with separate variances per time) covariance, and compared by AIC and BIC. The marginal F-tests of the best structure are reported (with the residual degrees of freedom used by nlme, so tests of between-unit effects are approximate; the univariate test of treatment is exact for balanced data). Structures that fail to converge are skipped.
Comparisons. With units per treatment,
treatments and times, the SEd are as in a split-plot design
with treatments in main plots and times in sub-plots: treatment means
, time means , times within
a treatment , and treatments at the same time
with the weighted t.
An object of class aridagri_repeated with
anova_table (univariate), sphericity (Mauchly's W and
p, GG and HF epsilons), corrected (within-unit tests with GG
and HF p-values), covariance_models (AIC/BIC table),
best_structure, mixed_anova, se_cd,
means (treatment x time table), treatment_means,
time_means, letters, by_time (ANOVA at each time)
and models.
Greenhouse, S.W. and Geisser, S. (1959). On methods in the analysis of profile data. Psychometrika, 24(2), 95-112. doi:10.1007/BF02289823
Lecoutre, B. (1991). A correction for the epsilon approximate test in repeated measures designs with two or more independent groups. Journal of Educational Statistics, 16(4), 371-372. doi:10.3102/10769986016004371
Huynh, H. and Feldt, L.S. (1976). Estimation of the Box correction for degrees of freedom from sample data in randomized block and split-plot designs. Journal of Educational Statistics, 1(1), 69-82. doi:10.3102/10769986001001069
Littell, R.C., Henry, P.R. and Ammerman, C.B. (1998). Statistical analysis of repeated measures data using SAS procedures. Journal of Animal Science, 76(4), 1216-1231. doi:10.2527/1998.7641216x
data(mungbean_repeated) rm <- anova_repeated(mungbean_repeated, response = "spad", treatment = "treatment", time = "das", block = "block") rm$sphericity rm$covariance_modelsdata(mungbean_repeated) rm <- anova_repeated(mungbean_repeated, response = "spad", treatment = "treatment", time = "das", block = "block") rm$sphericity rm$covariance_models
Analysis of variance for a split-plot design in randomized complete blocks, with the main-plot factor tested against Error(a) and the sub-plot factor and interaction against Error(b). Gives CV(a), CV(b), SEm, SEd and CD for all four standard comparisons and letter groupings for main-plot means, sub-plot means and each factor within the levels of the other.
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 the main-plot factor (A). |
sub_plot |
Name of the sub-plot factor (B). |
replication |
Name of the replication (block) column. |
posthoc |
Method for the letters (see
|
alpha |
Significance level for CD and letters. Default 0.05. |
verbose |
Logical. If TRUE (default), prints the report. |
Standard errors of difference (Gomez and Gomez, 1984, table 3.10):
main-plot means , sub-plot means
, sub-plot means at the same main-plot level
, and main-plot means at the same or different
sub-plot level . For the last
comparison the CD uses the weighted t value
.
The data must be complete (every combination once in each
replication).
An object of class aridagri_spd with the corrected
anova_table, cv_a, cv_b, error mean squares and
df, se_main, cd_main, se_sub, cd_sub,
se_sub_same, cd_sub_same, se_main_same_sub,
cd_main_same_sub, se_cd (all comparisons),
main_means and sub_means (with letters),
interaction_means, letters (each factor within the
levels of the other) and model.
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
Gomez, K.A. and Gomez, A.A. (1984). Statistical Procedures for Agricultural Research, 2nd ed. John Wiley and Sons, New York.
data(clusterbean_spd) res <- anova_spd(clusterbean_spd, response = "seed_yield", main_plot = "irrigation", sub_plot = "nitrogen", replication = "rep") res$se_cddata(clusterbean_spd) res <- anova_spd(clusterbean_spd, response = "seed_yield", main_plot = "irrigation", sub_plot = "nitrogen", replication = "rep") res$se_cd
Split-plot design where the main plots carry A x B and the sub-plots carry C x D. Main-plot sources are tested against Error(a), all other sources against Error(b).
anova_spd_ab_cd( data, response, main_factor1, main_factor2, sub_factor1, sub_factor2, replication, verbose = TRUE, posthoc = "lsd", alpha = 0.05 )anova_spd_ab_cd( data, response, main_factor1, main_factor2, sub_factor1, sub_factor2, replication, verbose = TRUE, posthoc = "lsd", alpha = 0.05 )
data |
Data frame containing the experimental data. |
response |
Name of the response variable. |
main_factor1 |
First main-plot factor (A). |
main_factor2 |
Second main-plot factor (B). |
sub_factor1 |
First sub-plot factor (C). |
sub_factor2 |
Second sub-plot factor (D). |
replication |
Name of the replication column. |
verbose |
Logical. If TRUE (default), prints the report. |
posthoc |
Method for the letters (default |
alpha |
Significance level. Default 0.05. |
An object of class aridagri_spd_abcd; see
anova_spd_ab_main for the components.
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
data <- expand.grid(rep = 1:3, irrigation = c("I1", "I2"), tillage = c("CT", "ZT"), variety = c("V1", "V2"), nitrogen = c("N1", "N2", "N3")) set.seed(5) data$yield <- rnorm(nrow(data), 1200, 80) res <- anova_spd_ab_cd(data, response = "yield", main_factor1 = "irrigation", main_factor2 = "tillage", sub_factor1 = "variety", sub_factor2 = "nitrogen", replication = "rep", verbose = FALSE) res$anova_tabledata <- expand.grid(rep = 1:3, irrigation = c("I1", "I2"), tillage = c("CT", "ZT"), variety = c("V1", "V2"), nitrogen = c("N1", "N2", "N3")) set.seed(5) data$yield <- rnorm(nrow(data), 1200, 80) res <- anova_spd_ab_cd(data, response = "yield", main_factor1 = "irrigation", main_factor2 = "tillage", sub_factor1 = "variety", sub_factor2 = "nitrogen", replication = "rep", verbose = FALSE) res$anova_table
Split-plot design where the main plots carry the factorial combination of two factors (A x B) and the sub-plots carry factor C. A, B and A x B are tested against Error(a); C and every interaction with C against Error(b).
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 main-plot factor (A). |
main_factor2 |
Second main-plot factor (B). |
sub_plot |
Sub-plot factor (C). |
replication |
Name of the replication column. |
posthoc |
Method for the letters (default |
alpha |
Significance level. Default 0.05. |
verbose |
Logical. If TRUE (default), prints the report. |
An object of class aridagri_spd_ab with the corrected
anova_table, cv, error mean squares and df,
se_cd (SEm, SEd and CD for every main effect and interaction
comparison), factor_means (with letters), letters,
interaction_means and model.
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
data <- expand.grid(rep = 1:3, irrigation = c("I1", "I2"), variety = c("V1", "V2", "V3"), nitrogen = c("N0", "N1", "N2", "N3")) set.seed(3) data$yield <- rnorm(nrow(data), 1200, 80) res <- anova_spd_ab_main(data, response = "yield", main_factor1 = "irrigation", main_factor2 = "variety", sub_plot = "nitrogen", replication = "rep", verbose = FALSE) res$anova_tabledata <- expand.grid(rep = 1:3, irrigation = c("I1", "I2"), variety = c("V1", "V2", "V3"), nitrogen = c("N0", "N1", "N2", "N3")) set.seed(3) data$yield <- rnorm(nrow(data), 1200, 80) res <- anova_spd_ab_main(data, response = "yield", main_factor1 = "irrigation", main_factor2 = "variety", sub_plot = "nitrogen", replication = "rep", verbose = FALSE) res$anova_table
Split-plot design where the main plots carry factor C and the sub-plots carry the factorial combination of two factors (A x B). C is tested against Error(a); A, B, A x B and every interaction with C against Error(b).
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 sub-plot factor (A). |
sub_factor2 |
Second sub-plot factor (B). |
replication |
Name of the replication column. |
posthoc |
Method for the letters (default |
alpha |
Significance level. Default 0.05. |
verbose |
Logical. If TRUE (default), prints the report. |
An object of class aridagri_spd_cab; see
anova_spd_ab_main for the components.
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
data <- expand.grid(rep = 1:3, irrigation = c("I1", "I2", "I3"), variety = c("V1", "V2"), nitrogen = c("N1", "N2", "N3", "N4")) set.seed(4) data$yield <- rnorm(nrow(data), 1200, 80) res <- anova_spd_c_main_ab_sub(data, response = "yield", main_plot = "irrigation", sub_factor1 = "variety", sub_factor2 = "nitrogen", replication = "rep", verbose = FALSE) res$anova_tabledata <- expand.grid(rep = 1:3, irrigation = c("I1", "I2", "I3"), variety = c("V1", "V2"), nitrogen = c("N1", "N2", "N3", "N4")) set.seed(4) data$yield <- rnorm(nrow(data), 1200, 80) res <- anova_spd_c_main_ab_sub(data, response = "yield", main_plot = "irrigation", sub_factor1 = "variety", sub_factor2 = "nitrogen", replication = "rep", verbose = FALSE) res$anova_table
Combined (pooled) analysis of a split-plot experiment repeated in several environments (years, seasons or locations). Environments are fixed and replications random within environments: the environment effect is tested against replications within environments, main-plot sources against the pooled Error(a) and sub-plot sources against the pooled Error(b). SEm, SEd and CD are given for every comparison.
anova_spd_pooled( data, response, main_plot, sub_plot, environment, replication, verbose = TRUE, posthoc = "lsd", alpha = 0.05 )anova_spd_pooled( data, response, main_plot, sub_plot, environment, replication, verbose = TRUE, posthoc = "lsd", alpha = 0.05 )
data |
Data frame containing the combined data. |
response |
Name of the response variable. |
main_plot |
Name of the main-plot factor. |
sub_plot |
Name of the sub-plot factor. |
environment |
Name of the environment column. |
replication |
Name of the replication column (nested within environment; labels may repeat across environments). |
verbose |
Logical. If TRUE (default), prints the report. |
posthoc |
Method for the letters (default |
alpha |
Significance level. Default 0.05. |
An object of class aridagri_spd_pooled with
anova_table, cv (by stratum), se_cd,
factor_means (with letters), main_means,
sub_means, env_means and model.
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")) set.seed(7) data$yield <- rnorm(nrow(data), 1200, 90) res <- anova_spd_pooled(data, response = "yield", main_plot = "irrigation", sub_plot = "variety", environment = "year", replication = "rep", verbose = FALSE) res$anova_tabledata <- expand.grid(year = c("Y1", "Y2", "Y3"), rep = 1:3, irrigation = c("I1", "I2", "I3"), variety = c("V1", "V2", "V3", "V4")) set.seed(7) data$yield <- rnorm(nrow(data), 1200, 90) res <- anova_spd_pooled(data, response = "yield", main_plot = "irrigation", sub_plot = "variety", environment = "year", replication = "rep", verbose = FALSE) res$anova_table
Analysis of variance for a split-split-plot design with main-plot sources tested against Error(a), sub-plot sources against Error(b) and sub-sub-plot sources against Error(c). Gives CVs for the three strata, SEm, SEd and CD for every type of comparison (including those that mix error terms) and letter groupings.
anova_sspd( data, response, main_plot, sub_plot, sub_sub_plot, replication, verbose = TRUE, posthoc = "lsd", alpha = 0.05 )anova_sspd( data, response, main_plot, sub_plot, sub_sub_plot, replication, verbose = TRUE, posthoc = "lsd", alpha = 0.05 )
data |
Data frame containing the experimental data. |
response |
Name of the response variable. |
main_plot |
Name of the main-plot factor (A). |
sub_plot |
Name of the sub-plot factor (B). |
sub_sub_plot |
Name of the sub-sub-plot factor (C). |
replication |
Name of the replication column. |
verbose |
Logical. If TRUE (default), prints the report. |
posthoc |
Method for the letters (default |
alpha |
Significance level. Default 0.05. |
An object of class aridagri_sspd with the corrected
anova_table, cv, ms_error_a/b/c,
df_error_a/b/c, se_cd, factor_means,
letters, interaction_means and model.
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
Gomez, K.A. and Gomez, A.A. (1984). Statistical Procedures for Agricultural Research, 2nd ed. John Wiley and Sons, New York.
data <- expand.grid(rep = 1:3, A = c("A1", "A2"), B = c("B1", "B2"), C = c("C1", "C2", "C3")) set.seed(6) data$yield <- rnorm(nrow(data), 1200, 80) res <- anova_sspd(data, response = "yield", main_plot = "A", sub_plot = "B", sub_sub_plot = "C", replication = "rep")data <- expand.grid(rep = 1:3, A = c("A1", "A2"), B = c("B1", "B2"), C = c("C1", "C2", "C3")) set.seed(6) data$yield <- rnorm(nrow(data), 1200, 80) res <- anova_sspd(data, response = "yield", main_plot = "A", sub_plot = "B", sub_sub_plot = "C", replication = "rep")
Combined (pooled) analysis of a split-split-plot experiment repeated in
several environments, with environments fixed and replications random
within environments. See anova_spd_pooled.
anova_sspd_pooled( data, response, main_plot, sub_plot, sub_sub_plot, environment, replication, verbose = TRUE, posthoc = "lsd", alpha = 0.05 )anova_sspd_pooled( data, response, main_plot, sub_plot, sub_sub_plot, environment, replication, verbose = TRUE, posthoc = "lsd", alpha = 0.05 )
data |
Data frame containing the combined data. |
response |
Name of the response variable. |
main_plot |
Name of the main-plot factor. |
sub_plot |
Name of the sub-plot factor. |
sub_sub_plot |
Name of the sub-sub-plot factor. |
environment |
Name of the environment column. |
replication |
Name of the replication column. |
verbose |
Logical. If TRUE (default), prints the report. |
posthoc |
Method for the letters (default |
alpha |
Significance level. Default 0.05. |
An object of class aridagri_sspd_pooled; see
anova_spd_pooled. Also contains subsub_means.
Lalit Kumar Rolaniya, Ram Lal Jat, Monika Punia, Raja Ram Choudhary, Hemant Poonia
data <- expand.grid(env = c("E1", "E2"), rep = 1:3, A = c("A1", "A2"), B = c("B1", "B2"), C = c("C1", "C2")) set.seed(8) data$yield <- rnorm(nrow(data), 1200, 90) res <- anova_sspd_pooled(data, "yield", "A", "B", "C", "env", "rep", verbose = FALSE) res$anova_tabledata <- expand.grid(env = c("E1", "E2"), rep = 1:3, A = c("A1", "A2"), B = c("B1", "B2"), C = c("C1", "C2")) set.seed(8) data$yield <- rnorm(nrow(data), 1200, 90) res <- anova_sspd_pooled(data, "yield", "A", "B", "C", "env", "rep", verbose = FALSE) res$anova_table
Analysis of variance for a strip-plot design, where factor A is applied to horizontal strips and factor B to vertical strips in each replication. A is tested against Error(a) = Rep x A, B against Error(b) = Rep x B, and A x B against Error(c). Gives CV(a), CV(b), CV(c), SEm, SEd and CD for the four standard comparisons, and letter groupings.
anova_strip( data, response, horizontal_factor, vertical_factor, replication, alpha = 0.05, verbose = TRUE, posthoc = "lsd" )anova_strip( data, response, horizontal_factor, vertical_factor, replication, alpha = 0.05, verbose = TRUE, posthoc = "lsd" )
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 the replication column. |
alpha |
Significance level. Default 0.05. |
verbose |
Logical. If TRUE (default), prints the report. |
posthoc |
Method for the letters (default |
Standard errors of difference (Gomez and Gomez, 1984, table 3.15), with
and levels of A and B and replications:
A means ; B means ; A means
at the same level of B ; B means at
the same level of A . The last two
use the weighted t of Cochran and Cox.
An object of class aridagri_strip with the corrected
anova_table, cv (a, b, c), error mean squares and df,
se_cd, horizontal_means and vertical_means (with
letters), interaction_means, letters and model.
Lalit Kumar Rolaniya, Ram Lal Jat, Monika Punia, Raja Ram Choudhary, Hemant Poonia
Gomez, K.A. and Gomez, A.A. (1984). Statistical Procedures for Agricultural Research, 2nd ed. John Wiley and Sons, New York.
data <- expand.grid(rep = 1:4, irrigation = c("I1", "I2", "I3"), tillage = c("CT", "MT", "ZT")) set.seed(9) data$yield <- rnorm(nrow(data), 1200, 70) 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")) set.seed(9) data$yield <- rnorm(nrow(data), 1200, 70) anova_strip(data, response = "yield", horizontal_factor = "irrigation", vertical_factor = "tillage", replication = "rep")
Runs the analysis of variance for several traits at once and assembles the table that agronomy journals and theses expect: treatment means followed by letters, then SEm, CD and CV for each trait (with "NS" when the F-test is not significant). Works for completely randomized, randomized block, two-factor factorial and split-plot designs.
anova_traits( data, traits, design = c("rbd", "crd", "factorial", "spd"), treatment = NULL, block = NULL, factor1 = NULL, factor2 = NULL, main_plot = NULL, sub_plot = NULL, posthoc = "lsd", alpha = 0.05, digits = 2, letters_if_ns = FALSE, verbose = TRUE )anova_traits( data, traits, design = c("rbd", "crd", "factorial", "spd"), treatment = NULL, block = NULL, factor1 = NULL, factor2 = NULL, main_plot = NULL, sub_plot = NULL, posthoc = "lsd", alpha = 0.05, digits = 2, letters_if_ns = FALSE, verbose = TRUE )
data |
Data frame with one row per plot. |
traits |
Character vector of response columns. |
design |
One of |
treatment |
Treatment column (CRD and RBD). |
block |
Block (replication) column (RBD, factorial in blocks and split-plot). |
factor1, factor2
|
The two factors of a factorial design. |
main_plot, sub_plot
|
Main-plot and sub-plot factors of a split-plot design. |
posthoc |
Method for the letters: |
alpha |
Significance level. Default 0.05. |
digits |
Decimal places for means, SEm and CD. A single number, or one per trait. Default 2. |
letters_if_ns |
Logical. If FALSE (default), letters are omitted when the F-test of that factor is not significant. |
verbose |
Logical. If TRUE (default), prints the table. |
An object of class aridagri_traits with table
(character data frame ready to export), stats (F, p, SEm, SEd,
CD and CV for each trait and factor) and results (the full
analysis for each trait). Export with export_results.
data(mothbean_rbd) tab <- anova_traits(mothbean_rbd, traits = c("plant_height", "pods_per_plant", "seed_yield", "harvest_index"), design = "rbd", treatment = "treatment", block = "block", posthoc = "duncan") tab$table data(clusterbean_spd) anova_traits(clusterbean_spd, traits = c("seed_yield", "wue"), design = "spd", main_plot = "irrigation", sub_plot = "nitrogen", block = "rep")data(mothbean_rbd) tab <- anova_traits(mothbean_rbd, traits = c("plant_height", "pods_per_plant", "seed_yield", "harvest_index"), design = "rbd", treatment = "treatment", block = "block", posthoc = "duncan") tab$table data(clusterbean_spd) anova_traits(clusterbean_spd, traits = c("seed_yield", "wue"), design = "spd", main_plot = "irrigation", sub_plot = "nitrogen", block = "rep")
Quick plots with base graphics (no extra packages): bar charts of
treatment or factor means with their letters for ANOVA results, a
heatmap for correlation results and the integrated ranking for stability
results. For publication figures with ggplot2 see
plot_means and the plot() methods.
arid_plot(x, type = "bar", ...)arid_plot(x, type = "bar", ...)
x |
An object from an aridagri analysis function. |
type |
Kept for compatibility; bar charts are drawn. |
... |
Unused. |
No return value; called for its side effect of drawing a plot.
Lalit Kumar Rolaniya, Ram Lal Jat, Monika Punia, Raja Ram Choudhary, Hemant Poonia
data(mothbean_rbd) res <- anova_rbd(mothbean_rbd, "seed_yield", "treatment", "block", verbose = FALSE) arid_plot(res)data(mothbean_rbd) res <- anova_rbd(mothbean_rbd, "seed_yield", "treatment", "block", verbose = FALSE) arid_plot(res)
Checks the assumptions behind an analysis of variance: normality of residuals (Shapiro-Wilk), homogeneity of variances across treatments (Bartlett and Levene/Brown-Forsythe), additivity of block and treatment effects (Tukey's one-degree-of-freedom test, for two-way models), serial independence (Durbin-Watson, in data order) and outliers (studentized residuals).
check_assumptions(model, verbose = TRUE, factor = NULL, plot = FALSE)check_assumptions(model, verbose = TRUE, factor = NULL, plot = FALSE)
model |
A fitted |
verbose |
Logical. If TRUE (default), prints the results. |
factor |
Name(s) of the factor(s) defining the groups for the
variance tests. Default |
plot |
Logical. If TRUE, draws the four standard residual plots with base graphics. Default FALSE. |
The variance tests use the model residuals, so block effects do not inflate the group variances. Levene's test is the Brown-Forsythe form (absolute deviations from the group median). Tukey's test for non-additivity adds the squared fitted values as a one-degree-of-freedom covariate to a model with two additive factors; a significant result suggests a transformation (Gomez and Gomez, 1984, ch. 7). The Durbin-Watson statistic is only meaningful when the rows are in field or time order.
A list with shapiro, bartlett, levene,
nonadditivity (where applicable), durbin_watson,
outliers (row indices with |studentized residual| > 3) and
groups_factor.
Tukey, J.W. (1949). One degree of freedom for non-additivity. Biometrics, 5(3), 232-242. doi:10.2307/3001938
Brown, M.B. and Forsythe, A.B. (1974). Robust tests for the equality of variances. Journal of the American Statistical Association, 69(346), 364-367. doi:10.1080/01621459.1974.10482955
data(mothbean_rbd) fit <- aov(seed_yield ~ block + treatment, data = mothbean_rbd) check_assumptions(fit)data(mothbean_rbd) fit <- aov(seed_yield ~ block + treatment, data = mothbean_rbd) check_assumptions(fit)
Simulated augmented randomized complete block design with 48 chickpea accessions (tested once) and four checks replicated in each of six blocks.
chickpea_augmentedchickpea_augmented
A data frame with 72 rows and 4 variables:
Factor, block (B1-B6).
Factor, checks C1-C4 and accessions IC-001 to IC-048.
Seed yield (kg/ha).
Plant height (cm).
Simulated with data-raw/make_datasets.R (seed 2026).
Not real experimental data.
data(chickpea_augmented) anova_augmented(chickpea_augmented, "seed_yield", "entry", "block", check_names = c("C1", "C2", "C3", "C4"))data(chickpea_augmented) anova_augmented(chickpea_augmented, "seed_yield", "entry", "block", check_names = c("C1", "C2", "C3", "C4"))
Simulated split-plot experiment on cluster bean (Cyamopsis tetragonoloba) with three irrigation levels in main plots and four nitrogen levels in sub-plots, in three replications.
clusterbean_spdclusterbean_spd
A data frame with 36 rows and 7 variables:
Factor, replication (R1-R3).
Factor, main-plot irrigation level.
Factor, sub-plot nitrogen level (kg N/ha; foliar = additional 2% urea spray).
Seed yield (kg/ha).
Seasonal water use (mm).
Water use efficiency (kg/ha per mm).
Stover yield (kg/ha).
Simulated with data-raw/make_datasets.R (seed 2026).
Not real experimental data.
data(clusterbean_spd) anova_spd(clusterbean_spd, "seed_yield", "irrigation", "nitrogen", "rep")data(clusterbean_spd) anova_spd(clusterbean_spd, "seed_yield", "irrigation", "nitrogen", "rep")
Assigns significance letters to treatment means when only the means,
the error mean square and its degrees of freedom are available (for
example from a published table or from another program). Uses the same
tests as perform_posthoc.
compare_means( means, mse, df_error, reps, method = "lsd", alpha = 0.05, verbose = TRUE )compare_means( means, mse, df_error, reps, method = "lsd", alpha = 0.05, verbose = TRUE )
means |
Named numeric vector of treatment means. |
mse |
Error mean square from the ANOVA. |
df_error |
Error degrees of freedom. |
reps |
Number of replications per mean: a single number or a vector with one value per mean. |
method |
One of |
alpha |
Significance level. Default 0.05. |
verbose |
Logical. If TRUE (default), prints the table. |
The comparison object described in
perform_posthoc: groups, table,
comparisons, critical_range and statistics.
m <- c(T1 = 1180, T2 = 1265, T3 = 1342, T4 = 1410, T5 = 1238) compare_means(m, mse = 3600, df_error = 12, reps = 4, method = "duncan")m <- c(T1 = 1180, T2 = 1265, T3 = 1342, T4 = 1410, T5 = 1238) compare_means(m, mse = 3600, df_error = 12, reps = 4, method = "duncan")
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)
Simulated alpha lattice trial of 24 cowpea genotypes in three
replications, each with six incomplete blocks of four plots. The layout
was generated with agricolae::design.alpha().
cowpea_alphacowpea_alpha
A data frame with 72 rows and 5 variables:
Factor, replication (1-3).
Factor, incomplete block within replication (1-6).
Plot number.
Factor, genotype code (CP-01 to CP-24).
Grain yield (kg/ha).
Simulated with data-raw/make_datasets.R (seed 2026).
Not real experimental data.
data(cowpea_alpha) anova_alpha_lattice(cowpea_alpha, "grain_yield", "genotype", "rep", "block")data(cowpea_alpha) anova_alpha_lattice(cowpea_alpha, "grain_yield", "genotype", "rep", "block")
Classical growth analysis from sequential harvests: crop growth rate, relative growth rate, net assimilation rate, leaf area index and leaf area duration for each interval between samplings.
crop_growth_analysis( dry_weight, leaf_area = NULL, days, verbose = TRUE, ground_area = NULL )crop_growth_analysis( dry_weight, leaf_area = NULL, days, verbose = TRUE, ground_area = NULL )
dry_weight |
Dry matter at each sampling (g per sample). |
leaf_area |
Leaf area at each sampling (cm2 per sample), or
|
days |
Days after sowing at each sampling (strictly increasing). |
verbose |
Logical. If TRUE (default), prints the table. |
ground_area |
Land area occupied by each sample (m2). When given,
CGR is expressed in g m-2 day-1 and LAI = leaf area / ground area.
When |
For two samplings at and (Watson, 1952;
Radford, 1967):
CGR = , P = ground area
RGR = (g g-1 day-1)
NAR = , reported in g m-2 (leaf)
day-1
LAD = (days)
A data frame of class aridagri_growth with one row per
interval: Period, CGR, RGR and, with leaf area,
NAR, LAI_start, LAI_end and LAD.
Lalit Kumar Rolaniya, Ram Lal Jat, Monika Punia, Raja Ram Choudhary, Hemant Poonia
Radford, P.J. (1967). Growth analysis formulae: their use and abuse. Crop Science, 7(3), 171-175. doi:10.2135/cropsci1967.0011183X000700030001x
Watson, D.J. (1952). The physiological basis of variation in yield. Advances in Agronomy, 4, 101-145. doi:10.1016/S0065-2113(08)60307-7
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, ground_area = 0.09)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, ground_area = 0.09)
Maximum possible daylight hours (astronomical day length) from latitude and day of year, following FAO Irrigation and Drainage Paper 56 (equations 24, 25 and 34). Useful for photo-thermal units when measured day length is not available.
day_length(latitude, date)day_length(latitude, date)
latitude |
Latitude in decimal degrees (north positive). |
date |
A |
Numeric vector of day length in hours.
Allen, R.G., Pereira, L.S., Raes, D. and Smith, M. (1998). Crop Evapotranspiration: Guidelines for Computing Crop Water Requirements. FAO Irrigation and Drainage Paper 56. FAO, Rome.
# Bikaner (28.0 N) on 15 March and 15 June day_length(28.0, as.Date(c("2026-03-15", "2026-06-15")))# Bikaner (28.0 N) on 15 March and 15 June day_length(28.0, as.Date(c("2026-03-15", "2026-06-15")))
Cost of cultivation, gross and net returns, benefit-cost ratio and cost of production. Arguments may be vectors (one value per treatment).
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 |
By-product yield (kg/ha), default 0. |
byproduct_price |
By-product price (Rs/kg), default 0. |
verbose |
Logical. If TRUE (default), prints the table. |
A data frame of class aridagri_economics.
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
economic_analysis(yield = 1200, price = 65, cost_fixed = 15000, cost_variable = 12000) economic_analysis(yield = c(1050, 1200, 1340), price = 65, cost_fixed = 15000, cost_variable = c(11000, 12000, 13500), byproduct_yield = c(1600, 1800, 1950), byproduct_price = 5)economic_analysis(yield = 1200, price = 65, cost_fixed = 15000, cost_variable = 12000) economic_analysis(yield = c(1050, 1200, 1340), price = 65, cost_fixed = 15000, cost_variable = c(11000, 12000, 13500), byproduct_yield = c(1600, 1800, 1950), byproduct_price = 5)
Net return, benefit-cost ratio and return per rupee invested from gross return and total cost.
economic_indices(gross_return, total_cost, verbose = TRUE)economic_indices(gross_return, total_cost, verbose = TRUE)
gross_return |
Gross return (Rs/ha). |
total_cost |
Total cost of cultivation (Rs/ha). |
verbose |
Logical. If TRUE (default), prints the table. |
A data frame of class aridagri_economics with
Net_Return, BC_Ratio (gross return / cost) and
Return_per_Rupee (net return / cost).
Lalit Kumar Rolaniya, Ram Lal Jat, Monika Punia, Raja Ram Choudhary, Hemant Poonia
economic_indices(gross_return = c(75000, 82000), total_cost = c(35000, 38000))economic_indices(gross_return = c(75000, 82000), total_cost = c(35000, 38000))
Writes the main tables of an aridagri result to an Excel workbook (one
sheet per table) or a CSV file. Multi-trait tables from
anova_traits are written as they appear in the report.
export_results(x, file, format = "xlsx", digits = 3, verbose = TRUE)export_results(x, file, format = "xlsx", digits = 3, verbose = TRUE)
x |
An aridagri result object or a data frame. |
file |
Output file path. |
format |
|
digits |
Number of decimal places for numeric columns. |
verbose |
Logical. If TRUE (default), prints the file name. |
Invisibly returns the file path.
Lalit Kumar Rolaniya, Ram Lal Jat, Monika Punia, Raja Ram Choudhary, Hemant Poonia
data(mothbean_rbd) res <- anova_rbd(mothbean_rbd, "seed_yield", "treatment", "block", verbose = FALSE) export_results(res, tempfile(fileext = ".csv"), format = "csv")data(mothbean_rbd) res <- anova_rbd(mothbean_rbd, "seed_yield", "treatment", "block", verbose = FALSE) export_results(res, tempfile(fileext = ".csv"), format = "csv")
Genotype plus genotype-by-environment (GGE) biplot analysis of a multi-environment trial (Yan et al., 2000). Gives the genotype and environment scores on the first two principal components, the winning genotype in each environment and the resulting mega-environments (which-won-where), and the average-environment coordination (AEC) ranking of genotypes for mean performance and stability.
gge_biplot( data, genotype, environment, trait, scaling = c("none", "sd"), svp = c("symmetric", "genotype", "environment"), verbose = TRUE )gge_biplot( data, genotype, environment, trait, scaling = c("none", "sd"), svp = c("symmetric", "genotype", "environment"), verbose = TRUE )
data |
Data frame with genotype, environment and trait columns (plot data or genotype x environment means). |
genotype |
Name of the genotype column. |
environment |
Name of the environment column. |
trait |
Name of the trait column. |
scaling |
|
svp |
Singular value partitioning: |
verbose |
Logical. If TRUE (default), prints a summary. |
The genotype x environment table of means is centred on the environment
means (and optionally scaled) and decomposed by singular value
decomposition. With singular values , genotype scores are
and environment scores , with
for symmetric, genotype- and environment-focused
partitioning. The winner in an environment is the genotype with the
highest value predicted by the two-component biplot; environments with
the same winner form a mega-environment. On the AEC view the abscissa
(projection on the average-environment axis) ranks mean performance
and the ordinate (distance from that axis) measures instability.
An object of class aridagri_gge with
genotype_scores, environment_scores,
variance_percent, which_won_where (environment and
winner), mega_environments, aec (genotype AEC abscissa,
ordinate and ranks) and the settings used. Plot it with
plot().
Yan, W., Hunt, L.A., Sheng, Q. and Szlavnics, Z. (2000). Cultivar evaluation and mega-environment investigation based on the GGE biplot. Crop Science, 40(3), 597-605. doi:10.2135/cropsci2000.403597x
Yan, W. and Kang, M.S. (2003). GGE Biplot Analysis: A Graphical Tool for Breeders, Geneticists, and Agronomists. CRC Press, Boca Raton.
data(pearlmillet_met) gg <- gge_biplot(pearlmillet_met, "genotype", "environment", "grain_yield") gg$which_won_where if (requireNamespace("ggplot2", quietly = TRUE)) { plot(gg, type = "which_won_where") }data(pearlmillet_met) gg <- gge_biplot(pearlmillet_met, "genotype", "environment", "grain_yield") gg$which_won_where if (requireNamespace("ggplot2", quietly = TRUE)) { plot(gg, type = "which_won_where") }
Harvest index and grain-to-straw ratio.
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, in the same unit. |
verbose |
Logical. If TRUE (default), prints the table. |
A data frame of class aridagri_hi with grain, straw and
total biomass, HI_percent and Grain_Straw_Ratio.
Lalit Kumar Rolaniya, Ram Lal Jat, Monika Punia, Raja Ram Choudhary, Hemant Poonia
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))
Simulated randomized complete block experiment on moth bean (Vigna aconitifolia) with eight nutrient management treatments in four blocks and eight traits.
mothbean_rbdmothbean_rbd
A data frame with 32 rows and 10 variables:
Factor, block (R1-R4).
Factor, eight treatments (control, recommended dose of fertilizer (RDF), and RDF with biofertilizers, FYM, sulphur or zinc).
Seed yield (kg/ha).
Plant height at harvest (cm).
Branches per plant.
Pods per plant.
Seeds per pod.
1000-seed weight (g).
Stover yield (kg/ha).
Harvest index (%).
Simulated with data-raw/make_datasets.R (seed 2026).
Not real experimental data.
data(mothbean_rbd) anova_rbd(mothbean_rbd, "seed_yield", "treatment", "block")data(mothbean_rbd) anova_rbd(mothbean_rbd, "seed_yield", "treatment", "block")
Simulated repeated measurements of leaf chlorophyll (SPAD) on the same plots at 25, 35, 45 and 55 days after sowing, for four foliar spray treatments in four randomized complete blocks. Errors within a plot follow a first-order autoregressive process.
mungbean_repeatedmungbean_repeated
A data frame with 64 rows and 5 variables:
Factor, block (R1-R4).
Factor, foliar spray treatment.
Days after sowing (25, 35, 45, 55).
Factor, plot identifier (block-treatment).
SPAD chlorophyll meter reading.
Simulated with data-raw/make_datasets.R (seed 2026).
Not real experimental data.
data(mungbean_repeated) anova_repeated(mungbean_repeated, "spad", "treatment", "das", block = "block")data(mungbean_repeated) anova_repeated(mungbean_repeated, "spad", "treatment", "das", block = "block")
Agronomic efficiency (AE), partial factor productivity (PFP), apparent recovery efficiency (ARE), physiological efficiency (PE), internal utilization efficiency (IE) and, when biomass is given, the biomass-based physiological efficiency and utilization efficiency of Fageria and Baligar (2005). All arguments may be vectors (one value per treatment).
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 |
Grain yield with the nutrient (kg/ha). |
yield_control |
Grain yield of the control without the nutrient (kg/ha). |
nutrient_applied |
Nutrient applied (kg/ha), greater than 0. |
nutrient_uptake_fert |
Total nutrient uptake with the nutrient (kg/ha), optional. |
nutrient_uptake_ctrl |
Total nutrient uptake of the control (kg/ha), optional. |
biomass_fert |
Total biomass with the nutrient (kg/ha), optional. |
biomass_ctrl |
Total biomass of the control (kg/ha), optional. |
verbose |
Logical. If TRUE (default), prints the table. |
AE = (Yf - Yc) / N (kg grain per kg nutrient)
PFP = Yf / N
ARE = 100 (Uf - Uc) / N (percent)
PE = (Yf - Yc) / (Uf - Uc) (kg grain per kg nutrient taken up; called agro-physiological efficiency by Fageria and Baligar)
IE = Yf / Uf
PE_biomass = (Bf - Bc) / (Uf - Uc) and UE = PE_biomass x ARE / 100 (Fageria and Baligar, 2005)
AE = PE x ARE / 100 holds by definition. PE is not computed when the uptake difference is zero or negative.
A data frame of class aridagri_nue.
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
Dobermann, A. (2005). Nitrogen use efficiency - state of the art. IFA International Workshop on Enhanced-Efficiency Fertilizers, Frankfurt.
Fageria, N.K. and Baligar, V.C. (2005). Enhancing nitrogen use efficiency in crop plants. Advances in Agronomy, 88, 97-185. doi:10.1016/S0065-2113(05)88004-6
nue_calculate(yield_fertilized = 1850, yield_control = 1200, nutrient_applied = 40) # Several N doses with uptake and biomass nue_calculate(yield_fertilized = c(1450, 1720, 1850), yield_control = 1200, nutrient_applied = c(20, 40, 60), nutrient_uptake_fert = c(48, 61, 68), nutrient_uptake_ctrl = 35, biomass_fert = c(4300, 4950, 5300), biomass_ctrl = 3600)nue_calculate(yield_fertilized = 1850, yield_control = 1200, nutrient_applied = 40) # Several N doses with uptake and biomass nue_calculate(yield_fertilized = c(1450, 1720, 1850), yield_control = 1200, nutrient_applied = c(20, 40, 60), nutrient_uptake_fert = c(48, 61, 68), nutrient_uptake_ctrl = 35, biomass_fert = c(4300, 4950, 5300), biomass_ctrl = 3600)
Fits nutrient response models and finds the dose for maximum yield and
the economic optimum dose, where the marginal return equals the price
ratio. Quadratic, linear-plateau, quadratic-plateau and Mitscherlich
models are available; model = "all" fits all four and compares
them.
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 yields (kg/ha), one per dose (replicated doses are allowed). |
model |
|
price_output |
Price of the produce (Rs/kg). |
price_nutrient |
Price of the nutrient (Rs/kg of nutrient). |
verbose |
Logical. If TRUE (default), prints the results. |
Quadratic: ; maximum at ;
economic optimum .
Linear-plateau: ; economic optimum
at the join point when .
Quadratic-plateau: quadratic up to its vertex , then
flat.
Mitscherlich: ; economic optimum
; also the dose giving 95% of the
asymptote.
Plateau models are fitted by profile least squares over the join
point; the Mitscherlich model by nls with a self-starting model.
All four models have three parameters (the join point counts as one), so
they are compared by R-squared, adjusted R-squared, RMSE and AIC on an
equal footing (AIC differences equal those of stats::AIC()). An
optimum beyond the highest dose tested is flagged as an extrapolation.
For a single model, an object of class aridagri_response
with model, coefficients, r_squared,
adj_r_squared, rmse, aic, dose_max_yield,
max_yield, dose_economic, yield_economic and
fit. For model = "all", a list with comparison
(one row per model), models and best (lowest AIC).
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
Cerrato, M.E. and Blackmer, A.M. (1990). Comparison of models for describing corn yield response to nitrogen fertilizer. Agronomy Journal, 82(1), 138-143. doi:10.2134/agronj1990.00021962008200010030x
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) nutrient_response(dose, yield, model = "all", 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) nutrient_response(dose, yield, model = "all", 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)
Simulated trial of ten pearl millet genotypes in six environments (three locations x two years) with three replications, for stability and GGE biplot analysis.
pearlmillet_metpearlmillet_met
A data frame with 180 rows and 5 variables:
Factor, location-year (BKN = Bikaner, JDH = Jodhpur, JSM = Jaisalmer).
Factor, replication within environment.
Factor, genotype code (PM-01 to PM-10).
Grain yield (kg/ha).
Days to maturity.
Simulated with data-raw/make_datasets.R (seed 2026).
Not real experimental data.
data(pearlmillet_met) stability_analysis(pearlmillet_met, "genotype", "environment", "rep", "grain_yield", method = "eberhart")data(pearlmillet_met) stability_analysis(pearlmillet_met, "genotype", "environment", "rep", "grain_yield", method = "eberhart")
Compares treatment means after an analysis of variance and returns compact letter displays (means sharing a letter do not differ). Fisher's LSD, Duncan's multiple range test (DMRT), Tukey's HSD, Student-Newman-Keuls, Scheffe and Bonferroni are computed inside the package, so no extra package is needed. Dunnett's test against a control uses multcomp when it is installed.
perform_posthoc( model, data, response, treatment, mse = NULL, df_error = NULL, posthoc = "lsd", alpha = 0.05, control = NULL, verbose = TRUE )perform_posthoc( model, data, response, treatment, mse = NULL, df_error = NULL, posthoc = "lsd", alpha = 0.05, control = NULL, verbose = TRUE )
model |
A fitted |
data |
Data frame used to fit the model. Kept for compatibility; the model frame is used for the calculations. |
response |
Name of the response variable (used to label output). |
treatment |
Name of the treatment factor in the model. |
mse |
Error mean square. Default |
df_error |
Error degrees of freedom matching |
posthoc |
Method(s): |
alpha |
Significance level. Default 0.05. |
control |
Control level for Dunnett's test. Default |
verbose |
Logical. If TRUE (default), prints the results. |
Means are least-squares means of the treatment factor averaged over the other factors in the model. With complete, balanced data they equal the arithmetic means. With missing plots or unequal replication every pair is tested with its own standard error of difference, so the letters stay exact (Tukey-Kramer form for the range tests).
Duncan's and the Student-Newman-Keuls tests use the studentized range
for the number of means spanned by each pair, with the protection level
for Duncan's test, and apply the closure
rule: two means are declared different only if every range of means
containing them is also significant (Duncan, 1955). The p-value reported
for a pair is the largest p-value of the ranges containing it, so it
agrees with the letters.
Least-squares means that cannot be estimated (for example a level whose
cells are all empty in a model with interactions) are left out with a
warning. Dunnett's test averages differences over interacting factors
and uses mse and df_error when they are supplied.
Letters are assigned with the insert-and-absorb algorithm of Piepho (2004), which gives a valid display for any pattern of significant pairs. The group containing the highest mean gets the letter "a".
A list with one element per method. Each element contains
groups (means and letters, ordered from highest to lowest, with
treatments as row names), table (level, mean, SE, letter,
replications), comparisons (all pairwise differences with
their SE, p-value and significance), critical_range and
statistics. The Dunnett element is a data frame of comparisons
with the control.
Duncan, D.B. (1955). Multiple range and multiple F tests. Biometrics, 11(1), 1-42. doi:10.2307/3001478
Piepho, H.-P. (2004). An algorithm for a letter-based representation of all-pairwise comparisons. Journal of Computational and Graphical Statistics, 13(2), 456-466. doi:10.1198/1061860043515
Kramer, C.Y. (1956). Extension of multiple range tests to group means with unequal numbers of replications. Biometrics, 12(3), 307-310. doi:10.2307/3001469
compare_means for summary statistics,
anova_rbd.
data(mothbean_rbd) fit <- aov(seed_yield ~ block + treatment, data = mothbean_rbd) ph <- perform_posthoc(fit, mothbean_rbd, response = "seed_yield", treatment = "treatment", posthoc = c("lsd", "duncan")) ph$duncan$groupsdata(mothbean_rbd) fit <- aov(seed_yield ~ block + treatment, data = mothbean_rbd) ph <- perform_posthoc(fit, mothbean_rbd, response = "seed_yield", treatment = "treatment", posthoc = c("lsd", "duncan")) ph$duncan$groups
Line chart of the means of every combination of two factors, with the
first factor on the x-axis and one line per level of the second factor.
Works with anova_factorial, anova_spd and
the other split-plot functions (first two factors, or the two named in
factors), anova_strip and
anova_repeated (time course).
plot_interaction(x, factors = NULL, title = NULL, ylab = NULL)plot_interaction(x, factors = NULL, title = NULL, ylab = NULL)
x |
A result object. |
factors |
Optional character vector of two factor names (split-plot results with more than two factors). |
title |
Plot title. |
ylab |
Y-axis label. |
A ggplot2 object.
if (requireNamespace("ggplot2", quietly = TRUE)) { data(clusterbean_spd) res <- anova_spd(clusterbean_spd, "seed_yield", "irrigation", "nitrogen", "rep", verbose = FALSE) plot_interaction(res, ylab = "Seed yield (kg/ha)") }if (requireNamespace("ggplot2", quietly = TRUE)) { data(clusterbean_spd) res <- anova_spd(clusterbean_spd, "seed_yield", "irrigation", "nitrogen", "rep", verbose = FALSE) plot_interaction(res, ylab = "Seed yield (kg/ha)") }
Publication-ready bar chart of treatment means with standard-error bars
and the letter groupings from an aridagri analysis. Works with the
results of anova_crd, anova_rbd,
anova_latin, anova_rbd_pooled,
anova_factorial (one factor or the combinations),
anova_spd and the other split-plot functions (one factor),
anova_alpha_lattice and anova_augmented
(adjusted means).
plot_means( x, which = NULL, sort = TRUE, top = 20, title = NULL, ylab = NULL, horizontal = NULL )plot_means( x, which = NULL, sort = TRUE, top = 20, title = NULL, ylab = NULL, horizontal = NULL )
x |
A result object from one of the functions above. |
which |
For factorial and split-plot results, the factor to plot
(name), or |
sort |
Logical. Order bars from highest to lowest mean. Default TRUE. |
top |
For alpha lattice and augmented results, the number of entries to show. Default 20. |
title |
Plot title. Default: the response name. |
ylab |
Y-axis label. Default: the response name. |
horizontal |
Logical. Draw horizontal bars. Default |
A ggplot2 object.
if (requireNamespace("ggplot2", quietly = TRUE)) { data(mothbean_rbd) res <- anova_rbd(mothbean_rbd, "seed_yield", "treatment", "block", posthoc = "duncan", verbose = FALSE) plot_means(res, ylab = "Seed yield (kg/ha)") }if (requireNamespace("ggplot2", quietly = TRUE)) { data(mothbean_rbd) res <- anova_rbd(mothbean_rbd, "seed_yield", "treatment", "block", posthoc = "duncan", verbose = FALSE) plot_means(res, ylab = "Seed yield (kg/ha)") }
Observed yields and the fitted response curve(s) from
nutrient_response, with the economic optimum dose marked.
plot_response(x, dose, yield, title = NULL)plot_response(x, dose, yield, title = NULL)
x |
An object of class |
dose, yield
|
The data used to fit the model. |
title |
Plot title. |
A ggplot2 object.
if (requireNamespace("ggplot2", quietly = TRUE)) { dose <- c(0, 20, 40, 60, 80, 100) yield <- c(1100, 1350, 1520, 1610, 1650, 1660) nr <- nutrient_response(dose, yield, model = "all", verbose = FALSE) plot_response(nr, dose, yield) }if (requireNamespace("ggplot2", quietly = TRUE)) { dose <- c(0, 20, 40, 60, 80, 100) yield <- c(1100, 1350, 1520, 1610, 1650, 1660) nr <- nutrient_response(dose, yield, model = "all", verbose = FALSE) plot_response(nr, dose, yield) }
Figures for stability_analysis results:
"eberhart": genotype mean against the regression
coefficient , with reference lines at the grand mean and
.
"ammi1": AMMI1 biplot of mean against IPCA1 scores for
genotypes and environments.
"ammi2": AMMI2 biplot of IPCA1 against IPCA2, with
environments as vectors.
plot_stability(x, type = c("eberhart", "ammi1", "ammi2"), title = NULL)plot_stability(x, type = c("eberhart", "ammi1", "ammi2"), title = NULL)
x |
An object of class |
type |
|
title |
Plot title. |
A ggplot2 object.
if (requireNamespace("ggplot2", quietly = TRUE)) { data(pearlmillet_met) st <- stability_analysis(pearlmillet_met, "genotype", "environment", "rep", "grain_yield", verbose = FALSE) plot_stability(st, "eberhart") plot_stability(st, "ammi2") }if (requireNamespace("ggplot2", quietly = TRUE)) { data(pearlmillet_met) st <- stability_analysis(pearlmillet_met, "genotype", "environment", "rep", "grain_yield", verbose = FALSE) plot_stability(st, "eberhart") plot_stability(st, "ammi2") }
plot() methods that draw the standard publication figure for each
kind of result with ggplot2: a bar chart of means with letters
(CRD, RCBD, Latin square, pooled RCBD, alpha lattice, augmented), an
interaction plot or bar chart (factorial and split-plot designs), a
time course (repeated measures) or a stability plot. For base graphics
without ggplot2, use arid_plot.
## S3 method for class 'aridagri_anova' plot(x, ...) ## S3 method for class 'aridagri_pooled' plot(x, ...) ## S3 method for class 'aridagri_alpha' plot(x, ...) ## S3 method for class 'aridagri_augmented' plot(x, ...) ## S3 method for class 'aridagri_factorial' plot(x, type = c("interaction", "means"), ...) ## S3 method for class 'aridagri_split' plot(x, type = c("interaction", "means"), ...) ## S3 method for class 'aridagri_strip' plot(x, ...) ## S3 method for class 'aridagri_repeated' plot(x, ...) ## S3 method for class 'aridagri_stability' plot(x, type = c("eberhart", "ammi1", "ammi2"), ...)## S3 method for class 'aridagri_anova' plot(x, ...) ## S3 method for class 'aridagri_pooled' plot(x, ...) ## S3 method for class 'aridagri_alpha' plot(x, ...) ## S3 method for class 'aridagri_augmented' plot(x, ...) ## S3 method for class 'aridagri_factorial' plot(x, type = c("interaction", "means"), ...) ## S3 method for class 'aridagri_split' plot(x, type = c("interaction", "means"), ...) ## S3 method for class 'aridagri_strip' plot(x, ...) ## S3 method for class 'aridagri_repeated' plot(x, ...) ## S3 method for class 'aridagri_stability' plot(x, type = c("eberhart", "ammi1", "ammi2"), ...)
x |
A result object. |
... |
Passed to |
type |
For factorial and split-plot results: |
A ggplot2 object.
if (requireNamespace("ggplot2", quietly = TRUE)) { data(mothbean_rbd) res <- anova_rbd(mothbean_rbd, "seed_yield", "treatment", "block", verbose = FALSE) plot(res) }if (requireNamespace("ggplot2", quietly = TRUE)) { data(mothbean_rbd) res <- anova_rbd(mothbean_rbd, "seed_yield", "treatment", "block", verbose = FALSE) plot(res) }
Plot Method for GGE Biplot Results
## S3 method for class 'aridagri_gge' plot( x, type = c("which_won_where", "mean_stability", "basic"), title = NULL, ... )## S3 method for class 'aridagri_gge' plot( x, type = c("which_won_where", "mean_stability", "basic"), title = NULL, ... )
x |
An object of class |
type |
|
title |
Plot title. |
... |
Unused. |
A ggplot2 object.
Print Method for Alpha Lattice Results
## S3 method for class 'aridagri_alpha' print(x, digits = 2, n = 15, ...)## S3 method for class 'aridagri_alpha' print(x, digits = 2, n = 15, ...)
x |
An object of class |
digits |
Number of decimal places for means. Default 2. |
n |
Number of genotypes to show. Default 15. |
... |
Unused. |
Invisibly returns x.
Print Method for CRD and RCBD Results
## S3 method for class 'aridagri_anova' print(x, digits = 2, ...) ## S3 method for class 'aridagri_latin' print(x, digits = 2, ...)## S3 method for class 'aridagri_anova' print(x, digits = 2, ...) ## S3 method for class 'aridagri_latin' print(x, digits = 2, ...)
x |
An object of class |
digits |
Number of decimal places for means. Default 2. |
... |
Unused. |
Invisibly returns x. Called for its side effect of
printing the ANOVA report.
Print Method for Augmented Design Results
## S3 method for class 'aridagri_augmented' print(x, digits = 2, n = 10, ...)## S3 method for class 'aridagri_augmented' print(x, digits = 2, n = 10, ...)
x |
An object of class |
digits |
Number of decimal places for means. Default 2. |
n |
Number of top test entries to show. Default 10. |
... |
Unused. |
Invisibly returns x.
Print Methods for Factorial Results
## S3 method for class 'aridagri_factorial' print(x, digits = 2, ...) ## S3 method for class 'aridagri_factorial3' print(x, digits = 2, ...)## S3 method for class 'aridagri_factorial' print(x, digits = 2, ...) ## S3 method for class 'aridagri_factorial3' print(x, digits = 2, ...)
x |
An object of class |
digits |
Number of decimal places for means. Default 2. |
... |
Unused. |
Invisibly returns x.
Print Method for GGE Biplot Results
## S3 method for class 'aridagri_gge' print(x, ...)## S3 method for class 'aridagri_gge' print(x, ...)
x |
An object of class |
... |
Unused. |
Invisibly returns x.
Prints the number of components retained and the variance they explain.
## S3 method for class 'aridagri_pca' print(x, ...)## S3 method for class 'aridagri_pca' print(x, ...)
x |
An object of class |
... |
Additional arguments (unused). |
The input object, invisibly.
Print Method for Combined RCBD Analysis
## S3 method for class 'aridagri_pooled' print(x, digits = 2, ...)## S3 method for class 'aridagri_pooled' print(x, digits = 2, ...)
x |
An object of class |
digits |
Number of decimal places for means. Default 2. |
... |
Unused. |
Invisibly returns x.
Print Method for Repeated Measures Results
## S3 method for class 'aridagri_repeated' print(x, digits = 2, ...)## S3 method for class 'aridagri_repeated' print(x, digits = 2, ...)
x |
An object of class |
digits |
Number of decimal places for means. Default 2. |
... |
Unused. |
Invisibly returns x.
Print Methods for Nutrient Response Results
## S3 method for class 'aridagri_response' print(x, ...) ## S3 method for class 'aridagri_response_set' print(x, ...)## S3 method for class 'aridagri_response' print(x, ...) ## S3 method for class 'aridagri_response_set' print(x, ...)
x |
An object of class |
... |
Unused. |
Invisibly returns x.
Print Method for Stability Analysis
## S3 method for class 'aridagri_stability' print(x, digits = 3, ...)## S3 method for class 'aridagri_stability' print(x, digits = 3, ...)
x |
An object of class |
digits |
Number of decimal places. Default 3. |
... |
Unused. |
Invisibly returns x.
Print Method for Split-Plot Family Results
## S3 method for class 'aridagri_strip' print(x, digits = 2, ...) ## S3 method for class 'aridagri_split' print(x, digits = 2, ...) ## S3 method for class 'aridagri_split_pooled' print(x, digits = 2, ...)## S3 method for class 'aridagri_strip' print(x, digits = 2, ...) ## S3 method for class 'aridagri_split' print(x, digits = 2, ...) ## S3 method for class 'aridagri_split_pooled' print(x, digits = 2, ...)
x |
A result from |
digits |
Number of decimal places for means. Default 2. |
... |
Unused. |
Invisibly returns x.
Print Method for Multi-Trait Tables
## S3 method for class 'aridagri_traits' print(x, ...)## S3 method for class 'aridagri_traits' print(x, ...)
x |
An object of class |
... |
Unused. |
Invisibly returns x.
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) }
Stability analysis of genotypes (or treatments) tested in several environments, with the combined ANOVA and seven established methods:
Eberhart and Russell (1966) joint regression: ,
, tests of and , and
the Eberhart-Russell ANOVA
AMMI: ANOVA with Gollob's degrees of freedom for each IPCA, IPCA scores, AMMI stability value (ASV) and yield stability index
Finlay and Wilkinson (1963) regression on the environment mean
Shukla (1972) stability variance with its F-test
Wricke (1962) ecovalence
Coefficient of variation (Francis and Kannenberg, 1978)
Cultivar superiority index (Lin and Binns, 1988)
An integrated ranking averages the stability ranks of the seven methods.
stability_analysis( data, genotype, environment, replication, trait, method = "all", verbose = TRUE, alpha = 0.05, fw_log = FALSE )stability_analysis( data, genotype, environment, replication, trait, method = "all", verbose = TRUE, alpha = 0.05, fw_log = FALSE )
data |
Data frame with genotype, environment, replication and trait
columns (one row per plot). Genotype x environment means (one row per
combination) can be used with |
genotype |
Name of the genotype (or treatment) column. |
environment |
Name of the environment (location, year or season) column. |
replication |
Name of the replication column, or |
trait |
Name of the trait (response) column. |
method |
|
verbose |
Logical. If TRUE (default), prints the report. |
alpha |
Significance level for the tests. Default 0.05. |
fw_log |
Logical. If TRUE, the Finlay-Wilkinson regression uses
log10-transformed means as in the original paper. Default FALSE (on
the original scale, where the slope equals the Eberhart-Russell
|
Calculations use the genotype x environment table of means
( genotypes, environments, replications). The
environmental index is .
Eberhart-Russell. ;
, where
are deviations from the regression and MSE is the
pooled error. is tested with
on df, and
with .
Shukla. , where is Wricke's ecovalence
;
tested with on and the error
df. Values are on the scale of the means.
AMMI. The interaction matrix is decomposed by singular value
decomposition. IPCA has sum of squares and
df (Gollob, 1968). Scores are
. ASV = (Purchase et al., 2000) and the yield stability
index is the sum of the ranks of mean (high = 1) and ASV.
Lin-Binns. , with
the highest mean in environment .
An object of class aridagri_stability containing
anova (combined ANOVA, when replications are given),
genotype_means, environment_means, ge_matrix
and, depending on method, eberhart (with
eberhart_anova), ammi (anova, components,
stability, genotype_scores, environment_scores),
finlay, shukla, wricke, cv_stability,
superiority, integrated and concordance
(Kendall's W among the seven stability rankings).
Lalit Kumar Rolaniya, Ram Lal Jat, Monika Punia, Raja Ram Choudhary, Hemant Poonia
Eberhart, S.A. and Russell, W.A. (1966). Stability parameters for comparing varieties. Crop Science, 6(1), 36-40. doi:10.2135/cropsci1966.0011183X000600010011x
Finlay, K.W. and Wilkinson, G.N. (1963). The analysis of adaptation in a plant-breeding programme. Australian Journal of Agricultural Research, 14(6), 742-754. doi:10.1071/AR9630742
Shukla, G.K. (1972). Some statistical aspects of partitioning genotype-environmental components of variability. Heredity, 29(2), 237-245. doi:10.1038/hdy.1972.87
Wricke, G. (1962). Uber eine Methode zur Erfassung der okologischen Streubreite in Feldversuchen. Zeitschrift fur Pflanzenzuchtung, 47, 92-96.
Gollob, H.F. (1968). A statistical model which combines features of factor analytic and analysis of variance techniques. Psychometrika, 33(1), 73-115. doi:10.1007/BF02289676
Purchase, J.L., Hatting, H. and van Deventer, C.S. (2000). Genotype x environment interaction of winter wheat (Triticum aestivum L.) in South Africa: II. Stability analysis of yield performance. South African Journal of Plant and Soil, 17(3), 101-107. doi:10.1080/02571862.2000.10634878
Francis, T.R. and Kannenberg, L.W. (1978). Yield stability studies in short-season maize. I. A descriptive method for grouping genotypes. Canadian Journal of Plant Science, 58(4), 1029-1034. doi:10.4141/cjps78-157
Lin, C.S. and Binns, M.R. (1988). A superiority measure of cultivar performance for cultivar x location data. Canadian Journal of Plant Science, 68(1), 193-198. doi:10.4141/cjps88-018
data(pearlmillet_met) st <- stability_analysis(pearlmillet_met, genotype = "genotype", environment = "environment", replication = "rep", trait = "grain_yield") st$eberhart st$ammi$anovadata(pearlmillet_met) st <- stability_analysis(pearlmillet_met, genotype = "genotype", environment = "environment", replication = "rep", trait = "grain_yield") st$eberhart st$ammi$anova
The theme used by the plotting functions of aridagri: white background, light grid, dark text and a bold left-aligned title. Add it to any ggplot2 figure.
theme_aridagri(base_size = 11)theme_aridagri(base_size = 11)
base_size |
Base font size in points. Default 11. |
A ggplot2 theme object.
if (requireNamespace("ggplot2", quietly = TRUE)) { ggplot2::ggplot(mtcars, ggplot2::aes(wt, mpg)) + ggplot2::geom_point() + theme_aridagri() }if (requireNamespace("ggplot2", quietly = TRUE)) { ggplot2::ggplot(mtcars, ggplot2::aes(wt, mpg)) + ggplot2::geom_point() + theme_aridagri() }
Growing degree days (GDD), helio-thermal units (HTU), photo-thermal units (PTU), heat use efficiency (HUE) and helio-thermal use efficiency from daily temperatures.
thermal_indices( tmax, tmin, base_temp = 10, sunshine_hours = NULL, day_length = NULL, crop_yield = NULL, biomass = NULL, verbose = TRUE, upper_temp = NULL, method = c("average", "modified") )thermal_indices( tmax, tmin, base_temp = 10, sunshine_hours = NULL, day_length = NULL, crop_yield = NULL, biomass = NULL, verbose = TRUE, upper_temp = NULL, method = c("average", "modified") )
tmax |
Daily maximum temperature (degrees C). |
tmin |
Daily minimum temperature (degrees C). |
base_temp |
Base temperature (degrees C). Default 10. |
sunshine_hours |
Daily bright sunshine hours (optional, for HTU). |
day_length |
Daily day length in hours (optional, for PTU); see
|
crop_yield |
Economic yield (kg/ha) for HUE (optional). |
biomass |
Total biomass (kg/ha) for HUE (optional). |
verbose |
Logical. If TRUE (default), prints the results. |
upper_temp |
Optional upper threshold temperature (degrees C) above which development does not increase. |
method |
|
HTU = sum of GDD x bright sunshine hours; PTU = sum of GDD x day length (Rajput, 1980). HUE = yield / GDD (kg/ha per degree-day); HTUE = yield / HTU.
An object of class aridagri_thermal: a list with
summary (index, value, unit), gdd_total and
daily (daily and cumulative GDD, HTU and PTU).
Lalit Kumar Rolaniya, Ram Lal Jat, Monika Punia, Raja Ram Choudhary, Hemant Poonia
McMaster, G.S. and Wilhelm, W.W. (1997). Growing degree-days: one equation, two interpretations. Agricultural and Forest Meteorology, 87(4), 291-300. doi:10.1016/S0168-1923(97)00027-0
Rajput, R.P. (1980). Response of soybean crop to climatic and soil environments. PhD thesis, IARI, New Delhi.
tmax <- c(31, 33, 35, 36, 38, 40, 41, 39, 37, 36) tmin <- c(16, 17, 19, 20, 22, 24, 25, 24, 22, 21) thermal_indices(tmax, tmin, base_temp = 10, upper_temp = 40, sunshine_hours = rep(9.5, 10), day_length = day_length(28, 70:79), crop_yield = 1250)tmax <- c(31, 33, 35, 36, 38, 40, 41, 39, 37, 36) tmin <- c(16, 17, 19, 20, 22, 24, 25, 24, 22, 21) thermal_indices(tmax, tmin, base_temp = 10, upper_temp = 40, sunshine_hours = rep(9.5, 10), day_length = day_length(28, 70:79), crop_yield = 1250)
Yield gap between actual and potential yields. When an attainable yield (for example the yield of an improved-practice or front-line demonstration plot) is supplied, the gap is split into a technology gap and an extension gap and the technology index is given.
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 (farmers' practice) yield. |
potential_yield |
Potential yield of the crop or variety. |
attainable_yield |
Attainable or demonstration yield (optional). |
verbose |
Logical. If TRUE (default), prints the table. |
Total gap = potential - actual; yield efficiency = 100 x actual / potential. With attainable yield (Samui et al., 2000): technology gap = potential - attainable; extension gap = attainable - actual; technology index = 100 x technology gap / potential; yield increase over farmers' practice = 100 x (attainable - actual) / actual.
A data frame of class aridagri_yield_gap.
Lalit Kumar Rolaniya, Ram Lal Jat, Monika Punia, Raja Ram Choudhary, Hemant Poonia
Samui, S.K., Maitra, S., Roy, D.K., Mondal, A.K. and Saha, D. (2000). Evaluation of front line demonstration on groundnut (Arachis hypogaea L.). Journal of the Indian Society of Coastal Agricultural Research, 18(2), 180-183.
yield_gap_analysis(actual_yield = c(800, 950, 720), potential_yield = 1500) # Front-line demonstrations: farmers' practice vs demonstration plots yield_gap_analysis(actual_yield = c(820, 760, 905), potential_yield = 1500, attainable_yield = c(1080, 1010, 1150))yield_gap_analysis(actual_yield = c(800, 950, 720), potential_yield = 1500) # Front-line demonstrations: farmers' practice vs demonstration plots yield_gap_analysis(actual_yield = c(820, 760, 905), potential_yield = 1500, attainable_yield = c(1080, 1010, 1150))