【问题标题】:With FactominR how to display supplementary variables in a FAMD using plot()使用 FactominR 如何使用 plot() 在 FAMD 中显示补充变量
【发布时间】:2019-08-30 22:14:54
【问题描述】:

我正在使用 FactominR 进行分析。对于我的数据,我需要运行 FAMD,因为我混合了连续变量和分类变量。我有活跃的连续和分类变量,以及补充分类变量。我可以运行 FAMD 并绘制结果。但我没有找到如何在图形上绘制补充变量。 总结显示补充变量包含在分析中。 我在这个包上做了一个 mooc 并且玩了很多不同的功能,并且知道如何为其他人(如 PCA、MFA 等)执行此操作……但我没有找到如何为 FAMD 显示它们我期望一个图表与不同模式的 MFA 类似。

我已阅读有关 plot.FAMD 函数的信息,但似乎不存在显示或不显示补充变量的可能性。我觉得很奇怪,因为对于 MFA , plot 包括补充变量,并且可以显示或不显示它们。

包中包含的示例没有补充变量。它运行良好,但我无法比较。

# This works except the supplementary variable are invisible on all graphs
res <- FAMD(luc, ncp = Inf, sup.var = c(1,7,8,10,11,13,14))
summary(res, nbelements=Inf)

# Here are the option to display the different graphs from FAMD
plot(res, choix="var")
plot(res, choix="quanti")
plot(res, choix="quali")
plot(res, choix = "ind")

Error in match.arg(choix, c("ind", "var", "quanti", "quali")) : 
  'arg' should be one of “ind”, “var”, “quanti”, “quali”

#what I would do/did with an MFA to remove the suppl variables on the ind factor map
plot(res, invisible=c("var","quali.sup"))

#Same on the Variable graph for an MFA
plot(res, choix="var",invisible=c("quali.sup","quanti.sup"))

【问题讨论】:

    标签: r


    【解决方案1】:

    我发现了问题。我使用的是旧版本的 FactomineR 1.41 更新到 1.42 解决了它。

    如果您有同样的问题,并且想要测试,您可以使用开发人员之一 François Husson 给我的以下代码。

    data(wine)
    res <- FAMD(wine[,c(1,2,30,31)],sup.var=1)
    plot(res)                  ## graphe avec individus + modalités actves + modalités supplémentaires
    plot(res,invisible=c("ind","quali")) ## graphe avec modalités supplémentaires (on rend invisible les individus et modalités actives)
    plot(res,choix="var")     # graphe avec toutes les variables (sumbole différent pour les variables supplémentaires)
    

    【讨论】:

      猜你喜欢
      • 2021-12-18
      • 1970-01-01
      • 2022-11-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-09
      • 1970-01-01
      相关资源
      最近更新 更多