[Rsiena-help] selecting certain actors

Maarten Van Zalk maartenvanzalk at gmail.com
Mon Mar 8 14:23:43 CET 2010


Dear Ruth,

a follow-up question on using specific actors: is it possible to select a
range of scores? so for example the scores 1 until 4?

Thanks for your help yet again!

Maarten

On Mon, Feb 15, 2010 at 12:59 PM, Ruth M. Ripley <ruth at stats.ox.ac.uk>wrote:

> Dear Maarten,
>
> There are no special facilities: you would need to extract the subsets of
> the matrices yourself before creating the Siena network object. Using the
> command line, after reading in some data:
>
> friend.data.w1 <- as.matrix(read.table("s50-network1.dat"))
> friend.data.w2 <- as.matrix(read.table("s50-network2.dat"))
> drink <- as.matrix(read.table("s50-alcohol.dat"))
> smoke <- as.matrix(read.table("s50-smoke.dat"))
>
> To select the actors with the first column of smoke equal to 1, say,
>
> use <- smoke[, 1] == 1
>
> friendship <- sienaNet(array(c(friend.data.w1[use, use],
>       friend.data.w2[use, use]), dim=c(38, 38, 2)))
>
> alcohol <- sienaNet(drink[use, ], type="behavior")
>
> To do this via the gui, you would need to do the subsetting outside R.
>
> Regards,
>
> Ruth
>
> PS I have copied this message to the rsiena-help mailing list. I see two
> benefits to using the lists: others might find the information useful too,
> and if I am busy someone else might be able to help!
> --
> Ruth M. Ripley,                         Email:ruth at stats.ox.ac.uk<Email%3Aruth at stats.ox.ac.uk>
> Dept. of Statistics,                    http://www.stats.ox.ac.uk/~ruth/
> University of Oxford,                   Tel:   01865 282851
> 1 South Parks Road, Oxford OX1 3TG, UK  Fax:   01865 272595
>
>
> On Mon, 15 Feb 2010, Maarten Van Zalk wrote:
>
> > Dear Ruth,
> >
> > Is it possible in RSiena to select certain actors for the analysis? So
> > if you have a variable X you want to use to select individuals (for
> > example, all individuals with a score of 1), Can you select only these
> > individuals?
> >
> > Thanks for your help!
> >
> > Kind regards,
> >
> > Maarten Van Zalk
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.r-forge.r-project.org/pipermail/rsiena-help/attachments/20100308/44a046cd/attachment.htm 


More information about the Rsiena-help mailing list