如何检查字符和数字组之间的关系?

时间:2018-04-07 19:18:17

标签: r glm anova

我想检查特定数字变量对R中字符向量的影响。

                      A       B       C       D       E    F_PATHOLOGIC_TUMOR_STAGE AJCC_TUMOR_PATHOLOGIC_PT GRADE           PRIMARY_SITE
TCGA.2J.AAB4.01 -0.2527 -1.2093  0.7556 -0.7071 -0.1310                   Stage IIB                       T2    G2 Other (please specify)
TCGA.2J.AAB6.01  1.2080  0.4815 -0.3242 -0.7088  4.0856                   Stage IIA                       T3    G2       Body of Pancreas
TCGA.2J.AAB8.01  0.7529  0.7916  0.0596 -0.5287  1.1315                   Stage IIB                       T3    G3       Head of Pancreas
TCGA.2J.AAB9.01 -0.3248 -0.7941 -0.5940  0.3325 -0.4385                   Stage IIB                       T3    G1       Head of Pancreas
TCGA.2J.AABA.01 -0.4154  0.2808  0.7133 -0.7088 -0.6147                   Stage IIB                       T3    G2       Head of Pancreas
TCGA.2J.AABE.01  0.6566 -0.1300  0.5751 -0.7088 -0.7381                   Stage IIA                       T3    G2       Body of Pancreas

如您所见,列AE包含数值。 F_PATHOLOGIC_TUMOR_STAGE包含值Stage IStage IAStage IBStage IIAStage IIBStage IIIStage IV。< / p>

我希望独立地在A上看到每个因素EF_PATHOLOGIC_TUMOR_STAGE的影响。当我运行以下代码时

glm(AJCC_PATHOLOGIC_TUMOR_STAGE ~ A, data = merged.data.frame.Stage, family = "binomial")

我收到以下错误:

Error in eval(family$initialize) : y values must be 0 <= y <= 1

然后我想使用anova来获得结果。可能导致问题的原因是什么?如何避免?

0 个答案:

没有答案