Social network analysis (SNA) is the methodical analysis of social networks. Social network analysis views social relationships in terms of network theory, consisting of nodes (representing individual actors within the network) and ties (which represent relationships between the individuals, such as friendship, kinship, organizational position, sexual relationships, etc.)
Questions tagged [sna]
296 questions
0
votes
0 answers
How to create an artificial network of 3 blocks for analyzing stochastic blockmodel?
I want to create three graphs using the tie probabilities. In those graphs, Block 1 has 20 nodes, Block 2 has 20 nodes, and Block 3 has 10 nodes. I want to plot each network, with nodes colored by block membership. I tried this but unsuccessful. I…
0
votes
0 answers
How to delete vertex with degree = 0 in R (social network data)?
I want to delete vertices with the code below but have this error message:
Error in delete.vertices(n_all, V(n_all)[degree(n_all) == 0]) :
delete.vertices requires an argument of class network.
I follow some suggestions from here (remove…
0
votes
1 answer
Centrality Analysis of undirected graph
I'm doing a Social Network Analysis of this dataset with NetworkX and I want to make a degree and closeness centrality analysis.
The graph I obtain is undirected (graph.is_directed() returns false), and I have node 1 with degree 593 but it has 0 as…

Fio
- 43
- 5
0
votes
0 answers
Shortening variable names in R
I have a column called pseudo_user_id which is a long-character string. I want to create a Social Network with nodes and links to perform some analysis. However, these id's overlapped each other and made it unclear.
Is there any way to shorten them…

Ranji Raj
- 778
- 4
- 18
0
votes
0 answers
How do you make weight appear on matrix by using nx.to_numpy_matrix?
I am making SNA network graph using networkx librabry from python. I used a lesmis.gml data(lesmiserable data) and the data is like this
graph [ node [ id 0 label "Myriel" ] node [ id 1 label "Napoleon" ] node [ id 2 label "MlleBaptistine" ] node […

BrightSky77
- 1
- 2
0
votes
1 answer
Vertex reciprocity - social network analysis on r
I recently began working on r for social network analysis. Everything goes well and up until now, I found answers to my questions here or on google. But not this time!
I am trying to find a way to calculate "vertex reciprocity" (% of reciprocal…

Ammama
- 1
- 1
0
votes
1 answer
VisNetwork: How to color edges using HeatMap?
Let's have a data frame containing edges and their weights as follows.
> data <- data.frame(From = sample(1:10,15,replace = T),
+ To = sample(1:10,15,replace = T),
+ Weight = runif(15,min = 0,max = 1))
> data
…

abdul samad
- 61
- 6
0
votes
0 answers
Duplicate weighted ties in social network using R
I am wondering if there is a way for any social network package (sna, network, or igraph) to accommodate duplicate ties with different weights?
I have data where division chiefs are rating their organization as you can see below, and there are some…

NJS
- 1
- 1
0
votes
1 answer
How can I show simultaneously all QAP correlation coefficients and QAP p-values between my independent and all dependent matrices with sna in R?
I am running Quadratic Assignment Procedure (QAP) to find the correlation of a dependent network matrix with four independent monadic node covariate matrices in R using the sna package.
I am using the following…

AnCo
- 41
- 4
0
votes
2 answers
What is the best way to calculate centralities for a single node in networkx?
I am able to calculate different kinds of centralities such as degree, betweenness, closeness, and eigenvector for all the nodes in graph G. For instance, this code calculates the betweenness centrality for all of the included nodes of graph…

Hamed Baziyad
- 1,954
- 5
- 27
- 40
0
votes
0 answers
How to represent betweenness as an attribute of a node on "igraph" (Rstudio)?
I managed to perform this operation in order to make a visual representation of node degree using the following code:
Datamatrix <- as.matrix(data[c("first","second")])
CVET <- graph_from_edgelist(Datamatrix, directed=TRUE)
…

Tavirio
- 17
- 5
0
votes
2 answers
How to show graph with matrix in python?
I want to show graph with matrix below.
I've saved this matrix in excel file to import that to gephi application but it doesn't work .
How can I show it?
0 0 0 1 0 0
0 0 1 0 0 0
0 1 0 1 0 0
1 0 1 0 1 2
0 0 0 1 0 1
0 0 0 2 1 0

user12217822
- 292
- 1
- 5
- 16
0
votes
1 answer
How to create 2 one-mode network with multiplication sparse matrix in python?
I have a list of objects and I converted it to sparse matrix and now I want to create 2 one-mode network whit multiplication matrix . But I don't know how should I do that?
data = [
{"title": "title1", "tags": ["tag1", "tag2", "tag3"]},
…

user12217822
- 292
- 1
- 5
- 16
0
votes
1 answer
How to convert list of object to sparse matrix in python?
I have list of objects and I want to convert it to sparse matrix in python.
I want the matrix column to be tags and the rows to be titles
(There may be duplicate tags between different titles)
I don't know what should I do?
data = [
{
'title':…

user12217822
- 292
- 1
- 5
- 16
0
votes
1 answer
How to create list of tuples from dictionary in python?
I have a dictionary and I want to create a list of tuples between tags. In fact, I want to make a connection between every 2 common tags that come in 2 different titles to draw a graph. How can I do this?
data = [
{
'title': 'title1', 'tags':…

user12217822
- 292
- 1
- 5
- 16