Open kieranzu opened 5 years ago
I'm having this same issue, many years later. Was a solution ever found?
Found a workaround that requires a loop and creating a new dataframe with identically named columns for every iteration (instead of substituting columns into the formula). It's not ideal, but gets the job done.
Expected behavior
If I hard code Km models in the usual way then i can run surv_pvalue without any problem. As I am building multiple models for multiple cancers I am writing custom functions that build the KM models for multiple cancer sites simultaneously. I would expect the models built in this fashion to work in the same way as those that are hard coded
Actual behavior
When I attempt to run surv_pvalue on the functionally generated models i get the following: Error in paste(x) : object 'x' not found This seems to be due to the call element of the survfit object having the raw text from the function used to generate it rather than the string after pasting.
Steps to reproduce the problem
session_info()