# Prepare data
data(Week3_response)
Week3_response = data.frame(Week3_response)
surv_fam_shan_w3 = data.frame(cbind(as.numeric(Week3_response$T1Dweek),
as.numeric(Week3_response$T1D)))
colnames(surv_fam_shan_w3) = c("Survival", "Censor")
prog_fam_shan_w3 = data.frame(factor(Week3_response$Treatment_new))
colnames(prog_fam_shan_w3) = c("Treatment")
data(fam_shan_trim_w3)
names_fam_shan_trim_w3 =
c("Unknown", "Lachnospiraceae", "S24.7", "Lactobacillaceae", "Enterobacteriaceae", "Rikenellaceae")
fam_shan_trim_w3 = data.matrix(fam_shan_trim_w3[ ,2:82])
rownames(fam_shan_trim_w3) = names_fam_shan_trim_w3
# Using the function
CVMajority_fam_shan_w3 = CVMajorityvotes(Survival = surv_fam_shan_w3$Survival,
Micro.mat = fam_shan_trim_w3,
Censor = surv_fam_shan_w3$Censor,
Reduce=TRUE,
Select=5,
Mean = TRUE,
Prognostic = prog_fam_shan_w3,
Fold=3,
Ncv=10)
# Get the class of the object
class(CVMajority_fam_shan_w3) # An "cvmv" Class
# Method that can be used for the result
show(CVMajority_fam_shan_w3)
summary(CVMajority_fam_shan_w3)
plot(CVMajority_fam_shan_w3)
Run the code above in your browser using DataLab