Skip to content

Possibility to fit "all" models even if they do not converge #46

@fthielen

Description

@fthielen

Dear Gianluca,

I would love to use survHE::fit.models() to estimate "all possible" models in one go. Similar to:

all_distributions <- c("exponential", "gamma","genf","gengamma","gompertz",
"weibull", "weibullPH","loglogistic","lognormal")

x <- survHE::fit.models(formula=Surv(time,status)~ph.ecog,data=lung,
 distr = all_distributions)

This example works fine, but for some data, some distribution cannot be estimated, resulting in an error. This interrupts the computation, although not being able to fit could as well be a valid outcome of the analysis. Is there a way to not let the estimation stop with an error but instead proceed and leave the place in the result list for the not estimated model empty? (e.g., x$models$exponential "Not estimated").

I wrote my own function using tryCatch(error = function(e) NULL). In this way, the execution is not interrupted.

Best,
Frederick

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions