Description Usage Arguments Author(s) References Examples
This function receives a BN structure learned, the data set and some parameters and build a PA input model string. Then run the PA model using Structural Equation Model functions and export a PA graph and a PA model summary information.
1 2 | gera.pa(bn.structure, data.to.work, pa.name, pa.imgname, bn.algorithm,
bn.score.test, outcome.var)
|
bn.structure |
is a BN structure learned from data. |
data.to.work |
is a data frame containing the variables of the BN. |
pa.name |
is a variable to store the name of file to save PA parameters. |
pa.imgname |
is a variable to store the name of file to save PA graph. |
bn.algorithm |
is a list of algorithms to learn the BN structure. |
bn.score.test |
is a list of tests to be used during BN structure learning. |
outcome.var |
is the outcome variable. |
Elias Carvalho
Yves Rosseel (2012). lavaan: An R Package for Structural Equation Modeling. Journal of Statistical Software, 48(2),1-36.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ## Not run:
# Clean environment
closeAllConnections()
rm(list=ls())
# Set enviroment
# setwd("To your working directory")
# Load packages
library(bnpa)
# Load data sets from package
data(dataQualiN)
# Show first lines
head(dataQualiN)
# Learn BN structure
bn.structure <- bnlearn::hc(dataQualiN)
bnlearn::graphviz.plot(bn.structure)
# Set variables
pa.name<-"docPAHC"
pa.imgname<-"imgPAHC"
bn.algorithm<-"hc"
bn.score.test<-"aic-g"
outcome.var<-"D"
# Generates the PA model from bn structure
gera.pa(bn.structure, dataQualiN, pa.name, pa.imgname, bn.algorithm, bn.score.test, outcome.var)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.