BNET Procedure

Guiding Network

As you review the network, you notice that Pain is the parent of Age. Given the data, there is a strong relationship between Age and Pain that explains this connection, but the direction is not as desired. You can use the INNETWORK= option as in the following statements to guide the network so that both Treatment and Age become parents of Pain:

Data Innetwork;
    length parent $ 10;
    input Parent $ Child $ Flag;
datalines;
Treatment  Pain   1
Age        Pain   1

data mylib.innetwork;
   set innetwork;
run;
 proc bnet data=mylib.neuralgia numbin=3 outnetwork=mylib.network
     innetwork=mylib.innetwork;
     target Pain;
     input Treatment Sex/level=nominal;
     input Age Duration/level=interval;
     ods output varselect=varselect;
 run;

 proc print data=mylib.network noobs label;
     var _parentnode_ _childnode_;
     where _type_="STRUCTURE";
 run;

The revised network is as desired, with Treatment and Age as parents of Pain, as shown in Figure 4.

Figure 4: Structure with INNETWORK= Option

Parent NodeChild Node
TreatmentPain
AgePain


You can get the revised conditional probabilities associated with this network by running the following code:

 proc print data=mylib.network noobs label;
     var _parentnode_ _parentcond_ _childnode_ _childcond_ _value_;
     where _type_="PROBABILITY";
 run;

Figure 5 shows the revised conditional probabilities, given this network.

Figure 5: Probability Table with INNETWORK= Option

Parent NodeParent ConditionChild NodeChild ConditionValue
  TreatmentA0.33333
  TreatmentB0.33333
  TreatmentP0.33333
  Age<670.25397
  Age<750.50794
  Age>=750.23810
TreatmentAPainYes0.14286
Age<67PainYes0.14286
TreatmentAPainNo0.85714
Age<67PainNo0.85714
TreatmentAPainYes0.21429
Age<75PainYes0.21429
TreatmentAPainNo0.78571
Age<75PainNo0.78571
TreatmentAPainYes0.80000
Age>=75PainYes0.80000
TreatmentAPainNo0.20000
Age>=75PainNo0.20000
TreatmentBPainYes0.14286
Age<67PainYes0.14286
TreatmentBPainNo0.85714
Age<67PainNo0.85714
TreatmentBPainYes0.10000
Age<75PainYes0.10000
TreatmentBPainNo0.90000
Age<75PainNo0.90000
TreatmentBPainYes0.66667
Age>=75PainYes0.66667
TreatmentBPainNo0.33333
Age>=75PainNo0.33333
TreatmentPPainYes0.71429
Age<67PainYes0.71429
TreatmentPPainNo0.28571
Age<67PainNo0.28571
TreatmentPPainYes0.61538
Age<75PainYes0.61538
TreatmentPPainNo0.38462
Age<75PainNo0.38462
TreatmentPPainYes0.83333
Age>=75PainYes0.83333
TreatmentPPainNo0.16667
Age>=75PainNo0.16667


Last updated: August 06, 2026