predict_coxph {packDAMipd} | R Documentation |
Predict risk/hazard function for cox ph regression
Description
Predict risk/hazard function for cox ph regression
Usage
predict_coxph(
coxfit,
dataset,
param_to_be_estimated,
covariates,
indep_var,
timevar_survival
)
Arguments
coxfit |
cox regression fit result |
dataset |
param describing the methods |
param_to_be_estimated |
parameter to be estimated |
covariates |
covariates |
indep_var |
independent variable |
timevar_survival |
time variable |
Details
"risk" option for "type" returns the hazard ratio relative to mean e.g given below For lung data with data_for_survival <- survival::lung fit <- use_coxph_survival("status", data_for_survival, "sex", covariates = c("ph.ecog"), "time") coeffit = fit$coefficients r1234 <- exp(coeffit("sex")lung$sex+ coeffit("ph.ecog")lung$ph.ecog) rMean <- exp(sum(coef(fit) * fit$means, na.rm=TRUE)) rr <- r1234/rMean
Value
plot and the survival function values
Examples
data_for_survival <- survival::lung
surv_estimated <- use_coxph_survival("status", data_for_survival,
"sex",covariates = c("ph.ecog"), "time")
predict_coxph(surv_estimated$fit,data_for_survival, "status","sex",
covariates = c("ph.ecog"), "time")
[Package packDAMipd version 1.1.0 Index]