s_PSurv: Parametric Survival Regression [S]

View source: R/s_PSurv.R

s_PSurvR Documentation

Parametric Survival Regression [S]

Description

Fit a parametric survival regression model using survival::survreg

Usage

s_PSurv(
  x,
  y,
  x.test = NULL,
  y.test = NULL,
  x.name = NULL,
  y.name = NULL,
  weights = NULL,
  dist = "weibull",
  control = survival::survreg.control(),
  print.plot = FALSE,
  plot.fitted = NULL,
  plot.predicted = NULL,
  plot.theme = rtTheme,
  question = NULL,
  verbose = TRUE,
  trace = 0,
  save.mod = FALSE,
  outdir = NULL,
  ...
)

Arguments

x

Numeric vector or matrix of features, i.e. independent variables

y

Object of class "Surv" created using survival::Surv

x.test

(Optional) Numeric vector or matrix of testing set features must have set of columns as x

y.test

(Optional) Object of class "Surv" created using survival::Surv

x.name

Character: Name for feature set

y.name

Character: Name for outcome

weights

Float: Vector of case weights

print.plot

Logical: if TRUE, produce plot using mplot3 Takes precedence over plot.fitted and plot.predicted.

plot.fitted

Logical: if TRUE, plot True (y) vs Fitted

plot.predicted

Logical: if TRUE, plot True (y.test) vs Predicted. Requires x.test and y.test

plot.theme

Character: "zero", "dark", "box", "darkbox"

question

Character: the question you are attempting to answer with this model, in plain language.

verbose

Logical: If TRUE, print summary to screen.

save.mod

Logical: If TRUE, save all output to an RDS file in outdir save.mod is TRUE by default if an outdir is defined. If set to TRUE, and no outdir is defined, outdir defaults to paste0("./s.", mod.name)

outdir

Path to output directory. If defined, will save Predicted vs. True plot, if available, as well as full model output, if save.mod is TRUE

...

Additional parameters to pass to survival::survreg

Value

Object of class rtMod

Author(s)

E.D. Gennatas

See Also

train_cv for external cross-validation


egenn/rtemis documentation built on May 4, 2024, 7:40 p.m.