BNET Procedure
Example 5.3 Parent-Child Bayesian Network
This example also uses the Iris data set that is available in the Sashelp library. In the following statements, STRUCTURE=PC results in a parent-child Bayesian network:
data mylib.iris;
set sashelp.iris;
run;
proc bnet data=mylib.iris numbin=3 structure=PC
prescreening=0 varselect=0
outnetwork=mylib.network;
target Species;
input PetalWidth PetalLength SepalLength SepalWidth/level=interval;
run;
The following statements produce Output 5.3.1, which shows the network structure. In the structure, PetalLength is the parent of Species, and Species is the parent of PetalWidth, SepalLength, and SepalWidth.
proc print data=mylib.network noobs label;
var _parentnode_ _childnode_;
where _type_="STRUCTURE";
run;
Output 5.3.1: Parent-Child Network Structure
| Parent Node | Child Node |
|---|---|
| PetalLength | Species |
| Species | PetalWidth |
| Species | SepalLength |
| Species | SepalWidth |
Last updated: August 06, 2026