Many researchers have done studies on people’s core discussion network, the set of friends and family people turn to when discussing important matters.
I did a simple social network analysis on my core discussion network, which helped me gain an overview picture of my social network. I first made a weighted adjacency matrix to encode an egocentric network for those with whom I have discussed matters important in the last six months. In the weighted adjacency matrix, rows and columns represent different nodes, and weight ranges from 0-5. 0 means there is no connection between nodes, and 5 means the two nodes has exchanged important information. The matrix was saved in a csv file, which looks like this:
I used R packages – network and sna in my analysis process.
- The first step is to import data in R. There are two ways to import data: 1) from a google file 2) from local file
url<-“the google file URL address”
myCsv <- getURL(url)
myData<-read.csv(“local file path”)
2. The second step is convert the file into a matrix in R. (note: “row.names=1” coerces the first row into the header of the matrix)
ego<- as.matrix(read.csv(“google file URL address”, row.names=1))
ego<- as.matrix(read.csv(“local file path”, row.names=1))
3. The third step is to plot the network. I can use function gplot to draw a network plot, for example
gplot(ego, gmode=”graph”, displaylabels=TRUE, label.cex=0.8, vertex.col=”darkolivegreen”)
The plot looks like this:
4. The last step is to customize the network. I want to present different groups with different color, and edge width represents the weight between two nodes. This process is a little complicated.
# add an attribute edgeweight to the network
MyNetwork <- network(ego, directed=FALSE, edge.attrnames=”edgeweight”)
# set values to the edgeweight attribute
set.edge.attribute(MyNetwork2, “edgeweight”, value=c(1,2,3,4,5))
# set nodecolors
nodeColors = c(“goldenrod3″,”steelblue1″,”steelblue1″,”steelblue1”, “darkgreen”,”darkgreen”, “darkgreen”,”firebrick”,”firebrick”, “firebrick”,”firebrick”,”darkslateblue”,”darkslateblue”, “darkslateblue”,”blue”,”blue”,”blue”)
# use function plot to draw the network
Finally, my core discussion network (ego network) looks like this:
I didn’t record all my important connections in the matrix. But based on the above analysis, it is demonstrated that in my core discussion network, the friendship, coworker relationship, and kinship are apparent in my personal network. Alters in these four different networks are closely tied to each other within each network, but there is no relationships between or among these four different networks. For instance, my dad, mom, and sister are closely tied to each other in the kinship network, but they are not tied to my friendship network, or coworker network. A unique network is the partner network, they are not linked to each other at all.