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