具有因子变量的 FactoMineR PCA
FactoMineR PCA with factor variables
这里是一个link到R数据格式的数据(所以你可以看到因子实际上是因子):
代码如下:
df %>%
PCA(scale.unit = TRUE,
quali.sup = 14, #the factor variables
graph = T)
除了告诉我它用平均值替换了缺失值(我很高兴看到)之外,上面的结果是:
argument is not numeric or logical: returning NA
argument is not numeric or logical: returning NA
argument is not numeric or logical: returning NA
argument is not numeric or logical: returning NA
argument is not numeric or logical: returning NA
argument is not numeric or logical: returning NA
Error in PCA(., scale.unit = TRUE, quali.sup = 14, graph = T) :
The following variables are not quantitative: ins_stat_i
The following variables are not quantitative: c1r
The following variables are not quantitative: childnm
The following variables are not quantitative: state
The following variables are not quantitative: sex
The following variables are not quantitative: language
我很困惑。我没有说它们是定量的。我说他们是 quali.sup
类型。你能复制它吗?如果是这样,解决方案是什么?谢谢大家
哦,亲爱的。原来是我打错了。我应该说 quali.sum
变量是 13:19 而我说它们是 14。这就是问题所在。
这里是一个link到R数据格式的数据(所以你可以看到因子实际上是因子):
代码如下:
df %>%
PCA(scale.unit = TRUE,
quali.sup = 14, #the factor variables
graph = T)
除了告诉我它用平均值替换了缺失值(我很高兴看到)之外,上面的结果是:
argument is not numeric or logical: returning NA
argument is not numeric or logical: returning NA
argument is not numeric or logical: returning NA
argument is not numeric or logical: returning NA
argument is not numeric or logical: returning NA
argument is not numeric or logical: returning NA
Error in PCA(., scale.unit = TRUE, quali.sup = 14, graph = T) :
The following variables are not quantitative: ins_stat_i
The following variables are not quantitative: c1r
The following variables are not quantitative: childnm
The following variables are not quantitative: state
The following variables are not quantitative: sex
The following variables are not quantitative: language
我很困惑。我没有说它们是定量的。我说他们是 quali.sup
类型。你能复制它吗?如果是这样,解决方案是什么?谢谢大家
哦,亲爱的。原来是我打错了。我应该说 quali.sum
变量是 13:19 而我说它们是 14。这就是问题所在。