r - 用于产生 NaN 的典型相关的 Wilks Lambda 检验
问题描述
新来的,希望对我在 Rstudio 中进行 CCA 分析的 Wilks Lambda 测试的结果有所了解。我有 12 个预测变量(参数)和 13 个标准变量(ASC)。获取前 4 个 Pearson R 值的 NaN 和警告消息。
代码:
fit.cca <- function(X, Y){
library(candisc)
# Fit CCA
cca_model = candisc::cancor(X, Y)
# Return fitted model containing canonical correlations and wilks lambdas
return(cca_model)
}
cca_model = fit.cca(params, ASC)
cca_model$cancor
Wilks(cca_model)
输出:
Test of H0: The canonical correlations in the
current row and all that follow are zero
CanR LR test stat approx F numDF denDF Pr(> F)
1 1.00000 0.00000 -7299828308 144 -23.9250 NaN
2 1.00000 0.00000 NaN 121 -16.2770 NaN
3 1.00000 0.00000 -39750398 100 -9.6216 NaN
4 1.00000 0.00000 NaN 81 -3.9561 NaN
5 1.00000 0.00000 2660 64 0.7233 0.04474 *
6 1.00000 0.00000 124 49 4.4226 5.768e-05 ***
7 0.89551 0.05849 0 36 7.1522 0.99980
8 0.74240 0.29530 0 25 8.9316 0.99996
9 0.53585 0.65791 0 16 9.8028 0.99998
10 0.22582 0.92290 0 9 9.8856 0.99998
11 0.14621 0.97249 0 4 10.0000 0.99723
12 0.07914 0.99374 0 1 6.0000 0.85224
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Warning message:
In pf(Fstat, df1, df2, lower.tail = FALSE) : NaNs produced
我想知道导致 NaN 的原因以及可能如何解决它。
解决方案
推荐阅读
- regex - 正则表达式解析 Cisco 日志消息
- html - CSS 两个水平 div 等高
- javascript - 如何使用es错误类避免堆栈溢出
- php - 从数据库收集所有信息
- c# - SWIG 更改 C# 的特定类型的字段类型
- javascript - req.body 为空 express js
- java - 如何结合两个 ListenableFutures 并从第一个获得结果来完成
- asp.net - IIS7 401 自定义错误页面未重定向,它只返回 401 响应
- php - 登录后用户重定向,取决于其在 WooCommerce 中的角色
- javascript - iOS 没有加载带有类声明的 JavaScript 文件