Print the anova_joint
object in two ways. By default, the results are shown
in the R console. The results can also be exported to the directory into a
*.txt file.
Usage
# S3 method for anova_joint
print(x, export = FALSE, file.name = NULL, digits = 3, ...)
Arguments
- x
An object of class
anova_joint
.- export
A logical argument. If
TRUE
, a *.txt file is exported to the working directory.- file.name
The name of the file if
export = TRUE
- digits
The significant digits to be shown.
- ...
Options used by the tibble package to format the output. See
tibble::print()
for more details.
Author
Tiago Olivoto tiagoolivoto@gmail.com
Examples
# \donttest{
library(metan)
model <- data_ge %>% anova_joint(ENV, GEN, REP, c(GY, HM))
#> variable GY
#> ---------------------------------------------------------------------------
#> Joint ANOVA table
#> ---------------------------------------------------------------------------
#> Source Df Sum Sq Mean Sq F value Pr(>F)
#> ENV 13.00 279.57 21.5057 222.41 7.25e-130
#> REP(ENV) 28.00 9.66 0.3451 3.57 3.59e-08
#> GEN 9.00 13.00 1.4439 14.93 2.19e-19
#> GEN:ENV 117.00 31.22 0.2668 2.76 1.01e-11
#> Residuals 252.00 24.37 0.0967 NA NA
#> CV(%) 11.63 NA NA NA NA
#> MSR+/MSR- 6.71 NA NA NA NA
#> OVmean 2.67 NA NA NA NA
#> ---------------------------------------------------------------------------
#>
#> variable HM
#> ---------------------------------------------------------------------------
#> Joint ANOVA table
#> ---------------------------------------------------------------------------
#> Source Df Sum Sq Mean Sq F value Pr(>F)
#> ENV 13.00 5710 439.26 154.67 5.86e-112
#> REP(ENV) 28.00 215 7.68 2.70 2.20e-05
#> GEN 9.00 270 29.98 10.56 7.41e-14
#> GEN:ENV 117.00 1101 9.41 3.31 1.06e-15
#> Residuals 252.00 716 2.84 NA NA
#> CV(%) 3.50 NA NA NA NA
#> MSR+/MSR- 5.24 NA NA NA NA
#> OVmean 48.09 NA NA NA NA
#> ---------------------------------------------------------------------------
#>
#> All variables with significant (p < 0.05) genotype-vs-environment interaction
#> Done!
print(model)
#> Variable GY
#> ---------------------------------------------------------------------------
#> $anova
#> Source Df Sum Sq Mean Sq F value Pr(>F)
#> 1 ENV 13.000000 279.573552 21.50565785 222.411390 7.253126e-130
#> 2 REP(ENV) 28.000000 9.661516 0.34505416 3.568548 3.593191e-08
#> 3 GEN 9.000000 12.995044 1.44389374 14.932741 2.190118e-19
#> 4 GEN:ENV 117.000000 31.219565 0.26683389 2.759595 1.005191e-11
#> 5 Residuals 252.000000 24.366674 0.09669315 NA NA
#> 6 CV(%) 11.627790 NA NA NA NA
#> 7 MSR+/MSR- 6.708789 NA NA NA NA
#> 8 OVmean 2.674242 NA NA NA NA
#>
#> $model
#> Call:
#> aov(formula = mean ~ GEN + ENV + GEN:ENV + ENV/REP, data = data)
#>
#> Terms:
#> GEN ENV GEN:ENV ENV:REP Residuals
#> Sum of Squares 12.99504 279.57355 31.21956 9.66152 24.36667
#> Deg. of Freedom 9 13 117 28 252
#>
#> Residual standard error: 0.3109552
#> Estimated effects may be unbalanced
#>
#> $augment
#> # A tibble: 420 × 11
#> ENV GEN REP mean hat sigma fitted resid stdres se.fit factors
#> <fct> <fct> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <chr>
#> 1 E1 G1 1 2.17 0.400 0.311 2.42 -0.255 -1.06 0.197 G1_1
#> 2 E1 G1 2 2.50 0.400 0.311 2.40 0.101 0.420 0.197 G1_2
#> 3 E1 G1 3 2.43 0.400 0.311 2.27 0.154 0.640 0.197 G1_3
#> 4 E1 G2 1 3.21 0.400 0.311 2.96 0.249 1.04 0.197 G2_1
#> 5 E1 G2 2 2.93 0.400 0.312 2.94 -0.00492 -0.0204 0.197 G2_2
#> 6 E1 G2 3 2.56 0.400 0.311 2.81 -0.244 -1.01 0.197 G2_3
#> 7 E1 G3 1 2.77 0.4 0.311 2.95 -0.176 -0.729 0.197 G3_1
#> 8 E1 G3 2 3.62 0.400 0.306 2.92 0.696 2.89 0.197 G3_2
#> 9 E1 G3 3 2.28 0.400 0.309 2.80 -0.521 -2.16 0.197 G3_3
#> 10 E1 G4 1 2.36 0.400 0.311 2.65 -0.286 -1.19 0.197 G4_1
#> # … with 410 more rows
#>
#> $details
#> # A tibble: 10 × 2
#> Parameters mean
#> <chr> <chr>
#> 1 Mean "2.67"
#> 2 SE "0.05"
#> 3 SD "0.92"
#> 4 CV "34.56"
#> 5 Min "0.67 (G10 in E11)"
#> 6 Max "5.09 (G8 in E5)"
#> 7 MinENV "E11 (1.37)"
#> 8 MaxENV "E3 (4.06)"
#> 9 MinGEN "G10 (2.47) "
#> 10 MaxGEN "G8 (3) "
#>
#> ---------------------------------------------------------------------------
#>
#>
#>
#> Variable HM
#> ---------------------------------------------------------------------------
#> $anova
#> Source Df Sum Sq Mean Sq F value Pr(>F)
#> 1 ENV 13.000000 5710.3167 439.255133 154.666159 5.864441e-112
#> 2 REP(ENV) 28.000000 214.9307 7.676095 2.702830 2.196589e-05
#> 3 GEN 9.000000 269.8112 29.979019 10.555915 7.414690e-14
#> 4 GEN:ENV 117.000000 1100.7341 9.407984 3.312646 1.063605e-15
#> 5 Residuals 252.000000 715.6853 2.840021 NA NA
#> 6 CV(%) 3.504463 NA NA NA NA
#> 7 MSR+/MSR- 5.235567 NA NA NA NA
#> 8 OVmean 48.088286 NA NA NA NA
#>
#> $model
#> Call:
#> aov(formula = mean ~ GEN + ENV + GEN:ENV + ENV/REP, data = data)
#>
#> Terms:
#> GEN ENV GEN:ENV ENV:REP Residuals
#> Sum of Squares 269.811 5710.317 1100.734 214.931 715.685
#> Deg. of Freedom 9 13 117 28 252
#>
#> Residual standard error: 1.685236
#> Estimated effects may be unbalanced
#>
#> $augment
#> # A tibble: 420 × 11
#> ENV GEN REP mean hat sigma fitted resid stdres se.fit factors
#> <fct> <fct> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <chr>
#> 1 E1 G1 1 44.9 0.400 1.68 46.5 -1.62 -1.24 1.07 G1_1
#> 2 E1 G1 2 46.9 0.400 1.69 46.0 0.942 0.721 1.07 G1_2
#> 3 E1 G1 3 47.8 0.400 1.69 47.1 0.678 0.519 1.07 G1_3
#> 4 E1 G2 1 45.2 0.400 1.69 45.4 -0.153 -0.117 1.07 G2_1
#> 5 E1 G2 2 45.3 0.400 1.69 44.8 0.538 0.412 1.07 G2_2
#> 6 E1 G2 3 45.5 0.400 1.69 45.9 -0.386 -0.295 1.07 G2_3
#> 7 E1 G3 1 46.7 0.4 1.69 45.9 0.791 0.606 1.07 G3_1
#> 8 E1 G3 2 43.2 0.400 1.68 45.3 -2.11 -1.62 1.07 G3_2
#> 9 E1 G3 3 47.8 0.400 1.69 46.4 1.32 1.01 1.07 G3_3
#> 10 E1 G4 1 47.9 0.400 1.69 48.3 -0.386 -0.296 1.07 G4_1
#> # … with 410 more rows
#>
#> $details
#> # A tibble: 10 × 2
#> Parameters mean
#> <chr> <chr>
#> 1 Mean "48.09"
#> 2 SE "0.21"
#> 3 SD "4.37"
#> 4 CV "9.09"
#> 5 Min "38 (G2 in E14)"
#> 6 Max "58 (G8 in E11)"
#> 7 MinENV "E14 (41.03)"
#> 8 MaxENV "E11 (54.2)"
#> 9 MinGEN "G2 (46.66) "
#> 10 MaxGEN "G5 (49.3) "
#>
#> ---------------------------------------------------------------------------
#>
#>
#>
# }