'Identify probability of FMD outbreak from the result of 'dicision tree no 5 using Multiinput.
'Detail for Tree 5 : Cost of false negative: false positive = 5: 1 ' : Priors type: Calculated from training sample
: Adjusted Prior by cost: on
: Target category: non outbreak = 0. 5468, outbreak = 0.4532 : Resulting Tree: Total number of nodes = 1 3
: Total number oflevels i n tree = 3 : Total number of terminal nodes = 7
: Resubstitution: Risk estimate = 0.35, : SE of risk estimate =0.02 : Cross-validation: Risk estimate = 0.39, : SE of risk estimate =0.03 : Sensitivity (95%
Cl):
0.89 (0.83-0.96): Specificity (95% CI): 0.45 (0.4 1-0.49) 'Set up themes and field names
The View = av.GetActiveDoc
ProbFMDTheme = TheView.FindTheme("Probability ofFMD outbreak") ProbFld=ProbFMDTheme. GetFTab.FindField("Tree5 ")
Prob95UpFid=ProbFMDTheme.GetFTab.FindField("Tree5up") Prob95LowFld=ProbFMDTheme.GetFTab.FindField("Tree5low")
AmphoeTheme = TheView.FindTheme(" Amphoe")
AmphoeNameF!d = AmphoeTheme.GetFTab.FindField(" Amphoe_E ") ProvinceNameFld = AmphoeTheme.GetFTab.FindField( "Province" ) 'Get selected Grid
p = theView.GetDisplay.ReturnUserPoint
ProbFMDTheme.SelectbyPoint(p,#VT AB_SELTYPE_NEW) GS=ProbFMDTheme.GetFTab.GetSelection
1 67
Amphoe Theme.SelectB yTheme(ProbFMDTheme, #FT AB _REL TYPE_ CONT AINSTHECENTER OF ,0, #VT AB _SEL TYPE_NEW)
AmphoeGridTheme = AmphoeTheme.GetFfab.GetSelection AmphoeRec = AmphoeGridTheme.GetNextSet( - 1 )
AmphoeName = AmphoeTheme.GetFTab.ReturnValueString(AmphoeNameFld,AmphoeRec) ProvinceName = AmphoeTheme.GetFTab. ReturnValueString(ProvinceNameFld,AmphoeRec) Amp = AmphoeName.AsString
Pro=ProvinceName.AsString
if (ProbFMDTheme.CanFindByPoint) then keys = ProbFMDTheme.Fi ndByPoint(p) for each key in keys
found = TRUE idlabel = "Amphoe: "++Amp f=NIL
if (ProbFMDTheme.CanLabel) then
f=ProbFMDTheme.GetLabe!Field end
if(k>NIL)then
s = ProbFMDTheme .ReturnVal ueString(f.GetName. key) idlabel = idlabel++s
end
ProbFMDTheme. Identify(key. idlabel) end
1 68 1 6 8
Interface 1 2 "Prediction of FMD outbreak" button predicts the probability of foot and mouth
outbreak for selected grid with the information put in the message box using the result of
Decision tree analysis.
..._ Ptobahility a/ L .
l
iEn<et inlormatlon for� : Wldl19 S<:. Province N� Di::.tence from boldet of lde: (knt� 1 5C
Bl§.alo �ikm2k 3:J D� flom main road (km.): j · 5
OK
11!
jPercer� of � ...t.ich grow; field cropsf�l _ rsc-
Percent� of T ambon which I'= pUblic newt br�;;t i%t f5D Distance from � ma:kei fk;n_j: 1 2::
MsgBox.ProbFMDOutbreak
Pr�y of FMD outb<eok QC(1.IF inAm;:moe W� S.e PKwince Ncn · 18 75 �
' Calculate probability ofFMD outbreak from the result of decision tree no 5 using Multilnput
Detail for Tree 5 : Cost of false negative: false positive = 5 : 1
' : Priors type: Calculated from training sample
: Adjusted Prior by cost: on
: Target category: non outbreak = 0.5468
outbreak = 0.4532
: Resulting Tree: Total number of nodes = 1 3 : Total number oflevels in tree = 3 : Total number of terminal nodes = 7 : Resubstitution: Risk estimate = 0 3 5
: SE o f risk estimate =0.02
· Cross-validation: Risk estimate = 0.39
: SE of risk estimate =0 .03
: Sensitivity (95% CI): 0.89 (0.83-0.96)
: S pecificity (95% Cl): 0.45 (0.4 1 -0.49) 'Set up themes and field names
The View = av.GetActiveDoc
GridTheme = TheView.FindTheme("Amphoe grid") AmphoeTheme = TheView.FindTheme("Amphoe")
ProvinceNameFld = AmphoeTheme.GetFTab.FindField( " Province ") 'Get selected Tambon
GS = GridTheme.GetFTab.GetSelection if (GS .count = 0) then
MsgBox.Error ("Please select Amphoe grid where you want to know the prediction . " , "Prediction for FMD outbreak")
exit
end
for each g in GS
Amp hoe Theme. SelectB yTheme( GridTheme, #Ff AB _REL TYPE_ CONT AlNSTHECENTEROF ,0,
#VT AB_SELTYPE_NEW)
AmphoeGridTheme=AmphoeTheme.GetFTab.GetSelection AmphoeRec= AmphoeGridTheme.GetNextSet( - 1 )
AmphoeName=AmphoeTheme.GetFfab.ReturnValueStri ng(AmphoeNameFld,AmphoeRec) ProvinceName=AmphoeTheme. GetFTab.ReturnValueString(ProvinceNameFld,AmphoeRec)
Ans werBox = MsgBox.Multiinput( "Enter information for Amphoe : "++ AmphoeName.AsString+ " ,
Province "++ProYinceName.AsString,
" Prediction for FMD outbreak " ,
{ "Distance from border o f Laos (km.) : " , "Buffalo density ( km2) : " , "Distance from main road (km. ) : " ,
"Percentage o f households which grows field crops(%) : " ,
"Percentage of Tambon which has public news broadcast (%) : " . "Distance from livestock market
( km. ) : " } ,
{ .... ' " " ' " " ' " ".""' " " } )
· Check to see i f the user clicked cancel to end input. . . if ( Ans werBox.count < 1 ) then
exit
end
if (AnswerBox.Get(O) .AsNumber > 268) then
if (AnswerBox .Get( l ) .AsNumber > 1 .5 ) then
if (Ans werBox.Get(2).AsNumber > 6) then
1 69
MsgBox.Info("Probabi lty of FMD outbreak occur i n
Amphoe"++AmphoeName.AsStri ng+nl+ "Province"++ProvinceName.AsS tring+ " = 0 % " , "Prediction of FMD outbreak")
exit
Else
MsgBox. Info("Probabilty of FMD outbreak occur i n
Amphoe"++AmphoeName .AsStri ng+nl+"Province"++ProvinceName.AsString+ " = 1 5 .22 % . "+ni+Nl+ " { !\TEGATIVE } base on 89 % Sensiti vity, 45 % Spec ificity"+nl+
exit end else
" { POSITIVE } with 97 % Sensitivity, 38 % Speci ficity" ."Prediction of FMD outbreak")
MsgBox.Info("Probabilty of FMD o utbreak occur in
Amphoe"++AmphoeName.AsString+ni+"Province"++ProvinceName .AsS tring+" = 0 %", "Prediction of FMD outbreak")
exit end
end
i f (AnswerBox.Get(3) .AsNumber <= 6) then
if (AnswerBox.Get(4).AsNumber <= 63.5) then
MsgBox.Info("Probabilty of FMD outbreak occur i n
Amphoe"++AmphoeName.AsString+nl+"Province"++ProvinceName.AsString+" = 46.67 % . "+nl+nl+
" { POSITIVE } base on 89 % Sensitivity, 45 % Specificity" ,"Prediction of FMD outbreak")
exit else
MsgBox.Info("Probabilty of FMD o utbreak occur in
Amphoe"++AmphoeName.AsString+nl+"Province"++ProvinceName.AsString+" = 19.05 %."+nl+nl+
1 70 1 70
exit end end
if (AnswerBox.Get(5 ) . AsNumber <= 30) then
MsgBox.Info("Probabilty of FMD outbreak occur in
Amphoe"++AmphoeName.AsString+ni+"Province"++ProvinceName.AsString+" = 1 8 .75 % ."+nl+nl+
" { POSITIVE } base on 89 % Sensitivity, 45 % Specificity", "Prediction of FMD outbreak")
exit else
exit
end else
MsgB ox.Info("Probabilty of FMD outbreak occur in
Amphoe"++AmphoeName. AsString+nl+"Province"++ProvinceName.AsString+" 0 o/c " , "Prediction of
FMD outbreak") exit
end end
if (AnswerBox.Get(3).AsNu mber <= 6) then if (AnswerBox.Get(4).AsNumber <= 63.5 ) then
MsgBox.Info("Probabilty of FMD outbreak occur in
Amphoe"++AmphoeName.AsString+nl+ "Province"++ProvinceName.AsString+" = 46.67 %. "+nl+nl+ " ( POSITIVE } base on 89 % Sensitivity, 45 % Specificity","Prediction of FMD outbreak") exit
else
MsgBox.Info("Probabilty of FMD outbreak occur in
Amphoe"++AmphoeName . AsString+nl+"Province"++ProvinceName.AsString+" = 1 9 .05 %."+nl+nl+ " { POSITIVE } base on 89 % Sensitivity, 45 % Specificity", "Prediction of FMD outbreak") exit
end end
if (AnswerBox.Get(S).AsNumber <= 30) then
MsgBox.Info("Probabilty of FMD outbreak occur in
Amphoe"++AmphoeName .AsString+nl+"Province"++ProvinceName.AsS tring+" = 1 8.75 % ."+nl+nl+
" { POSITIVE } base on 89 % Sensitivity, 45 % Specificity","Prediction of FMD outbreak") exit
else
MsgBox.Info("Probabi lty of FMD outbreak occur in
Amphoe"++AmphoeName.AsString+ni+"Province"++ProvinceName.AsString+ " = 3.53 % ."+nl+nl+ " { NEGATIVE } base on 89 % Sensitivity, 45 % Specificity" ,"Prediction of FMD outbreak")
exit end end