[Rsiena-help] selecting certain actors

Ruth M. Ripley ruth at stats.ox.ac.uk
Mon Feb 15 12:59:42 CET 2010


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
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
>



More information about the Rsiena-help mailing list