You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is very common to apply stratification on Cox models. In the survival package, the "strata" argument is available in the "coxph" function. However, since the update of the package to CRAN, it returns an error when attempting to plot coxph objects which have utilized the strata function.
Example:
library(survival)
library(forestmodel)
data(lung)
fit <- coxph(Surv(time, status)~ age + strata(sex), data=lung)
forest_model(fit)
Error: could not find function "strata"
Any suggestions how to solve this?
Best regards
The text was updated successfully, but these errors were encountered:
This related to the use of non-standard evaluation by dplyr and the fact the the term name strata(sex) was interpreted as a call to a function strata on the variable sex. I've added in a as.name to fix this and have tidied the surrounding code a little. I've also changed it so that terms like strata which don't have a result in the final model get filtered out.
It is very common to apply stratification on Cox models. In the survival package, the "strata" argument is available in the "coxph" function. However, since the update of the package to CRAN, it returns an error when attempting to plot coxph objects which have utilized the strata function.
Example:
library(survival)
library(forestmodel)
data(lung)
fit <- coxph(Surv(time, status)~ age + strata(sex), data=lung)
forest_model(fit)
Error: could not find function "strata"
Any suggestions how to solve this?
Best regards
The text was updated successfully, but these errors were encountered: