# NOT RUN {
# load "macs" library
library("macs")
# construct STREE model
set.seed(1234)
data <- data.frame(r = runif(1000, 1, 10), c = rbinom(1000, 1, 0.5),
n = as.factor(sample(1:4, 1000, replace = TRUE,
prob = c(0.1, 0.3, 0.2, 0.4))),
o1 = sample(1:50, 1000, replace = TRUE),
o2 = sample(1:30, 1000, replace = TRUE),
o3 = sample(1:10, 1000, replace = TRUE),
o4 = sample(1:60, 1000, replace = TRUE),
o5 = sample(1:20, 1000, replace = TRUE),
o6 = sample(1:40, 1000, replace = TRUE))
head(data)
result <- stree(data, family = "likelihood")
# plot result of stree
plot(result, main = "example of stree plot")
plot(result, shape = 2)
# }
Run the code above in your browser using DataLab