<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Dear Philippe,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">What is precisely going wrong? Is it only the name for the dependent variable, which is peers[[i]] instead of peers[[1]], peers[[2]], etc.? I think that the
contents of the created Siena data sets probably are correct (which you could check).
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">In your example, the call<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">mydata.basic.model[[i]] <- sienaDataCreate(friends=peers[[i]])<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">will create the data set where the dependent network is called “friends”; here you can of course substitute any other name, but not an element of a vector or
list even if these are strings. If you do not object to your list of Siena data sets all having the same name for the dependent variable, this is what you could do.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Best wishes,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Tom<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">================================================================<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Tom A.B. Snijders<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Professor of Statistics in the Social Sciences<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Department of Politics and Department of Statistics<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Nuffield College<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">University of Oxford<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">tel. +44-01865-278599<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext"> rsiena-help-bounces@lists.r-forge.r-project.org
[mailto:rsiena-help-bounces@lists.r-forge.r-project.org] <b>On Behalf Of </b>Philippe Sulger<br>
<b>Sent:</b> 21 June 2012 17:51<br>
<b>To:</b> rsiena-help@lists.r-forge.r-project.org<br>
<b>Subject:</b> [Rsiena-help] Loop in "sienaDataCreate"<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">Dear all<br>
<br>
I try to program a loop over 5 different networks. Therein I use "sienaDataCreate". E.g.:<br>
<br>
mydata.basic.model <- list();<br>
<br>
for (i in c(1:5))<br>
{mydata.basic.model[[i]] <- sienaDataCreate(peers[[i]])}<br>
<br>
Where "peers" is defined/specified previously as a list over networks s.t.<br>
<br>
peers <- list()<br>
<br>
for (i in c(1:5))<br>
{peers[[i]] <- sienaNet(<br>
array( c(peers.data.w1[[i]], peers.data.w2[[i]]),<br>
dim = c( dim(peers.data.w1[[i]])[1], dim(peers.data.w2[[i]])[1], 2)))}<br>
<br>
The latter loop works. The former loop does not work. That is, mydata.basic.model[[1]], for instance, gets "peers[[i]]" as dependent variable (instead of "peers[[1]]". The same for the other networks.
<br>
<br>
But if I define the model-data separately for each network, i.e., <br>
<br>
mydata.basic.model[[1]] <- sienaDataCreate(peers[[1]])<br>
mydata.basic.model[[2]] <- sienaDataCreate(peers[[2]]) <br>
<br>
it works.<br>
<br>
What goes wrong?<br>
<br>
Thank you for your efforts.<br>
<br>
Best<br>
Philippe</span><o:p></o:p></p>
</div>
<br>
<hr>
<font face="Arial" color="Black" size="2">Nuffield College is a Registered Charity No. 1137506. Registered Office: Nuffield College, New Road, Oxford, OX1 1NF<br>
</font>
</body>
</html>