estim.hazard | R Documentation |
Estimates hazard function using Poisson model
estim.hazard( formula, data, time, status, breaks, knots, time.eval = breaks, alpha = 0.05, use.GAM = FALSE, print.GAM.summary = FALSE, ... )
formula |
formula with Surv in LHS, NOTE! only one variable in RHS |
data |
data used by formula |
time |
time variables |
status |
status indicator Lowest value used as sensoring. If only one unique value detected, all are assumed events |
breaks |
time is splitted with these values |
knots |
knots for natural splines used in estimation of hazard function |
time.eval |
in which time points hazard function is evaluate. |
alpha |
significance level for confidence intervals |
use.GAM |
logical determining if generalized additive model (GAM) is used |
print.GAM.summary |
logical determining if summary of GAM is printed |
... |
parameters for glm |
Returns data frame with time and hazard function values with attribute 'estim.hazard.param' containing estimation parameters (breaks and knots)
Jari Haukka jari.haukka@helsinki.fi
library(survival) tmp.hz<-estim.hazard(time=lung$time,status=lung$status) head(tmp.hz,2) attributes(tmp.hz)$estim.hazard.param # estimation parameters tmp.hz2<-estim.hazard(formula=Surv(time,status)~sex,data=lung) head(tmp.hz2,2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.