'building a bayesian network with discrete and continuous parent variables in R

this is a follow up question to this simulating data with bayesian network in R using own specification

Say that now i would like to include both discrete and continuous parents so that my DAG contains Treatment and Death (the outcome), and both depend on Age (continuous) and Gender:

library(bnlearn)

# Specify DAG
net <- model2network("[treatment|age:gender][age][gender][death|treatment:age:gender]")
graphviz.plot(net)

enter image description here

How would i go about defining the conditional probability table in this case?

and likewise how could i define the outcome if it was a continuous variable instead of discrete?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source