Skip to contents

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.

Usage

anova_crd(
  data,
  response,
  treatment,
  posthoc = "lsd",
  alpha = 0.05,
  verbose = TRUE,
  control = NULL
)

Arguments

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): "lsd", "duncan", "tukey", "snk", "scheffe", "bonferroni", "dunnett", a vector of these, "all" or "none". The first method supplies the letters in the means table.

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).

Value

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.

Details

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.

References

Gomez, K.A. and Gomez, A.A. (1984). Statistical Procedures for Agricultural Research, 2nd ed. John Wiley and Sons, New York.

Author

Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner

Examples

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")
#> 
#> ======================================================================
#>  COMPLETELY RANDOMIZED DESIGN (CRD)
#> ======================================================================
#>  Response     : yield
#>  Treatment    : treatment
#>  Treatments   : 4
#>  Observations : 20
#> 
#>  Analysis of variance
#>     Source Df    Sum Sq   Mean Sq F value Pr(>F)    
#>  Treatment  3 340702.15 113567.38 301.300 0.0000 ***
#>  Error     16   6030.80    376.92                   
#>  Total     19 346732.95                             
#>  Signif. codes: *** p < 0.001, ** p < 0.01, * p < 0.05, NS not significant
#> 
#>  Grand mean = 1280.550   CV (%) = 1.516   SEm = 8.682   SEd = 12.279   CD (5%) = 26.030
#> 
#>  Treatment means (Duncan's MRT, alpha = 0.05)
#>  Treatment    Mean     SD N    SE Group
#>         T4 1452.00 15.764 5 8.682     a
#>         T2 1349.00 21.726 5 8.682     b
#>         T1 1212.00 22.349 5 8.682     c
#>         T3 1109.20 16.962 5 8.682     d
#>  Means sharing a letter do not differ significantly.
res$treatment_means
#>   Treatment   Mean       SD N       SE Group
#> 1        T4 1452.0 15.76388 5 8.682454     a
#> 2        T2 1349.0 21.72556 5 8.682454     b
#> 3        T1 1212.0 22.34950 5 8.682454     c
#> 4        T3 1109.2 16.96172 5 8.682454     d