forsearch_cph: Create Statistics of Forward Search in a Cox Proportional...

View source: R/forsearch_cph.R

forsearch_cphR Documentation

Create Statistics of Forward Search in a Cox Proportional Hazard Database

Description

Prepares summary statistics at each stage of forward search for subsequent plotting.

Usage

forsearch_cph(alldata, formula.rhs, nofactform, initial.sample=1000, 
      skip.step1=NULL, ties = "efron", maxdisturb=.01, proportion=TRUE, 
      unblinded=TRUE, begin.diagnose= 100, verbose=TRUE)

Arguments

alldata

Data frame whose first 3 columns are Observation, event.time, and status, and whose last columns are independent variables. Factor variables must be defined in advance.

formula.rhs

The right hand side of a formula object (omit tilde '~')

nofactform

Formula, omitting all factor variables

initial.sample

Number of observations in Step 1 of forward search

skip.step1

NULL or a vector of integers for observations to be included in Step 1

ties

Method for handling ties in event time, "efron", "breslow" or "exact"; see survival::coxph

maxdisturb

Amount of maximum disturbance to add to each event time to prevent ties

proportion

Logical. TRUE causes running of survival::cox.zph on each stage

unblinded

TRUE causes printing of presumed analysis structure

begin.diagnose

Numeric. Indicates where in code to begin printing diagnostics. 0 prints all; 100 prints none

verbose

TRUE causes function identifier to display before and after run

Details

Step 1 requires one additional observation to be included in database to prevent failure of Wald statistic in Step 2 calculation of coxph function

Value

LIST

Rows in stage

Observation numbers of rows included at each stage

Number of model parameters

Number of fixed coefficients in Cox model

Fixed parameter estimates

Vector of parameter estimates at each stage

Wald Test

Vector of Wald tests at each stage

LogLikelihood

Vector of null and overall coefficients log likelihoods at each stage

Likelihood ratio test

Vector of LRTs at each stage

Leverage

Matrix of leverage of each observation at each stage

Call

Call to this function

Author(s)

William R. Fairweather

References

Atkinson, A and M Riani. Robust Diagnostic Regression Analysis, Springer, New York, 2000.

Examples


Observation <- 1:60
xx1 <- runif(60)
xx2 <- runif(60)
treat <- c(rep("A",30),rep("B",20),rep("C",10))
treat <- as.factor(treat)
event.time <- trunc(100*runif(60))
statusx <- c(rep(1,22),rep(0,8),rep(1,17),rep(0,3),rep(1,6),rep(0,4))
index3 <- sample(1:60,60)
xindep <- data.frame(Observation,event.time,status=statusx,xx1,xx2,treat)
formula.rhs <- "xx1 + xx2 + treat"
coxph.out05 <- forsearch_cph(alldata=xindep, formula.rhs=formula.rhs, 
    nofactform="xx1 + xx2", skip.step1=NULL, ties="efron", initial.sample=500, 
    begin.diagnose=100)

forsearch documentation built on April 4, 2025, 5:52 a.m.