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

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

Arguments

x

An object of class can_cor.

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) cc <- can_corr(data_ge2, FG = c(PH, EH, EP), SG = c(EL, CL, CD, CW, KW, NR, TKW), verbose = FALSE) print(cc)
#> --------------------------------------------------------------------------- #> Matrix (correlation/covariance) between variables of first group (FG) #> --------------------------------------------------------------------------- #> PH EH EP #> PH 1.000 0.932 0.638 #> EH 0.932 1.000 0.870 #> EP 0.638 0.870 1.000 #> #> --------------------------------------------------------------------------- #> Collinearity diagnostic between first group #> --------------------------------------------------------------------------- #> The multicollinearity in the matrix should be investigated. #> CN = 977.586 #> Largest VIF = 229.164618380199 #> Matrix determinant: 0.0025852 #> Largest correlation: PH x EH = 0.932 #> Smallest correlation: PH x EP = 0.638 #> Number of VIFs > 10: 3 #> Number of correlations with r >= |0.8|: 2 #> Variables with largest weight in the last eigenvalues: #> EH > PH > EP #> #> --------------------------------------------------------------------------- #> Matrix (correlation/covariance) between variables of second group (SG) #> --------------------------------------------------------------------------- #> EL CL CD CW KW NR TKW #> EL 1.0000 0.255 0.9119 0.458 0.669 -0.0139 0.442 #> CL 0.2554 1.000 0.3004 0.738 0.471 0.2619 0.619 #> CD 0.9119 0.300 1.0000 0.484 0.626 -0.0358 0.443 #> CW 0.4582 0.738 0.4840 1.000 0.735 0.1657 0.673 #> KW 0.6686 0.471 0.6260 0.735 1.000 0.3621 0.673 #> NR -0.0139 0.262 -0.0358 0.166 0.362 1.0000 -0.109 #> TKW 0.4421 0.619 0.4433 0.673 0.673 -0.1088 1.000 #> #> --------------------------------------------------------------------------- #> Collinearity diagnostic between second group #> --------------------------------------------------------------------------- #> Weak multicollinearity in the matrix #> CN = 66.912 #> Matrix determinant: 0.0026584 #> Largest correlation: EL x CD = 0.912 #> Smallest correlation: EL x NR = -0.014 #> Number of VIFs > 10: 0 #> Number of correlations with r >= |0.8|: 1 #> Variables with largest weight in the last eigenvalues: #> KW > TKW > EL > CW > CL > NR > CD #> #> --------------------------------------------------------------------------- #> Matrix (correlation/covariance) between FG and SG) #> --------------------------------------------------------------------------- #> EL CL CD CW KW NR TKW #> PH 0.380 0.325 0.315 0.505 0.753 0.329 0.569 #> EH 0.363 0.397 0.281 0.519 0.703 0.265 0.562 #> EP 0.263 0.391 0.175 0.425 0.497 0.140 0.426 #> #> --------------------------------------------------------------------------- #> Correlation of the canonical pairs and hypothesis testing #> --------------------------------------------------------------------------- #> Var Percent Sum Corr Lambda Chisq DF p_val #> U1V1 0.6500 74.35 74.4 0.806 0.273 194.28 21 0e+00 #> U2V2 0.2087 23.87 98.2 0.457 0.779 37.33 12 2e-04 #> U3V3 0.0156 1.78 100.0 0.125 0.984 2.35 5 8e-01 #> #> --------------------------------------------------------------------------- #> Canonical coefficients of the first group #> --------------------------------------------------------------------------- #> U1 U2 U3 #> PH 2.66 5.26 7.72 #> EH -2.58 -7.33 -12.99 #> EP 1.15 2.27 6.67 #> #> --------------------------------------------------------------------------- #> Canonical coefficients of the second group #> --------------------------------------------------------------------------- #> V1 V2 V3 #> EL -0.00776 -0.832 0.4561 #> CL -0.25837 -1.430 0.1989 #> CD -0.23630 1.177 -1.1116 #> CW -0.06101 0.338 0.0822 #> KW 0.91468 -0.691 1.4550 #> NR 0.21616 0.914 -0.5313 #> TKW 0.39749 0.717 -1.5248
# }