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)
View(a)
library("survHE")
mods <- c("exp","weibull","gamma")
formula1 <-Surv(a[,2], a[,3])~1
m1 <- fit.models(formula=formula1, data= a, distr=mods)
print(m1)
plot(m1)
Thanks in advance!