[Rsiena-help] help with composition change file
ter Wal, Anne
a.terwal at imperial.ac.uk
Tue Dec 6 20:23:43 CET 2011
Hi,
I am currently running SIENA models in R, looking at the impact of geographical distance (as a dyadic covariate) in network evolution.
I have ran models with two waves successfully by analysing the evolution among two network observations with equal node sets.
Now I am trying to analyse five waves of data (with geographical distance - recoded as integers between 0 and 255 - as a changing dyadic covariate).
This requires, however, to use a file that indicates the composition change. As actors only exit and enter once, I have made a text file with two columns for each actor in the network, where numbers between 1 and 5 indicate the time of entry and time of exit (separated by a tab).
My syntax is as follows:
# load libraries
library(snow)
library(network)
library(rlecuyer)
library(xtable)
# set directory
Setwd("....")
list.files()
# load network data
network.data.w1 <- as.matrix(read.table("Network 1978-1982-b-Matched.txt"))
network.data.w2 <- as.matrix(read.table("Network 1983-1987-b-Matched.txt"))
network.data.w3 <- as.matrix(read.table("Network 1988-1992-b-Matched.txt"))
network.data.w4 <- as.matrix(read.table("Network 1993-1997-b-Matched.txt"))
network.data.w5 <- as.matrix(read.table("Network 1998-2002-a-Matched.txt"))
distance.data.w1 <- data.matrix(read.table("Geomatrix_1982_all_int.txt"))
distance.data.w2 <- data.matrix(read.table("Geomatrix_1987_all_int.txt"))
distance.data.w3 <- data.matrix(read.table("Geomatrix_1992_all_int.txt"))
distance.data.w4 <- data.matrix(read.table("Geomatrix_1997_all_int.txt"))
composition.change.data <- as.list(read.table("composition_change.txt"))
# a. set network dependent variables
coinv <- sienaNet(array(c(network.data.w1, network.data.w2, network.data.w3, network.data.w4, network.data.w5), dim=c(425, 425, 5)))
# b. set attributes
distance <- varDyadCovar(array(c(distance.data.w1, distance.data.w2, distance.data.w3, distance.data.w4), dim=c(425,425,4)))
compChange <-sienaCompositionChange(composition.change.data, option=1)
# c. data specification
mod1 <- sienaDataCreate(coinv, distance, compChange)
But I get the following error message:
Error in sienaDataCreate(coinv, distance, compChange) :
composition change incorrect size: compChange
Do you have any idea what is going wrong here?
I also tried to import the file "composition_change.txt" as a matrix, but then I got another error earlier, namely at the command sienaCompositionChange
Error in sienaCompositionChange(composition.change.data, option = 1) :
changelist must be a list
I hope you can help me in resolving this problem.
Thanks a lot for your help in advance.
Kind regards,
Anne ter Wal
Dr. Anne ter Wal
Research Fellow
Imperial College Business School
Innovation and Entrepreneurship Group
Tanaka Building, South Kensington Campus
London SW7 2AZ
E: a.terwal at imperial.ac.uk<mailto:a.terwal at imperial.ac.uk>
W: www.anneterwal.com<http://www.anneterwal.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rsiena-help/attachments/20111206/7ca8f27d/attachment.htm>
More information about the Rsiena-help
mailing list