The bayesvl package: An R package for implementing and visualizing Bayesian statistics
Viet-Phuong La,
Quan-Hoang Vuong,
Trung Tran,
Minh-Hoang Nguyen,
Manh-Tung Ho,
Manh-Toan Ho
Affiliations
Viet-Phuong La
Centre for Interdisciplinary Social Research, Phenikaa University, Yen Nghia Ward, Ha Dong District, Hanoi 100803, Viet Nam; AI for Social Data Lab, Vuong & Associates, 3/161 Thinh Quang, Dong Da District, Hanoi, 100000, Viet Nam
Quan-Hoang Vuong
Centre for Interdisciplinary Social Research, Phenikaa University, Yen Nghia Ward, Ha Dong District, Hanoi 100803, Viet Nam
Trung Tran
Vietnam Academy for Ethnic Minorities, Hanoi 100000, Viet Nam
Minh-Hoang Nguyen
Centre for Interdisciplinary Social Research, Phenikaa University, Yen Nghia Ward, Ha Dong District, Hanoi 100803, Viet Nam; AI for Social Data Lab, Vuong & Associates, 3/161 Thinh Quang, Dong Da District, Hanoi, 100000, Viet Nam
Manh-Tung Ho
Centre for Interdisciplinary Social Research, Phenikaa University, Yen Nghia Ward, Ha Dong District, Hanoi 100803, Viet Nam; AI for Social Data Lab, Vuong & Associates, 3/161 Thinh Quang, Dong Da District, Hanoi, 100000, Viet Nam
Manh-Toan Ho
Centre for Interdisciplinary Social Research, Phenikaa University, Yen Nghia Ward, Ha Dong District, Hanoi 100803, Viet Nam; AI for Social Data Lab, Vuong & Associates, 3/161 Thinh Quang, Dong Da District, Hanoi, 100000, Viet Nam; Corresponding author at: Centre for Interdisciplinary Social Research, Phenikaa University, Yen Nghia Ward, Ha Dong District, Hanoi 100803, Viet Nam.
The bayesvl R package implements Bayesian analysis using the Stan’s no-U-turn sampler (NUTS). Two distinguished functions that the bayesvl package complements to other developed packages and software performing Bayesian analysis are the “relationship tree” construction protocol and the ability to visualize estimated posteriors graphically. The “relationship tree” construction protocol is inspired by the Bayesian network approach that illustrates the model through directed acyclic graphs (DAGs), while the graphical visualization capability of the bayesvl package is built upon the graphical generation power of the ggplot2 package. After constructing a “relationship tree”, the posterior can be automatically simulated and graphically visualized with some simple codes. With two distinctive characteristics, the bayesvl package’s main aims are to improve user experience (chance of creativity and serendipity; productivity, flexibility and intuitiveness; and scientific communication power) and pedagogical effectiveness in statistics and other sciences (cognitive instruction strategy; analytical reasoning and argument understanding skills; and idea exchange between social sciences and mathematical education).