gera pa
# Clean environment
closeAllConnections()
rm(list=ls()
# Set enviroment
setwd("~/your working directory")
# Load packages
library(bnpa)
library(bnlearn)
# Load data sets from package
data1<-dataQuantC # Pre-Loaded
###################################################################################
# gera.pa.R - Generates a model as input to execute a Path Analysis (PA).
###################################################################################
# Load Continuous Data
data.to.work<-data1
# Learn BN structure
bn.structure <- hc(data.to.work)
# Set the name of a doc to save PA parameters
pa.name = "docPAHC"
# Set the name of an image with PA grapph
pa.imgname = "imgPAHC"
# Generates the PA model from bn structure
pa.model.fit <- gera.pa(bn.structure, data.to.work, pa.name, pa.imgname)
###################################################################################
RESULTS:
###################################################################################