| Type: | Package |
| Title: | Visually Learning the Graphical Structure of Bayesian Networks and Performing MCMC with 'Stan' |
| Version: | 1.0.0 |
| Date: | 2025-05-17 |
| Author: | Viet-Phuong La [aut, cre], Quan-Hoang Vuong [aut] |
| Maintainer: | Viet-Phuong La <lvphuong@gmail.com> |
| Imports: | coda, bnlearn, ggplot2, bayesplot, viridis, reshape2 |
| Suggests: | loo (≥ 2.0.0) |
| Depends: | R (≥ 3.5.0), rstan (≥ 2.10.0), StanHeaders (≥ 2.18.0), stats, graphics, methods |
| Description: | Provides users with its associated functions for pedagogical purposes in visually learning Bayesian networks and Markov chain Monte Carlo (MCMC) computations. It enables users to: a) Create and examine the (starting) graphical structure of Bayesian networks; b) Create random Bayesian networks using a dataset with customized constraints; c) Generate Stan code for structures of Bayesian networks for sampling the data and learning parameters; d) Plot the network graphs; e) Perform Markov chain Monte Carlo computations and produce graphs for posteriors checks. The package refers to one reference item, which describes the methods and algorithms: Vuong, Quan-Hoang and La, Viet-Phuong (2019) <doi:10.31219/osf.io/w5dx6> The 'bayesvl' R package. Open Science Framework (May 18). |
| License: | GPL (≥ 3) |
| BugReports: | https://github.com/sshpa/bayesvl/issues |
| URL: | https://github.com/sshpa/bayesvl |
| NeedsCompilation: | no |
| Packaged: | 2025-05-17 14:39:12 UTC; lvphuong |
| Repository: | CRAN |
| Date/Publication: | 2025-05-17 14:50:06 UTC |
BayesVL: Visual Learning and Bayesian Statistical Analysis in R
Description
An R package for visually constructing graphical models of Bayesian networks and performing Hamiltonian Monte Carlo (HMC) via Stan, using functions such as bvl_model2Stan and bvl_modelFit.
Details
| Package: | bayesvl |
| Type: | Package |
| Version: | 0.8.0 |
| Date: | 2019-05-13 |
| License: | GPL-3 |
| Website: | https://github.com/sshpa/bayesvl |
Author(s)
Quan-Hoang Vuong, Viet-Phuong La
References
For documentation, case studies, worked examples, and other tutorial materials, visit the References section on our GitHub:
For case studies using the package in research articles, see:
See Also
bayesvl-class,
bvl_modelFit,
bvl_model2Stan
Examples
# Create a new model
model <- bayesvl()
# Add observed data nodes
model <- bvl_addNode(model, "Lie", "binom")
model <- bvl_addNode(model, "B", "binom")
model <- bvl_addNode(model, "C", "binom")
model <- bvl_addNode(model, "T", "binom")
# Add directed arcs
model <- bvl_addArc(model, "B", "Lie", "slope")
model <- bvl_addArc(model, "C", "Lie", "slope")
model <- bvl_addArc(model, "T", "Lie", "slope")
# View model summary
summary(model)
DKAP1061 Dataset
Description
DKAP1061 is a dataset from a survey on students' digital competence, including demographic and educational background variables.
Usage
data(DKAP1061)
Format
A data frame with multiple columns. Selected variables:
ecosttStudent's family economic status.
edufatFather's education level.
edumotMother's education level.
ictDigital competence score.
mean_drMean digital resources.
mean_ictMean ICT skills score.
mean_ilMean information literacy score.
mean_pprMean personal productivity rating.
mean_udcrMean use of digital content/resources.
schoolidSchool ID.
schidSchool code (alternative to schoolid).
sexStudent's gender (1 = female, 2 = male).
stuidStudent ID.
a1Not yet documented.
a10Not yet documented.
a11Not yet documented.
a12Not yet documented.
a13Not yet documented.
a14Not yet documented.
a2Not yet documented.
a3Not yet documented.
a4Not yet documented.
a5Not yet documented.
a6Not yet documented.
a7Not yet documented.
a8Not yet documented.
a9Not yet documented.
b1Not yet documented.
b10Not yet documented.
b11Not yet documented.
b12Not yet documented.
b13Not yet documented.
b14Not yet documented.
b15_1Not yet documented.
b15_2Not yet documented.
b15_3Not yet documented.
b15_4Not yet documented.
b15_5Not yet documented.
b15_6Not yet documented.
b15_7Not yet documented.
b15_8Not yet documented.
b16_1Not yet documented.
b16_2Not yet documented.
b16_3Not yet documented.
b16_4Not yet documented.
b16_5Not yet documented.
b16_6Not yet documented.
b16_7Not yet documented.
b16_8Not yet documented.
b17_1Not yet documented.
b17_2Not yet documented.
b17_3Not yet documented.
b17_4Not yet documented.
b17_5Not yet documented.
b17_6Not yet documented.
b17_7Not yet documented.
b17_8Not yet documented.
b18_1Not yet documented.
b18_2Not yet documented.
b18_3Not yet documented.
b18_4Not yet documented.
b18_5Not yet documented.
b18_6Not yet documented.
b18_7Not yet documented.
b18_8Not yet documented.
b18_9Not yet documented.
b2Not yet documented.
b3Not yet documented.
b4Not yet documented.
b5Not yet documented.
b6Not yet documented.
b7Not yet documented.
b8Not yet documented.
b9Not yet documented.
c1Not yet documented.
c10Not yet documented.
c11Not yet documented.
c12Not yet documented.
c2Not yet documented.
c3Not yet documented.
c4Not yet documented.
c5Not yet documented.
c6Not yet documented.
c7Not yet documented.
c8Not yet documented.
c9Not yet documented.
d1Not yet documented.
d10Not yet documented.
d11Not yet documented.
d12Not yet documented.
d13Not yet documented.
d14Not yet documented.
d15Not yet documented.
d16Not yet documented.
d2Not yet documented.
d3Not yet documented.
d4Not yet documented.
d5Not yet documented.
d6Not yet documented.
d7Not yet documented.
d8Not yet documented.
d9Not yet documented.
e1Not yet documented.
e10Not yet documented.
e11Not yet documented.
e2Not yet documented.
e3Not yet documented.
e4Not yet documented.
e5Not yet documented.
e6Not yet documented.
e7Not yet documented.
e8Not yet documented.
e9Not yet documented.
f1Not yet documented.
f2Not yet documented.
f3Not yet documented.
f4Not yet documented.
f5Not yet documented.
f6Not yet documented.
f7Not yet documented.
f8_1Not yet documented.
f8_2Not yet documented.
f8_3Not yet documented.
f8_4Not yet documented.
f8_5Not yet documented.
g1Not yet documented.
g10_1Not yet documented.
g10_2Not yet documented.
g10_3Not yet documented.
g11Not yet documented.
g12Not yet documented.
g13Not yet documented.
g14Not yet documented.
g15Not yet documented.
g16Not yet documented.
g17Not yet documented.
g18Not yet documented.
g2Not yet documented.
g3_1Not yet documented.
g3_2Not yet documented.
g3_3Not yet documented.
g3_4Not yet documented.
g4_1Not yet documented.
g4_2Not yet documented.
g4_3Not yet documented.
g4_4Not yet documented.
g4_5Not yet documented.
g4_6Not yet documented.
g5_1Not yet documented.
g5_2Not yet documented.
g5_3Not yet documented.
g5_4Not yet documented.
g5_5Not yet documented.
g5_6Not yet documented.
g6_1Not yet documented.
g6_2Not yet documented.
g6_3Not yet documented.
g6_4Not yet documented.
g6_5Not yet documented.
g6_6Not yet documented.
g7_1Not yet documented.
g7_2Not yet documented.
g7_3Not yet documented.
g8_1Not yet documented.
g8_2Not yet documented.
g8_3Not yet documented.
g9Not yet documented.
h1_1Not yet documented.
h1_2Not yet documented.
h1_3Not yet documented.
h1_4Not yet documented.
h1_5Not yet documented.
h1_6Not yet documented.
h1_7Not yet documented.
h2Not yet documented.
h3Not yet documented.
h4_1Not yet documented.
h4_2Not yet documented.
h4_3Not yet documented.
h5Not yet documented.
h6_1Not yet documented.
h6_2Not yet documented.
h6_3Not yet documented.
h6_4Not yet documented.
h7_1Not yet documented.
h7_2Not yet documented.
h7_3Not yet documented.
h7_4Not yet documented.
Note: Variables starting with a, b, c, d, f, g, h are omitted from this documentation.
References
For documentation, case studies, and examples, visit the GitHub repository:
Examples
data(DKAP1061)
# Preview the dataset
head(DKAP1061)
Legends345 data
Description
Legends345.
Usage
data(Legends345)
Format
O : Whether or not happy ending for main character
VB : Whether or not the main character behaves in accordance with the core values of Buddhism
VC : Whether or not the main character behaves in accordance with the core values of Confucianism
VT : Whether or not the main character behaves in accordance with the core values of Taoism
Lie : Whether or not the main character tells lie
Viol : Whether or not the main character commits acts of violence
Int1 : Whether there are interventions from the supernatural world
Int2 : Whether there are interventions from the human world
References
For documentation, case studies, worked examples, and other tutorial materials, visit the References section on our GitHub:
For case studies using the package in research articles, see:
Examples
data(Legends345)
data1 <- Legends345
head(data1)
bnlearn interface for bayesvl objects
Description
Provides the interface to the functions in the bnlearn package for network diagnostics of an object of class bayesvl.
Usage
# Interface to bn.fit function to fit the parameters of
# a Bayesian network conditional on its structure.
bvl_bnBayes(dag, data = NULL, method = "bayes", iss = 10, ...)
# Interface to bnlearn score function to compute the score of the Bayesian network.
bvl_bnScore(dag, data = NULL, ...)
# Interface to arc.strength function to measure the strength of the probabilistic
# relationships expressed by the arcs of a Bayesian network.
bvl_bnStrength(dag, data = NULL, criterion = "x2", ...)
# Interface to bn.fit.barchart function to plot fit
# the parameters of a Bayesian network conditional on its structure.
bvl_bnBarchart(dag, data = NULL, method = "bayes", iss = 10, ...)
bvl_modelData (net, data)
bvl_compareLoo (dag1, dag2, ...)
bvl_compareWAIC (dag1, dag2, ...)
Arguments
dag |
an object of class |
data |
a data frame containing the variables in the model. |
method |
a character string, either mle for Maximum Likelihood parameter estimation or bayes for Bayesian parameter estimation (currently implemented only for discrete data). |
iss |
a numeric value, the imaginary sample size used by the bayes method to estimate the conditional probability tables associated with discrete nodes |
criterion |
a character string, the method using for measuring |
net |
network graph |
dag1 |
first model to compare |
dag2 |
second model to compare |
... |
extra arguments from the generic method |
Value
bvl_bnScore() return a number, value of score.
Author(s)
La Viet-Phuong, Vuong Quan-Hoang
References
For documentation, case studies, worked examples, and other tutorial materials, visit the References section on our GitHub:
For case studies using the package in research articles, see:
Utilities to manipulate graphs
Description
Manipulate directed acyclic graph of an object of class bayesvl.
Usage
# added a new node to the graph.
bvl_addNode(dag, name, dist = "norm", priors = NULL, fun = NULL, out_type = NULL,
lower = NULL, upper=NULL, test = NULL)
# added a new path between nodes to the graph.
bvl_addArc(dag, from, to, type = "slope", priors = NULL, fun = NULL)
# added a new path between nodes to the graph.
bvl_addArc(dag, from, to, type = "slope", priors = NULL, fun = NULL)
Arguments
dag |
an object of class |
name |
a character string, the name of a node. |
dist |
a character string, distribution code of the node ( |
priors |
a vector of string, the priors of the node or path. |
fun |
a character string, the transform function of the node. |
out_type |
a character string, the variable data type ( |
lower |
integer or real, the lower bound of variable data type ( |
upper |
integer or real, the upper bound of variable data type ( |
test |
a vector of testing values for variable. |
from |
a character string, the name of node the path connect from. |
to |
a character string, the name of node the path connect to. |
type |
a character string, the path type between nodes ( |
Value
bvl_addNode(), bvl_addArc() return object class bayesvl.
Author(s)
La Viet-Phuong, Vuong Quan-Hoang
References
For documentation, case studies, worked examples, and other tutorial materials, visit the References section on our GitHub:
For case studies using the package in research articles, see:
Examples
dag = bayesvl()
# add nodes to dag
dag = bvl_addNode(dag, "node1")
dag = bvl_addNode(dag, "node2")
# add the path between two nodes
dag = bvl_addArc(dag, "node1", "node2")
summary(dag)
Plot utilities for bayesvl objects
Description
Provides plot methods and the interface to the MCMC module in the bayesplot package for plotting MCMC draws and diagnostics for an object of class bayesvl.
Usage
# Plot network diagram to visualize the model
bvl_bnPlot(dag, ...)
# Plots historgram of regression parameters computed from posterior draws in grid layout
bvl_plotParams (dag, row = 2, col = 2, credMass = 0.95, params = NULL)
# The interface to mcmc_intervals for plotting uncertainty intervals
# computed from posterior draws
bvl_plotIntervals (dag, params = NULL, fun = "mean", prob = 0.8,
prob_outer = 0.95, color_scheme = "blue", labels = NULL)
# The interface to mcmc_intervals for plotting density computed from posterior draws
bvl_plotAreas (dag, params = NULL, fun = "mean",
prob = 0.8, prob_outer = 0.95, color_scheme = "blue", labels = NULL)
bvl_plotPairs (dag, params = NULL, size = 1, color_scheme = "blue", labels = NULL)
bvl_plotDensity (dag, params = NULL, size = 1, labels = NULL)
bvl_plotDensity2d(dag, x, y, color = NULL, color_scheme = "red", labels = NULL)
bvl_plotTrace (dag, params = NULL)
bvl_plotDiag (dag)
bvl_plotGelman (dag, params = NULL)
bvl_plotGelmans (dag, params = NULL, row = 2, col = 2)
bvl_plotAc ( dag, params = NULL)
bvl_plotAcf ( dag, params = NULL)
bvl_plotAcfs ( dag, params = NULL, row = 2, col = 2)
bvl_plotAcf_Bar ( dag, params = NULL, color_scheme="pink",labels=NULL)
bvl_plotDensOverlay (dag, n = 200, color_scheme = "blue")
bvl_plotMCMCDiag ( dag, parName, saveName=NULL , saveType="jpg")
bvl_plotPPC (dag, fun = "stat", stat = "mean", color_scheme = "blue")
bvl_plotTest (dag, y_name, test_name, n = 200, color_scheme = "blue")
Arguments
dag |
an object of class |
params |
Optional: character vector of parameter names. |
fun |
Optional: statistic function. |
stat |
Optional: the plotting function to call. |
prob |
Optional: the probability mass to include in the inner interval. Default is 0.8. |
prob_outer |
Optional: the probability mass to include in the outer interval. Default is 0.95. |
row |
Optional: number of rows of grid layout. |
col |
Optional: number of columns of grid layout. |
credMass |
Optional: specifying the mass within the credible interval. Default is 0.89. |
size |
Optional: the size of line width. |
color_scheme |
Optional: color scheme. Default is "blue" |
... |
extra arguments from the generic method |
y_name |
a character string. Name of outcome variable |
test_name |
a character string. Name of test variable and test value |
n |
number of yrep values to plot |
x |
a character string. Name of x parameter to pair with |
y |
a character string. Name of y parameter to pair with |
color |
a character string. Variable for color of points on density plot |
labels |
Optional: character vector of parameter labels. |
parName |
parameter name for plotting. |
saveName |
file name for exporting plot. |
saveType |
type of file name for exporting plot (default is 'jpg'). |
Value
bvl_plotIntervals(), bvl_plotPairs() return a ggplot object that can be further customized using the ggplot2 package.
Author(s)
La Viet-Phuong, Vuong Quan-Hoang
References
For documentation, case studies, worked examples, and other tutorial materials, visit the References section on our GitHub:
For case studies using the package in research articles, see:
Examples
## create network model
model <- bayesvl()
## add the observed data nodes
model <- bvl_addNode(model, "O", "binom")
model <- bvl_addNode(model, "Lie", "binom")
model <- bvl_addNode(model, "Viol", "binom")
model <- bvl_addNode(model, "VB", "binom")
model <- bvl_addNode(model, "VC", "binom")
model <- bvl_addNode(model, "VT", "binom")
model <- bvl_addNode(model, "Int1", "binom")
model <- bvl_addNode(model, "Int2", "binom")
## add the tranform data nodes and arcs as part of the model
model <- bvl_addNode(model, "B_and_Viol", "trans")
model <- bvl_addNode(model, "C_and_Viol", "trans")
model <- bvl_addNode(model, "T_and_Viol", "trans")
model <- bvl_addArc(model, "VB", "B_and_Viol", "*")
model <- bvl_addArc(model, "Viol", "B_and_Viol", "*")
model <- bvl_addArc(model, "VC", "C_and_Viol", "*")
model <- bvl_addArc(model, "Viol", "C_and_Viol", "*")
model <- bvl_addArc(model, "VT", "T_and_Viol", "*")
model <- bvl_addArc(model, "Viol", "T_and_Viol", "*")
model <- bvl_addArc(model, "B_and_Viol", "O", "slope")
model <- bvl_addArc(model, "C_and_Viol", "O", "slope")
model <- bvl_addArc(model, "T_and_Viol", "O", "slope")
model <- bvl_addArc(model, "Viol", "O", "slope")
model <- bvl_addNode(model, "B_and_Lie", "trans")
model <- bvl_addNode(model, "C_and_Lie", "trans")
model <- bvl_addNode(model, "T_and_Lie", "trans")
model <- bvl_addArc(model, "VB", "B_and_Lie", "*")
model <- bvl_addArc(model, "Lie", "B_and_Lie", "*")
model <- bvl_addArc(model, "VC", "C_and_Lie", "*")
model <- bvl_addArc(model, "Lie", "C_and_Lie", "*")
model <- bvl_addArc(model, "VT", "T_and_Lie", "*")
model <- bvl_addArc(model, "Lie", "T_and_Lie", "*")
model <- bvl_addArc(model, "B_and_Lie", "O", "slope")
model <- bvl_addArc(model, "C_and_Lie", "O", "slope")
model <- bvl_addArc(model, "T_and_Lie", "O", "slope")
model <- bvl_addArc(model, "Lie", "O", "slope")
model <- bvl_addNode(model, "Int1_or_Int2", "trans")
model <- bvl_addArc(model, "Int1", "Int1_or_Int2", "+")
model <- bvl_addArc(model, "Int2", "Int1_or_Int2", "+")
model <- bvl_addArc(model, "Int1_or_Int2", "O", "varint")
## Plot network diagram to visualize the model
bvl_bnPlot(model)
Class bayesvl: Object Class for BayesVL Models
Description
An S4 class that represents a Bayesian model created using the bayesvl package.
This object is typically returned by functions such as bayesvl.
Slots
callOriginal function call that created the model.
nodesList of nodes in the model.
arcsList of arcs (edges) connecting the nodes.
parsList of model parameters.
stanfitAn object of class
stanfit, representing the fitted Stan model.rawdataA data frame containing observed input data.
standataData list used for Stan sampling.
posteriorA data frame representation of posterior draws from the
stanfitobject.elapsedElapsed time for the MCMC simulation (in seconds).
Methods
showsignature(object = "bayesvl"): Prints a default summary of the model.summaryDisplays a more detailed overview of the model structure and output.
References
For documentation, case studies, worked examples, and other tutorial materials, visit our GitHub:
For case studies using the package in research articles, refer to:
See Also
Examples
# Design the model in a directed acyclic graph
model <- bayesvl()
# Add observed data nodes to the model
model <- bvl_addNode(model, "Lie", "binom")
model <- bvl_addNode(model, "B", "binom")
model <- bvl_addNode(model, "C", "binom")
model <- bvl_addNode(model, "T", "binom")
# Add paths between nodes
model <- bvl_addArc(model, "B", "Lie", "slope")
model <- bvl_addArc(model, "C", "Lie", "slope")
model <- bvl_addArc(model, "T", "Lie", "slope")
# Summarize the model
summary(model)
News for Package 'bayesvl'
Description
This page documents major changes and updates in the development of the bayesvl package.
Changes in version 1.0.0
Updated many functions.
Added posterior predictive check (PPC) support.
Changes in version 0.9.0
Added WAIC estimation functions.
Added LOO 2.0 estimation functions.
Added model comparison functions.
Updated
.Rddocumentation and other metadata.
Changes in version 0.8.5
Updated
.Rddocumentation and other metadata.Fixed bugs for CRAN submission.
Changes in version 0.7.6
Fixed error in single-node models.
Updated
.Rddocumentation and other metadata.
Changes in version 0.7.0
Fixed alpha intercept in varying intercept models.
Fixed
lower = 0constraint for varying intercept models.Renamed
net2stan.rtobayesvl2stan.r.Added WAIC calculation support.
Changes in version 0.6.8
Added arc templates.
Added model validation functions.
Added automatic generation of data list for Stan.
Added log-likelihood comparison function.
Changes in version 0.6.5
Supported node type
Dummyfor temporary parameters.Supported node type
Transfor transformed data.Supported custom
generated quantitiesblock.Supported
y_repandlog_likoutput.Updated
README.md.
Changes in version 0.6.0
Added more distribution templates.
Updated Stan code generator from network graph.
Updated
README.md.
Changes in version 0.5.1
Numerous documentation updates.
Changes in version 0.5.0
Added functions for Stan code generation.
Added distribution templates.
Updated
README.md.
Changes in version 0.3.0
Added
bnPlot(),bnScore(),bnStrength()to interface withbnlearn.Added utilities to convert between bayesvl and bnlearn structures.
Updated
README.md.
Changes in version 0.2.0
Added functions to add/remove nodes and arcs in the network graph.
Added network initialization function.
Implemented
bayesvlclass.First fully documented release.
Changes in version 0.1.0
Initial package description and metadata.
First public release.
Build Stan Models from Directed Acyclic Graphs
Description
Functions to generate Stan code and run simulations using a model object of class bayesvl, which represents a Bayesian directed acyclic graph (DAG).
Usage
bvl_model2Stan(dag, ppc = "")
bvl_modelFit(dag, data, warmup = 1000, iter = 5000, chains = 2, ppc = "", ...)
bvl_stanPriors(dag)
bvl_stanParams(dag)
bvl_formula (dag, nodeName, outcome = T, re = F)
bvl_stanLikelihood (dag)
bvl_stanLoo (dag, ...)
bvl_stanWAIC (dag, ...)
Arguments
dag |
An object of class |
data |
A data frame or list containing the observed data for model fitting. |
warmup |
Number of warmup iterations; defaults to half of |
iter |
Total number of iterations for sampling. Default is 5000. |
chains |
Number of MCMC chains to run. Default is 2. |
ppc |
Optional: a character string containing Stan code for posterior predictive checks. |
... |
Additional arguments passed to underlying functions. |
nodeName |
The name of the node to generate formula for. |
outcome |
Logical. Whether to include outcome distribution. Default is |
re |
Logical. Whether to recursively trace all upstream nodes. Default is |
Value
The following outputs are returned depending on the function used:
bvl_model2Stan: Returns a character string containing the generated Stan model code.bvl_modelFit: Returns an object of classbayesvlwith the following slots:model: The Stan model code.stanfit: Astanfitobject returned byrstan.standata: The data list used in sampling.pars: A list of parameter names being monitored.formula: The formula representation of the model.
bvl_stanPriors: Returns a character string of the prior distributions used in the model.bvl_stanParams: Returns a character string of parameter block content for Stan.bvl_formula: Returns the formula associated with the specified node.
Author(s)
La Viet-Phuong, Vuong Quan-Hoang
References
For documentation, case studies, worked examples, and other tutorial materials, see:
Examples
# Design the model using a directed acyclic graph
model <- bayesvl()
model <- bvl_addNode(model, "Lie", "binom")
model <- bvl_addNode(model, "B", "binom")
model <- bvl_addNode(model, "C", "binom")
model <- bvl_addNode(model, "T", "binom")
model <- bvl_addArc(model, "B", "Lie", "slope")
model <- bvl_addArc(model, "C", "Lie", "slope")
model <- bvl_addArc(model, "T", "Lie", "slope")
# Generate Stan model code
model_string <- bvl_model2Stan(model)
cat(model_string)
# Display priors in generated Stan model
bvl_stanPriors(model)
Dataset on Health, Insurance, and Financial Destitution in Vietnam
Description
A dataset of 1,042 inpatients from hospitals in Northern Vietnam, collected over 20 months (August 2014 – March 2016). The dataset covers healthcare access, health insurance, treatment costs, financial burden, and socio-demographic variables. It has been used in multiple peer-reviewed publications.
Usage
data(data1042)
Format
A data frame with 1,042 observations and 45 variables. Selected variables:
AgePatient's age.
BurdenFinancial burden after treatment.
DaysLength of hospital stay.
DcostDaily hospital cost.
EduEducational attainment.
EndTreatment outcome.
IfHigherExpected financial impact if treatment continued.
IllnessSeverity/type of illness.
IncomeAnnual income.
InsuredWhether the patient had insurance.
PcharPortion covered by charity.
PincPortion covered by income.
PinsPortion covered by insurance reimbursement.
PloanPortion covered by loans.
ResRegion of residence.
SESSocioeconomic status.
SatInsSatisfaction with insurance.
SavingPercentage of savings used.
SexPatient's gender (1 = female, 2 = male).
SpentTotal amount spent on treatment.
AvgCostNot yet documented.
Dcost_USDNot yet documented.
EnvLNot yet documented.
HospitalNot yet documented.
IDNot yet documented.
Ill2Not yet documented.
IncRankNot yet documented.
Income_USDNot yet documented.
InsGapNot yet documented.
InsLNot yet documented.
InsL2Not yet documented.
JcondNot yet documented.
LoanLNot yet documented.
MaxInsNot yet documented.
SatServNot yet documented.
SenvNot yet documented.
Spent_USDNot yet documented.
SrelNot yet documented.
StayNot yet documented.
StreatNot yet documented.
WkYrsNot yet documented.
References
Ho, M.T.; La, V.P.; Nguyen, M.H.; Vuong, Q.H. et al. (2019). "Health care, health insurance and economic destitution: A dataset of 1042 stories." Data, 4.
https://www.mdpi.com/journal/data
Related studies:
Vuong, Q.H. (2015). Be rich or don’t be sick. SpringerPlus. doi:10.1186/s40064-015-1279-x
Vuong, Q.H. (2016). Data on Vietnamese patients’ financial burdens. Data in Brief. doi:10.1016/j.dib.2016.09.040
Vuong, Q.H. (2017). Health insurance thresholds in Vietnam. Biomedical Research.
Examples
data(data1042)
# View structure
str(data1042)
# Summarize financial burden
table(data1042$Burden)