Issue with plotting of parametic survival distributions

Hi there,

I am having an issue while working with the survHE package. I want to fit three different parametric distributions to my dataset and plot the results in the end.

Unfortunately I am receiving an error message, when trying to plot the distributions:
> plot(m1)
*Error in terms.formula(tmp, simplify = TRUE) : *

  • invalid model formula in ExtractVars*

Not really sure where to locate the error. Is it possible that it is data set related?
The .csv contains 4 columns with two relevant variables (survival time and event 0/1).

Below you can find my code:

Dataset <-read.csv("IPD_EFS.csv", header=TRUE)
a <- data.frame(Dataset)
mods <- c("exp","weibull","gamma")
formula1 <-Surv(a[,2], a[,3])~1
m1 <- fit.models(formula=formula1, data= a, distr=mods)

Thanks in advance!

See the FAQ: How to do a minimal reproducible example reprex for beginners. Code usually is not enough, the data is key. Reverse engineering the specific problem is an answer deterrent.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.