forsearch_cph {forsearch} | R 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, initial.sample=1000,
n.obs.per.level=1, skip.step1=NULL, ties = "efron", maxdisturb=0.01,
proportion=TRUE, unblinded=TRUE, begin.diagnose= 100, verbose=TRUE)
Arguments
alldata |
Data frame containing variables 'Observation', 'event.time', 'status', and independent variables, in that order |
formula.rhs |
Character vector of names of independent variables in model |
initial.sample |
Number of observations in Step 1 of forward search |
n.obs.per.level |
Number of observations per level of (possibly crossed) factor levels to include in Step 1 |
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 |
Maximum amount to add randomly to event.time to prevent ties. |
proportion |
TRUE causes evaluation of proportionality of Cox regression |
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 display before and after run |
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 |
Proportionality Test |
Result of Cox proportionality test, if run |
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
## Not run:
{# Forsearch for Cox Proportional Survival, including Step 1
veteran <- survival::veteran
veteran <- veteran[order(veteran$celltype),]
veteranx <- veteran[,c(3,4,1,2)]
veteranx$trt <- as.factor(veteranx$trt)
dimv <- dim(veteran)[1]
Observation <- 1:dimv
veteranx <- data.frame(Observation,veteranx)
names(veteranx)[2] <- "event.time"
form.1 <- "trt + celltype"
forskip <- NULL
# forskip <- c(12, 23, 38, 71, 91, 104, 116, 130, 31, 73, 62, 76)
cphtest1a.out <- forsearch_cph(alldata=veteranx, formula.rhs=form.1,
n.obs.per.level=2, skip.step1=forskip, ties="efron", unblinded=TRUE,
initial.sample=467, begin.diagnose = 100, verbose = TRUE)
}
{# Same, but skipping Step 1.
forskip <- c(12, 6, 31, 23, 38, 62, 71, 73, 91, 84, 104, 101, 116, 125,128,76)
cphtest1b.out <- forsearch_cph(alldata=veteranx, formula.rhs=form.1,
n.obs.per.level=2, skip.step1=forskip, ties="efron", unblinded=TRUE,
initial.sample=467, begin.diagnose = 100, verbose = TRUE)
}
## End(Not run)