# NOT RUN {
# note: iter = 250 for demonstrative purposes
#########################################
### example 1: continuous and ordinal ###
#########################################
# data
Y <- ptsd
# continuous
# fit model
fit <- estimate(Y, type = "continuous",
iter = 250)
# summarize the partial correlations
summ <- summary(fit)
# plot the summary
plt_summ <- plot(summary(fit))
# select the graph
E <- select(fit)
# plot the selected graph
plt_E <- plot(select(fit))
# ordinal
# fit model (note + 1, due to zeros)
fit <- estimate(Y + 1, type = "ordinal",
iter = 250)
# summarize the partial correlations
summ <- summary(fit)
# plot the summary
plt <- plot(summary(fit))
# select the graph
E <- select(fit)
# plot the selected graph
plt_E <- plot(select(fit))
##################################
## example 2: analytic solution ##
##################################
# (only continuous)
# data
Y <- ptsd
# fit model
fit <- estimate(Y, analytic = TRUE)
# summarize the partial correlations
summ <- summary(fit)
# plot summary
plt_summ <- plot(summary(fit))
# select graph
E <- select(fit)
# plot the selected graph
plt_E <- plot(select(fit))
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab