drugNameFM <- mergeFactors(response = brcaSurv[!is.na(drugName)],
factor = drugName[!is.na(drugName)],
family = "survival")
plot(drugNameFM, nodesSpacing = "effects", gicPanelColor = "grey2")
anova(coxph(brcaSurv[!is.na(drugName)] ~ drugName[!is.na(drugName)]))
#> Analysis of Deviance Table
#> Cox model: response is brcaSurv[!is.na(drugName)]
#> Terms added sequentially (first to last)
#>
#> loglik Chisq Df Pr(>|Chi|)
#> NULL -131.16
#> drugName[!is.na(drugName)] -129.59 3.1525 4 0.5326
anova(coxph(brcaSurv[!is.na(drugName)] ~ cutTree(drugNameFM)))
#> Analysis of Deviance Table
#> Cox model: response is brcaSurv[!is.na(drugName)]
#> Terms added sequentially (first to last)
#>
#> loglik Chisq Df Pr(>|Chi|)
#> NULL -131.16
#> cutTree(drugNameFM) -129.93 2.4724 1 0.1159
patCat <- BRCA$pathologicCategory %>% substr(1, 2)
patCatFM <- mergeFactors(response = brcaSurv[!is.na(patCat)],
factor = patCat[!is.na(patCat)],
family = "survival")
plot(patCatFM, responsePanel = "frequency", gicPanelColor = "red")
anova(coxph(brcaSurv[!is.na(patCat)] ~ patCat[!is.na(patCat)]))
#> Analysis of Deviance Table
#> Cox model: response is brcaSurv[!is.na(patCat)]
#> Terms added sequentially (first to last)
#>
#> loglik Chisq Df Pr(>|Chi|)
#> NULL -539.39
#> patCat[!is.na(patCat)] -536.59 5.5993 4 0.2311
anova(coxph(brcaSurv[!is.na(subtype)] ~ cutTree(subtypeFM)))
#> Analysis of Deviance Table
#> Cox model: response is brcaSurv[!is.na(subtype)]
#> Terms added sequentially (first to last)
#>
#> loglik Chisq Df Pr(>|Chi|)
#> NULL -539.39
#> cutTree(subtypeFM) -534.89 8.9946 1 0.002708 **
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1