Advertisement
Guest User

Untitled

a guest
Nov 3rd, 2017
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.72 KB | None | 0 0
  1. # fit bayesian lasso
  2. mod_1 <- blasso_net(dat, lasso_df = 2, chains = 2, prior_scale = 2)
  3.  
  4. # compute partial correlation matrix
  5. par_mod_1 <- partial_corr(mod_1, prior_scale = 2, prob = .90)
  6.  
  7. # compute centrality
  8. cent_info <- bayes_centrality(par_mod_1, scale = "std", rule = "interval",
  9.                              prob_edge = .9, point_est_cent = "mean",
  10.                              prob_cent = 0.90,  point_est_edge = "mean")
  11.  
  12. # plot centrality
  13. centrality_plot(cent_info, shape = 17, size_1 = 4, size_2 = 3, width = .2)
  14.  
  15. # set some edges to zero based on some decison rule
  16. edge_decide <- edge_decision_rule(par_mod_1, rule = "interval", point_est = "mean", prob = .90)
  17.  
  18. # plot
  19. qgraph(edge_decide, layout = "spring")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement