if (FALSE) {
library(reshape2)
library(dplyr)
library(ggplot2)
##### Cross-sectional real-data example #####
## organize data
data(DTI)
DTI = subset(DTI, select = c(cca, case, pasat))
DTI = DTI[complete.cases(DTI),]
DTI$gender = factor(sample(c("male","female"), dim(DTI)[1], replace = TRUE))
DTI$status = factor(sample(c("RRMS", "SPMS", "PPMS"), dim(DTI)[1], replace = TRUE))
## fit models
VB = bayes_fosr(cca ~ pasat, data = DTI, Kp = 4, Kt = 10)
## obtain predictions
pred = predict(VB, sample_n(DTI, 10))
}
Run the code above in your browser using DataLab