<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><html>
<head>
<meta name="GENERATOR" content="IncrediMail 1.0">
<!--IncrdiXMLRemarkStart>
<IncrdiX-Info>
<X-FID>FLAVOR00-NONE-0000-0000-000000000000</X-FID>
<X-FVER></X-FVER>
<X-CNT>;</X-CNT>
</IncrdiX-Info>
<IncrdiXMLRemarkEnd-->
</head>
<BODY background="" bgColor=#ffffff style="BACKGROUND-POSITION: 0px 0px; FONT-FAMILY: Arial; FONT-SIZE: 12pt; MARGIN: 5px 10px 10px" scroll=yes ORGYPOS="0" X-FVER="3.0">
<TABLE id=INCREDIMAINTABLE border=0 cellSpacing=0 cellPadding=2 width="95%">
<TR>
<TD id=INCREDITEXTREGION width="100%" style="CURSOR: auto; FONT-FAMILY: Arial; FONT-SIZE: 12pt; PADDING-LEFT: 7px; PADDING-RIGHT: 7px"
>
<DIV>
<P>Dear list friends,</P>
<P>I should have written this msg before, but so many things happened in
between that made it impossible.... So, i have to thank everybody for the
help, suggestion and discussion on this issue. I have solved the problem
by using GeoDa to produce the adj. matrix and loaded the results of
WinBugs run into arcview to produce my maps. Anyway, i will continue to
learn R-software to avoid all these complications.</P>
<P>Regards,</P>
<P>orlando.</P></DIV>
<DIV> </DIV>
<DIV id=IncrediOriginalMessage><I>-------Original Message-------</I></DIV>
<DIV> </DIV>
<DIV id=receivestrings>
<DIV dir=ltr style="FONT-SIZE: 11pt" <i><B>From:</B></I> <A
href="mailto:cdeclercq@nordnet.fr">cdeclercq@nordnet.fr</A></DIV>
<DIV dir=ltr style="FONT-SIZE: 11pt" <i><B>Date:</B></I> 27 October 2003
10:43:00</DIV>
<DIV dir=ltr style="FONT-SIZE: 11pt" <i><B>To:</B></I> <A
href="mailto:Roger.Bivand@nhh.no">Roger.Bivand@nhh.no</A>; <A
href="mailto:si-opz@dsv.su.se">Orlando Zacarias</A></DIV>
<DIV dir=ltr style="FONT-SIZE: 11pt" <i><B>Cc:</B></I> <A
href="mailto:r-sig-geo@stat.math.ethz.ch">r-sig-geo@stat.math.ethz.ch</A>;
<A href="mailto:yuecui@biostat.umn.edu">yuecui@biostat.umn.edu</A></DIV>
<DIV dir=ltr style="FONT-SIZE: 11pt" <i><B>Subject:</B></I> RE:
[R-sig-Geo] RE: [R] adjacency matrix</DIV></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>> -----Message d'origine-----</DIV>
<DIV>> De : <A
href="mailto:r-sig-geo-bounces@stat.math.ethz.ch">r-sig-geo-bounces@stat.math.ethz.ch</A></DIV>
<DIV>> [<A
href="mailto:r-sig-geo-bounces@stat.math.ethz.ch">mailto:r-sig-geo-bounces@stat.math.ethz.ch</A>]De
la part de Roger Bivand</DIV>
<DIV>> Envoyé : vendredi 24 octobre 2003 22:19</DIV>
<DIV> </DIV>
<DIV>[...]</DIV>
<DIV> </DIV>
<DIV>> > It's easy to get the adjacency data as WinBUGS want
them.</DIV>
<DIV>> > Something along the lines of (if 'cantons' is a 'polylist'
object):</DIV>
<DIV>> ></DIV>
<DIV>> > > cantons.nb<-poly2nb(cantons, bb=cantons.bb) #
calculate the</DIV>
<DIV>> neighbourhood</DIV>
<DIV>> > > data<-list(N = length(cantons),</DIV>
<DIV>> > + O=lungcanc$o, E=lungcanc$e,</DIV>
<DIV>> > + num=sapply(cantons.nb, length),</DIV>
<DIV>> > + adj=unlist(cantons.nb),</DIV>
<DIV>> > + sumNumNeigh=length(unlist(cantons.nb))</DIV>
<DIV>> > +)</DIV>
<DIV>></DIV>
<DIV>> Would it be useful for a function doing this to be put into
spdep,</DIV>
<DIV>> including checking that things "add up"? Should the function
write data</DIV>
<DIV>> out to a file - probably not, if you are using bugsR as the
interface?</DIV>
<DIV> </DIV>
<DIV>Something generic would be useful but not that simple if you want to
take</DIV>
<DIV>care of:</DIV>
<DIV>- the different models we can use (a simple example is the case where
we</DIV>
<DIV>have an X variable for ecological regression)</DIV>
<DIV>- the different ways to connect R and WinBUGS:</DIV>
<DIV> - export all the data from R in a format WinBUGS can
read and do all the</DIV>
<DIV>work in WinBUGS</DIV>
<DIV> - driving completely the WinBUGS engine from R (the
bugsR approach)</DIV>
<DIV> - a semi-interactive way using some of the bugsR
functions to write text</DIV>
<DIV>files with data and inits, launching WinBUGS script from R (with
something</DIV>
<DIV>as 'system("C:/\"Program Files\"/WinBUGS14/WinBUGS14 /par
script.txt")', do</DIV>
<DIV>what you want in WinBUGS: more iterations, MCMC diagnostics... and
save what</DIV>
<DIV>you want, get back in R when closing WinBUGS, read the saved files
you need</DIV>
<DIV>in R to map estimates... It's the way I use now.</DIV>
<DIV>></DIV>
<DIV>> Would a similar function to output the polygon boundaries in
a</DIV>
<DIV>> GeoBUGS-friendly format be helpful - should that rather be in
maptools?</DIV>
<DIV> </DIV>
<DIV>I don't use GeoBUGS mapping functions at all for the moment (I
use</DIV>
<DIV>plotpolys()... and poly2nb()...) but, yes, it should be useful. As
I</DIV>
<DIV>understand it, GeoBUGS read the S maps format: would converting
polylist</DIV>
<DIV>from/to S maps be useful?</DIV>
<DIV> </DIV>
<DIV>> This is a very fruitful thread - please keep up the flow
of</DIV>
<DIV>> ideas, because</DIV>
<DIV>> the need for data exchange with WinBUGS is clear and if we can
get it</DIV>
<DIV>> right, should be useful for quite a large (and growing) group of
people.</DIV>
<DIV>> Could some of us try to do a very rough mini-HOWTO, possibly
with the</DIV>
<DIV>> author of convert.r (cc to Yue Cui, thread "adjacency matrix" on
r-help</DIV>
<DIV>> and r-sig-help)?</DIV>
<DIV> </DIV>
<DIV>Good idea! I can try to write a rough HOW-I sketch if you want. I
hope</DIV>
<DIV>Orlando has eventually been sucessful in his work and so his
experience will</DIV>
<DIV>be useful.</DIV>
<DIV> </DIV>
<DIV>Christophe</DIV>
<DIV>--</DIV>
<DIV>Christophe DECLERCQ, MD</DIV>
<DIV>Observatoire Régional de la Santé Nord-Pas-de-Calais</DIV>
<DIV>13, rue Faidherbe 59046 LILLE Cedex FRANCE</DIV>
<DIV>Phone +33 3 20 15 49 24</DIV>
<DIV>Fax +33 3 20 55 92 30</DIV>
<DIV>E-mail <A
href="mailto:c.declercq@orsnpdc.org">c.declercq@orsnpdc.org</A></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>.</DIV></TD>
</TR>
<TR>
<TD id=INCREDIFOOTER width="100%">
        <TABLE cellPadding=0 cellSpacing=0 width="100%">
        <TR>
        <TD width="100%"></TD>
        <TD align=middle id=INCREDISOUND vAlign=bottom></TD>
        <TD align=middle id=INCREDIANIM vAlign=bottom></TD>
        </TR>
        </TABLE>
</TD>
</TR>
</TABLE><SPAN
id=IncrediStamp><SPAN dir=ltr><FONT face="Arial, Helvetica, sans-serif"
size=2>____________________________________________________<BR><FONT
face="Comic Sans MS" size=2><A
href="http://www.incredimail.com/redir.asp?ad_id=309&lang=9"><IMG
align=baseline alt="" border=0 hspace=0
src="cid:9845D4B1-F5CE-4299-96F9-9DB0D7805FCD"></A> <I>IncrediMail</I> -
<B>Email has finally evolved</B> - </FONT><A
href="http://www.incredimail.com/redir.asp?ad_id=309&lang=9"><FONT
face="Times New Roman" size=3><B><U>Click
Here</U></B></FONT></A></SPAN></SPAN></FONT>
</BODY>
</html>