if (FALSE) {
library("FRESA.CAD")
### Univariate Filter Examples ####
# Get the stage C prostate cancer data from the rpart package
data(stagec,package = "rpart")
# Prepare the data. Create a model matrix without the event time and interactions
stagec$pgtime <- NULL
stagec$eet <- as.factor(stagec$eet)
options(na.action = 'na.pass')
stagec_mat <- cbind(pgstat = stagec$pgstat,
as.data.frame(model.matrix(pgstat ~ .*.,stagec))[-1])
fnames <- colnames(stagec_mat)
fnames <- str_replace_all(fnames,":","__")
colnames(stagec_mat) <- fnames
# Impute the missing data
dataCancerImputed <- nearestNeighborImpute(stagec_mat)
dataCancerImputed[,1:ncol(dataCancerImputed)] <- sapply(dataCancerImputed,as.numeric)
# Get the top Features associated to pgstat
q_values <- multivariate_BinEnsemble(data=dataCancerImputed,
Outcome="pgstat")
}
Run the code above in your browser using DataLab