Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

setNodeModels

Set Node Properties Using Model Objects


Description

Set node properties using pre-defined model objects. Model objects may be imported from other programs, but need to be valid model objects with the additional restriction that the responses and independent variables must be named nodes in the network. This will NOT create a network from a list of models. For that, see HydeNetwork

Usage

setNodeModels(network, ...)

Arguments

network

A HydeNetwork object

...

Model objects to be incorporated into network

Author(s)

Jarrod Dalton and Benjamin Nutter

Examples

data(PE, package="HydeNet")
Net <- HydeNetwork(~ wells + 
                     pe | wells + 
                     d.dimer | pregnant*pe + 
                     angio | pe + 
                     treat | d.dimer*angio + 
                     death | pe*treat) 
print(Net)

g1 <- lm(wells ~ 1, data=PE)
g2 <- glm(pe ~ wells, data=PE, family="binomial")
g3 <- lm(d.dimer ~ pe + pregnant, data=PE)
g4 <- xtabs(~ pregnant, data=PE)
g5 <- glm(angio ~ pe, data=PE, family="binomial")
g6 <- glm(treat ~ d.dimer + angio, data=PE, family="binomial")
g7 <- glm(death ~ pe + treat, data=PE, family="binomial")

Net2 <- setNodeModels(Net, g1, g2, g3, g4, g5, g6, g7) 
print(Net)

writeNetworkModel(Net, pretty=TRUE)

HydeNet

Hybrid Bayesian Networks Using R and JAGS

v0.10.11
MIT + file LICENSE
Authors
Jarrod E. Dalton <daltonj@ccf.org> and Benjamin Nutter <benjamin.nutter@gmail.com>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.