Dear  R-Help Members,
 

I am working on an analysis of a social network of web pages. Therefore 
I use the STATNET package which is such a good sna package. Thank you 
for developing it!

But now I came to a point where my R skills are not good enough for what 
I want. So I am asking you if you might help me.

The Problem:

I have a network object and calculated the degree centrality (freeman) 
for all vertexes. Now I select the first 5 vertexes with the highest 
degree centrality to take a closer look at their ego networks. For the 
ego network analysis I tried and tried for 3 day with ego.extract, 
sapply and gapply but I couldn`t do it.

My question: I want to look at the development of the relation between 
the number of egos related to the number of alters they reach with 
directly. Let's say with one ego (the vertex with the highest degree 
centrality) I reach 15 alters in my network. Now I want to combine the 
ego networks of the vertex with the highest and the second highest 
degree centrality and loo how many alters these two egos combined can 
rech. Than I want to look at the three vertexes with the highest degree 
centralities ... and so on.

At the end I want to develop a data.frame which lists in the first 
column the number of egos (increasing from 1...N) , in the second column 
the number of alters which are reached by the egos, the third column the 
number of edges and in the third column the density of the subnetwork.

Than I want to decide which ego-combination-networks seems to be the 
best and want to gplot it.

Unfortunately my R skills are limited and so I could not program this. I 
really would appreciated it if you could help me!

Thank you in advance. Sincerely yours

 

Martin Klaus (University of Kassel)

Example Data & Code:

 

m<- matrix( c ( 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 0 ,

1 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 ,

1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,

0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 ,

0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 0 ,

0 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 1 ,

0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 ,

0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,

0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ) , ncol=9)

 

diag(m) <- 0

g <- network(m, vertex.attrnames=c("a","a","a","a","a"))

summary(g)

g

degree(g)

sort(degree(g))

#-vertex 7 has the highest degree

eg<-ego.extract(g)

#- extract and visualize the ego network of vertex 4

eg$`7`

gplot(eg$`7`)

str(eg$`7`)

#- Now I need to count the number of alters and edges and save the 
results in the first row of a data.frame

 

#- Than I need to combine the ego networks of vertex 7 and vertex 6 and 
look how many alters these two egos reach together

#- The results need to saved in the second row of the data.fram ...

 

EXAMPLE data.frame:

 

#Egos  /  #Alters   /   #edges   /  ego.net.density

    1      /       8       /      ...  


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to