
censIndCR(target, dataset, xIndex, csIndex, wei = NULL, dataInfo = NULL,
univariateModels = NULL, hash = FALSE, stat_hash = NULL, pvalue_hash = NULL,
robust = FALSE)
censIndWR(target, dataset, xIndex, csIndex, wei = NULL, dataInfo = NULL,
univariateModels = NULL, hash = FALSE, stat_hash = NULL, pvalue_hash = NULL,
robust = FALSE)
censIndER(target, dataset, xIndex, csIndex, wei = NULL, dataInfo = NULL,
univariateModels = NULL, hash = FALSE, stat_hash = NULL, pvalue_hash = NULL,
robust = FALSE)
If hash = TRUE, censIndCR, censIndWR and censIndER require the arguments 'stat_hash' and 'pvalue_hash' for the hash-based implementation of the statistic test. These hash Objects are produced or updated by each run of SES (if hash == TRUE) and they can be reused in order to speed up next runs of the current statistic test. If "SESoutput" is the output of a SES run, then these objects can be retrieved by SESoutput@hashObject$stat_hash and the SESoutput@hashObject$pvalue_hash.
Important: Use these arguments only with the same dataset that was used at initialization.
For all the available conditional independence tests that are currently included on the package, please see "?CondIndTests".
Cox,D.R. (1972) Regression models and life-tables. J. R. Stat. Soc., 34, 187-220.
SES, censIndWR, testIndFisher, gSquare, testIndLogistic, Surv, anova, CondIndTests
#create a survival simulated dataset
dataset <- matrix(runif(1000 * 20, 1, 100), nrow = 1000 , ncol = 20)
dataset <- as.data.frame(dataset);
timeToEvent <- numeric(1000)
event <- numeric(1000)
ca <- numeric(1000)
for(i in 1:1000) {
timeToEvent[i] <- dataset[i, 1] + 0.5 * dataset[i, 10] + 2 * dataset[i, 15] + runif(1, 0, 1);
event[i] <- sample( c(0, 1), 1)
ca[i] <- runif(1, 0, timeToEvent[i]-0.5)
if(event[i] == 0) {
timeToEvent[i] = timeToEvent[i] - ca[i]
}
}
require(survival, quietly = TRUE)
#init the Surv object class feature
target <- Surv(time = timeToEvent, event = event)
#run the censIndCR conditional independence test
res <- censIndCR( target, dataset, xIndex = 12, csIndex = c(5, 7, 4) )
res
#run the SES algorithm using the censIndCR conditional independence
#test for the survival class variable
ses1 <- SES(target, dataset, max_k = 1, threshold = 0.05, test = "censIndCR");
ses2 <- SES(target, dataset, max_k = 1, threshold = 0.05, test = "censIndWR");
ses3 <- SES(target, dataset, max_k = 1, threshold = 0.05, test = "censIndER");
Run the code above in your browser using DataLab