Description Usage Arguments Value Author(s) References Examples
View source: R/gera.pa.model.R
This function is called from 'gera.pa' function. It receives a BN structure and a data set, build a PA input model string based on BN structure and return it.
1 | gera.pa.model(bn.structure, data.to.work)
|
bn.structure |
is a BN structure learned from data. |
data.to.work |
is a data set containing the variables of the BN. |
the PA input modeo string
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 | # Clean environment
closeAllConnections()
rm(list=ls())
# Set enviroment
# setwd("To your working directory")
# Load packages
library(bnpa)
library(bnlearn)
# load data sets from package
data(dataQualiN)
# Show first lines
head(dataQualiN)
# Learn BN structure
bn.structure <- hc(dataQualiN)
bnlearn::graphviz.plot(bn.structure)
# Set variables
# Generates the PA model from bn structure
pa.model <- gera.pa.model(bn.structure, dataQualiN)
pa.model
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.