Analysis of covariance for retrospective bias control in agricultural research: an application using R

Authors

DOI:

https://doi.org/10.15517/n6pcpy68

Keywords:

Statistical models, Data analysis, Biostatistics, Analysis of variance, Statistical analysis

Abstract

This work was developed within the framework of the Experimental Design II course in the Agronomy program at the University of Costa Rica in 2023, aiming to explain the analysis of covariance (ANCOVA) as a data analysis method using the R programming language. A database describing an experiment under a completely randomized block design (CRBD) was employed, where the number of plants per experimental unit was measured to control its potential effect on the yield of six corn varieties. Four models were fitted: the model_rl to assess viability, the model_hp to assess the homogeneity of slopes, and two additional models, the model_scov without the covariate effect, and the model_cov with the covariate. For the evaluation of these last two models, penalized information criteria [Akaike information criterion (AIC), Bayesian information criterion (BIC)] and hypothesis testing based on the likelihood ratio test (LRT) were utilized. The model_cov exhibited a better fit than the model_scov; the inclusion of the covariate reduced residual error, resulting in greater precision in estimates and enabling an unbiased comparison of means. ANCOVA is a strategy to consider secondary sources of variation that are difficult to control but, due to their quantitative nature, are measurable.

Downloads

Download data is not yet available.

Author Biographies

  • Jorge Claudio Vargas Rojas, Universidad de Costa Rica

    Máster en Estadística Aplicada

  • Meilyn González Calero, Universidad de Costa Rica

    Ingeniera Agrónoma

  • Marileny Piña Duarte, Universidad de Costa Rica

    Ingeniera Agrónoma

References

Balzarini, M., Rienzo, J. Di, Tablada, M., Gonzalez, L., Bruno, C., Córdoba, M., Robledo, W., & Casanoves, F. (2015). Estadística y biometría: ilustraciones del uso de InfoStat en problemas de agronomía (2nd ed.). Editorial Brujas.

Barraza, F., Arancibia, M., Madrid, E., Papuzinski, C. (2019). General concepts in biostatistics and clinical epidemiology: random error and systematic error. Medwave, 19(7), Article e7687. https://doi.org/10.5867/medwave.2019.07.7687

Barrientos García, M. (1981). Evaluación de 4 métodos para la determinación de tamaño y forma óptimos de parcela para experimentación agrícola [Tesis de licenciatura, Universidad de San Carlos de Guatemala]. Repositorio Centroamericano SIIDCA-CSUCA. https://catalogosiidca.csuca.org/Record/USAC.91383

Correa Londoño, G. (2013). El análisis de covarianza como mecanismo de control de factores de confusión. Revista Facultad Nacional de Agronomía-Medellín, 66(1), 6981–6985. https://revistas.unal.edu.co/index.php/refame/article/view/39539

Egbewale, B. E., Lewis, M., & Sim, J. (2014). Bias, precision and statistical power of analysis of covariance in the analysis of randomized trials with baseline imbalance: a simulation study. BMC Medical Research Methodology, 14, Article 49. https://doi.org/10.1186/1471-2288-14-49

Gavilánez Luna, F. (2021). Diseños y análisis estadísticos para experimentos agrícolas. Ediciones Diaz de Santos S.A.

Gomez, K., & Gomez, A. (1984). Statistical Procedures for Agricultural Research (2nd ed.). Wiley.

Gomez, K. A. (1972). Techniques for field experiments with rice. Rice Research Institute.

Gómez, S., Torres, V., García, Y., Herrera, M., Medina, Y., & Rodríguez, R. (2019). Procedimiento estadístico para el análisis de experimentos con medidas repetidas en el tiempo en la esfera agropecuaria. Cuban Journal of Agricultural Science, 53(4), 353-360. http://scielo.sld.cu/scielo.php?script=sci_arttext&pid=S2079-34802019000400353&lng=es&tlng=es.

Huitema, B. E. (2020). Analysis of covariance (ANCOVA). Oxford Bibliographies https://doi.org/10.1093/obo/9780199828340-0256

Johnson, T. R. (2016). Violation of the homogeneity of regression slopes assumption in ANCOVA for two-group pre-post designs: tutorial on a modified Johnson-Neyman procedure. The Quantitative Methods for Psychology, 12(3), 253–263. https://doi.org/10.20982/tqmp.12.3.p253

Kahan, B. C., Rushton, H., Morris, T. P., & Daniel, R. M. (2016). A comparison of methods to adjust for continuous covariates in the analysis of randomized trials. BMC Medical Research Methodology, 16, Article 42. https://doi.org/10.1186/s12874-016-0141-3

Montgomery, D. C. (2020). Design and analysis of experiments (10th ed.). John Wiley & Sons.

Littell, R., Milliken, G., Stroup, W., Wolfinger, R., & Schabenberger, O. (2006). SAS for Mixed Models (2nd ed.). SAS Institute Inc.

Navarro Flores, J. R., & Vargas Rojas, J. C. (2015). Eficiencia relativa del diseño de bloques completos al azar para ensayos de arroz en Bagaces, Guanacaste, Costa Rica. Inter.Sedes, 16(32), 61-70. https://www.scielo.sa.cr/scielo.php?script=sci_arttext&pid=S2215-24582015000200061

Pérez-Rodríguez, M., Palacios-Cruz, L., Moreno, J., Rivas-Ruiz, R., & Talavera, J. O. (2014). Temas de actualidad Investigación clínica XIX del juicio clínico al análisis de covarianza. Revista Médica del Instituto Mexicano del Seguro Social, 52(1), 70-75. https://www.medigraphic.com/cgi-bin/new/resumen.cgi?IDARTICULO=47612

Peter, C. (2020). Analysis of Covariance. The International Encyclopedia of Communication Research Methods. https://doi.org/10.1002/9781118901731.iecrm0005

Pinheiro, J., Bates, D., DebRoy, S., Sarkar, D., & R Core Team. (2023). nlme: Linear and Nonlinear Mixed Effects Models. https://CRAN.R-project.org/package=nlme

RCore Team. (2023). R: A language and environment for statistical computing. R Foundation for Statistical Computing. http://www.r-project.org.

Shieh G. (2017). On tests of treatment-covariate interactions: an illustration of appropriate power and sample size calculations. PLOS ONE, 12(5), Article e0177682. https://doi.org/10.1371/journal.pone.0177682

Snedecor, G., & Cochran, W. (1998). Statistical methods (8th ed.). Iowa State University Press.

Stroup, W. W. (2002). Power analysis based on spatial effects mixed models: a tool for comparing design and analysis strategies in the presence of spatial variability. Journal of Agricultural, Biological, and Environmental Statistics, 7(4), 491-511. https://doi.org/10.1198/108571102780

Stroup, W. W., Milliken, G. A., Claassen, E. A., & Wolfinger, R. D. (2018). SAS for mixed models: introduction and basic applications. SAS Institute Inc.

Van Es, H.M., Gomes, C., Sellmann, M., & Van Es, C. L. (2007). Spatially Balan

Published

05/20/2026

Issue

Section

Technical Note (Peer-Reviewed Section)

Categories