Skip to contents

Print an object of class mgidi Print a mgidi object in two ways. By default, the results are shown in the R console. The results can also be exported to the directory.

Usage

# S3 method for mgidi
print(x, export = FALSE, file.name = NULL, digits = 4, ...)

Arguments

x

An object of class mgidi.

export

A logical argument. If TRUE|T, 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 <- gamem(data_g,
               gen = GEN,
               rep = REP,
               resp = c(KW, NR, NKE, NKR))
#> Evaluating trait KW |===========                                 | 25% 00:00:00 
Evaluating trait NR |======================                      | 50% 00:00:00 
Evaluating trait NKE |================================           | 75% 00:00:00 
Evaluating trait NKR |===========================================| 100% 00:00:00 

#> Method: REML/BLUP
#> Random effects: GEN
#> Fixed effects: REP
#> Denominador DF: Satterthwaite's method
#> ---------------------------------------------------------------------------
#> P-values for Likelihood Ratio Test of the analyzed traits
#> ---------------------------------------------------------------------------
#>     model     KW     NR     NKE   NKR
#>  Complete     NA     NA      NA    NA
#>  Genotype 0.0253 0.0056 0.00952 0.216
#> ---------------------------------------------------------------------------
#> Variables with nonsignificant Genotype effect
#> NKR 
#> ---------------------------------------------------------------------------
mgidi_index <- mgidi(model)
#> 
#> -------------------------------------------------------------------------------
#> Principal Component Analysis
#> -------------------------------------------------------------------------------
#> # A tibble: 4 × 4
#>   PC    Eigenvalues `Variance (%)` `Cum. variance (%)`
#>   <chr>       <dbl>          <dbl>               <dbl>
#> 1 PC1          2.42          60.6                 60.6
#> 2 PC2          1.19          29.8                 90.3
#> 3 PC3          0.32           8                   98.3
#> 4 PC4          0.07           1.66               100  
#> -------------------------------------------------------------------------------
#> Factor Analysis - factorial loadings after rotation-
#> -------------------------------------------------------------------------------
#> # A tibble: 4 × 5
#>   VAR     FA1   FA2 Communality Uniquenesses
#>   <chr> <dbl> <dbl>       <dbl>        <dbl>
#> 1 KW    -0.9   0.04        0.82         0.18
#> 2 NR    -0.92 -0.12        0.87         0.13
#> 3 NKE   -0.7  -0.69        0.96         0.04
#> 4 NKR    0.05 -0.98        0.97         0.03
#> -------------------------------------------------------------------------------
#> Comunalit Mean: 0.9033994 
#> -------------------------------------------------------------------------------
#> Selection differential 
#> -------------------------------------------------------------------------------
#> # A tibble: 4 × 11
#>   VAR   Factor    Xo    Xs     SD SDperc    h2     SG SGperc sense     goal
#>   <chr> <chr>  <dbl> <dbl>  <dbl>  <dbl> <dbl>  <dbl>  <dbl> <chr>    <dbl>
#> 1 KW    FA1    147.  163.  16.2    11.0  0.659 10.7     7.27 increase   100
#> 2 NR    FA1     15.8  17.4  1.63   10.3  0.736  1.20    7.60 increase   100
#> 3 NKE   FA1    468.  532.  64.0    13.7  0.713 45.6     9.74 increase   100
#> 4 NKR   FA2     30.4  31.2  0.814   2.68 0.452  0.368   1.21 increase   100
#> ------------------------------------------------------------------------------
#> Selected genotypes
#> -------------------------------------------------------------------------------
#> H13 H5
#> -------------------------------------------------------------------------------
print(mgidi_index)
#> -------------------------------------------------------------------------------
#> Correlation matrix used used in factor analysis 
#> -------------------------------------------------------------------------------
#>         KW    NR  NKE    NKR
#> KW   1.000 0.688 0.56 -0.027
#> NR   0.688 1.000 0.73  0.047
#> NKE  0.560 0.731 1.00  0.610
#> NKR -0.027 0.047 0.61  1.000
#> -------------------------------------------------------------------------------
#> Principal component analysis 
#> -------------------------------------------------------------------------------
#> # A tibble: 4 × 4
#>   PC    Eigenvalues `Variance (%)` `Cum. variance (%)`
#>   <chr>       <dbl>          <dbl>               <dbl>
#> 1 PC1       2.422           60.55                60.55
#> 2 PC2       1.192           29.79                90.34
#> 3 PC3       0.3201           8.002               98.34
#> 4 PC4       0.06631          1.658              100   
#> -------------------------------------------------------------------------------
#> Initial loadings 
#> -------------------------------------------------------------------------------
#> # A tibble: 4 × 3
#>   VAR       PC1     PC2
#>   <chr>   <dbl>   <dbl>
#> 1 KW    -0.7827  0.4545
#> 2 NR    -0.8731  0.3232
#> 3 NKE   -0.9353 -0.2852
#> 4 NKR   -0.4153 -0.8939
#> -------------------------------------------------------------------------------
#> Loadings after varimax rotation 
#> -------------------------------------------------------------------------------
#> # A tibble: 4 × 3
#>   VAR        FA1      FA2
#>   <chr>    <dbl>    <dbl>
#> 1 KW    -0.9042   0.04004
#> 2 NR    -0.9235  -0.1182 
#> 3 NKE   -0.6966  -0.6862 
#> 4 NKR    0.04631 -0.9846 
#> -------------------------------------------------------------------------------
#> Scores for genotypes-ideotype 
#> -------------------------------------------------------------------------------
#> # A tibble: 14 × 3
#>    GEN        FA1     FA2
#>    <chr>    <dbl>   <dbl>
#>  1 H1    -1.615   -0.2874
#>  2 H10   -0.2495  -2.888 
#>  3 H11   -1.220   -2.278 
#>  4 H12   -1.813   -1.450 
#>  5 H13   -3.589   -2.244 
#>  6 H2    -1.816   -0.6748
#>  7 H3    -0.5856  -1.045 
#>  8 H4    -0.2922  -2.673 
#>  9 H5    -2.432   -2.315 
#> 10 H6    -1.405    0.2438
#> 11 H7    -1.449   -0.8412
#> 12 H8    -0.6321  -0.4303
#> 13 H9     0.01742 -1.398 
#> 14 ID1   -3.458   -2.745 
#> -------------------------------------------------------------------------------
#> Multi-trait genotype-ideotype distance index 
#> -------------------------------------------------------------------------------
#> # A tibble: 13 × 2
#>    Genotype  MGIDI
#>    <chr>     <dbl>
#>  1 H13      0.5181
#>  2 H5       1.112 
#>  3 H12      2.093 
#>  4 H11      2.286 
#>  5 H2       2.642 
#>  6 H7       2.767 
#>  7 H1       3.072 
#>  8 H4       3.166 
#>  9 H10      3.211 
#> 10 H3       3.337 
#> 11 H6       3.626 
#> 12 H8       3.653 
#> 13 H9       3.727 
#> -------------------------------------------------------------------------------
#> Selection differential 
#> -------------------------------------------------------------------------------
#> # A tibble: 4 × 11
#>   VAR   Factor     Xo     Xs      SD SDperc     h2      SG SGperc sense     goal
#>   <chr> <chr>   <dbl>  <dbl>   <dbl>  <dbl>  <dbl>   <dbl>  <dbl> <chr>    <dbl>
#> 1 KW    FA1    146.8  163.0  16.19   11.03  0.6594 10.67    7.271 increase   100
#> 2 NR    FA1     15.78  17.42  1.630  10.33  0.7359  1.200   7.601 increase   100
#> 3 NKE   FA1    467.9  531.9  63.97   13.67  0.7126 45.58    9.742 increase   100
#> 4 NKR   FA2     30.4   31.21  0.8142  2.678 0.4523  0.3683  1.211 increase   100
#> -------------------------------------------------------------------------------
#> Selected genotypes 
#> -------------------------------------------------------------------------------
#> H13 H5
# }