surv.pval: A backward elimination model building in Cox regression

Description Usage Arguments Value Examples

View source: R/model.building.R

Description

The function builds or finalizes a multivariable Cox regression model based on a LRT p-value.

Usage

1
surv.pval(time, event, covariate, sig = 0.05, data)

Arguments

time

A variable for time to event

event

A variable for event indicator (1 indicates event, 0 is censored)

covariate

A vector of variables included in the multivariable analysis

sig

A significance level that allows the variable in the finalized model

data

A data set

Value

A matrix with variables and p values in the multivariable Cox model

Examples

1
2
3
4
5
6
7
8
## Not run: 
library(survival)
df <- veteran
res <- surv.pval(time="time", event="status",
            covariate=c("age","prior","trt","celltype","karno","diagtime"),
            sig=0.05, data=df)

## End(Not run)

vandy10s/mod.building documentation built on Dec. 23, 2021, 2:10 p.m.