<HTML dir=ltr><HEAD>
<META content="text/html; charset=unicode" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18852"></HEAD>
<BODY>
<DIV dir=ltr id=idOWAReplyText49786>
<DIV dir=ltr>Hi everyone,</DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>Thank you in advance for your advice. I am trying to convert a nb object containing a single area with no neighbours into a spatial weights list for input into WinBUGS using nb2WB().</DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>When I tried to run the CAR models in WinBUGS using the spatial weights list via R2WinBUGS, I encountered a WinBUGS trap. The error message was "Index out of range".<BR></DIV>
<DIV dir=ltr>I checked the adjacency matrix of the spatial weights list output object, and a zero integer was placed at the position corresponding to the area with no neighbours.</DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>When I re-ran the analysis after I changed my neighbourhood structure such that all areas had neighbours, the WinBUGS simulation ran fine.</DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>Is there a way to format the spatial weights list object via nb2WB() in a way that allows WinBUGS to read cases with no neighbours?</DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>In WinBUGS, if we were to enter the adjacency matrix manually it will be:</DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>
<P style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 8pt">#Here is where we tell BUGS how to set up the adjacency structure.<SPAN style="mso-spacerun: yes"> </SPAN>For example, site 1 neighbors sites 19,9, and 5.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 8pt">adj = c(<o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 8pt">19, 9, 5, <o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 8pt">10, 7, <o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 8pt">12, <o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 8pt">28, 20, 18, <o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 8pt">19, 12, 1, <o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 8pt"><SPAN style="mso-tab-count: 3"> </SPAN>#Site 6 has no neighbors<o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 8pt">17, 16, 13, 10, 2, </SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 8pt">and so on.</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none" class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 8pt">)<o:p></o:p></SPAN></P></DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>Here are my OS details:</DIV>
<DIV dir=ltr>R version 2.10.0 (2009-10-26) <BR>i386-pc-mingw32 </DIV>
<DIV dir=ltr>locale:<BR>[1] LC_COLLATE=English_Singapore.1252 LC_CTYPE=English_Singapore.1252 LC_MONETARY=English_Singapore.1252<BR>[4] LC_NUMERIC=C LC_TIME=English_Singapore.1252 </DIV>
<DIV dir=ltr>attached base packages:<BR>[1] stats graphics grDevices utils datasets methods base </DIV>
<DIV dir=ltr>other attached packages:<BR> [1] R2WinBUGS_2.1-16 spdep_0.4-52 nlme_3.1-96 coda_0.13-4 MASS_7.3-3 <BR> [6] Matrix_0.999375-32 lattice_0.17-26 spam_0.15-5 boot_1.2-41 maptools_0.7-26 <BR>[11] foreign_0.8-38 sp_0.9-47 deldir_0.0-10 </DIV>
<DIV dir=ltr>loaded via a namespace (and not attached):<BR>[1] grid_2.10.0 tools_2.10.0</DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>Best,</DIV>
<DIV dir=ltr>Xingli Giam</DIV></DIV>
<DIV> </DIV></BODY></HTML>