<div dir="ltr">Dear Grads Users,<div><br></div><div>Recently I asked a question about correction in a script building contingency tables (Asnwered by Dr. Eric Altshuler). I am attaching the script at the end of the mail.</div>
<div><br></div><div>But this script is for when the model and observation temporal and spatial extent are same. Even the model and observations resolution is same for this script to run. Can anyone tell me how to build 2*2 contingency tables for when the model and observations datasets are at different resolutions and extent. </div>
<div><br></div><div>With regards,</div><div><div style="font-family:arial,sans-serif;font-size:13px">Amulya Chevuturi</div><div style="font-family:arial,sans-serif;font-size:13px">School of Environmental Sciences</div><div style="font-family:arial,sans-serif;font-size:13px">
Jawaharlal Nehru University</div><div style="font-family:arial,sans-serif;font-size:13px">New Delhi, India</div></div><div><br></div><div><br></div><div>******Script for contingency table*************</div><div><div><div style="font-family:arial,sans-serif;font-size:13px">
'reinit'</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">'open model.ctl'</div><div style="font-family:arial,sans-serif;font-size:13px">
'set t 3'</div><div style="font-family:arial,sans-serif;font-size:13px">'set y 57 208'</div><div style="font-family:arial,sans-serif;font-size:13px">'set x 72 228'</div><div style="font-family:arial,sans-serif;font-size:13px">
'define a = rain'</div><div style="font-family:arial,sans-serif;font-size:13px">'close 1'</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
'open observation.ctl'</div><div style="font-family:arial,sans-serif;font-size:13px">'set t 3'</div><div style="font-family:arial,sans-serif;font-size:13px">'set y 57 208'</div><div style="font-family:arial,sans-serif;font-size:13px">
'set x 72 228'</div><div style="font-family:arial,sans-serif;font-size:13px">'define b = prec'</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
n1=0</div><div style="font-family:arial,sans-serif;font-size:13px">n2=0</div><div style="font-family:arial,sans-serif;font-size:13px">n3=0</div><div style="font-family:arial,sans-serif;font-size:13px">n4=0</div><div style="font-family:arial,sans-serif;font-size:13px">
j=72<br></div><div style="font-family:arial,sans-serif;font-size:13px">while (j<=228)</div><div style="font-family:arial,sans-serif;font-size:13px">'set y 'j</div><div style="font-family:arial,sans-serif;font-size:13px">
i=57</div><div style="font-family:arial,sans-serif;font-size:13px">while (i<=208)</div><div style="font-family:arial,sans-serif;font-size:13px">'set x 'i</div><div style="font-family:arial,sans-serif;font-size:13px">
'd a'</div>c=subwrd(result,4)<div style="font-family:arial,sans-serif;font-size:13px">'d b'</div><div style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial;font-size:small">d=subwrd(result,4)</span><br>
</div><div style="font-family:arial,sans-serif;font-size:13px">if(c>0&d>0)</div><div style="font-family:arial,sans-serif;font-size:13px">n1=n1+1</div><div style="font-family:arial,sans-serif;font-size:13px">else</div>
<div style="font-family:arial,sans-serif;font-size:13px">if(c<=0&d<=0)</div><div style="font-family:arial,sans-serif;font-size:13px">n2=n2+1</div><div style="font-family:arial,sans-serif;font-size:13px">else</div>
<div style="font-family:arial,sans-serif;font-size:13px">if(c<=0&d>0)</div><div style="font-family:arial,sans-serif;font-size:13px">n3=n3+1</div><div style="font-family:arial,sans-serif;font-size:13px">else</div>
<div style="font-family:arial,sans-serif;font-size:13px">if(c>0&d<=0)</div><div style="font-family:arial,sans-serif;font-size:13px">n4=n4+1</div><div style="font-family:arial,sans-serif;font-size:13px">endif</div>
<div style="font-family:arial,sans-serif;font-size:13px">endif</div><div style="font-family:arial,sans-serif;font-size:13px">endif</div><div style="font-family:arial,sans-serif;font-size:13px">endif</div><div style="font-family:arial,sans-serif;font-size:13px">
i=i+1</div><div style="font-family:arial,sans-serif;font-size:13px">endwhile</div><div style="font-family:arial,sans-serif;font-size:13px">j=j+1</div><div style="font-family:arial,sans-serif;font-size:13px">endwhile</div>
<div style="font-family:arial,sans-serif;font-size:13px">say n1</div><div style="font-family:arial,sans-serif;font-size:13px">say n2</div><div style="font-family:arial,sans-serif;font-size:13px">say n3</div><div style="font-family:arial,sans-serif;font-size:13px">
say n4</div></div><div style="font-family:arial,sans-serif;font-size:13px">'close 1'</div></div></div>