Statistical Analysis of the Slashdot Social Network

Use Mathematica's strong probability and statistical capabilities to analyze the social network emerging from Slashdot, a technology-related news website known for its specific user community.
 In[1]:= XstatGrid[graph_, subg1_, subg2_] := TraditionalForm@ Grid[Transpose[{{"Nodes", "Edges", "Nodes in largest WCC", "Edges in largest WCC", "Nodes in largest SCC", "Edges in largest SCC", "Average clustering coefficient"}, {VertexCount[graph], EdgeCount[graph], VertexCount[subg1], EdgeCount[subg1], VertexCount[subg2], EdgeCount[subg2], N[MeanClusteringCoefficient[graph]]}}], Dividers -> All, Spacings -> {{1, 1}, 1.2}, Alignment -> {Left, Center}, BaseStyle -> {FontFamily -> "Verdana"}, Background -> {None, {{Lighter[Blend[{Blue, Green}], .6], GrayLevel[.9]}}}, FrameStyle -> Directive[Thick, White]];
 In[2]:= XdistPlot[emdist_, lndist_, pdist_] := Block[{pstyle = {Red, Directive[Thick, Darker[Blue]], Directive[Thick, Darker[Green], Dashing[{Medium, Small}]] }, plots, listplot}, plots = LogLinearPlot[{CDF[lndist, x], CDF[pdist, x]} // Evaluate, {x, 5, 1500}, PlotStyle -> pstyle[[2 ;;]]]; listplot = ListLogLinearPlot[{Table[{x, CDF[emdist, x]}, {x, DistributionDomain[emdist]}]}, PlotRange -> All, PlotMarkers -> {Graphics[{pstyle[[1]], Circle[{0, 0}, 1]}], 0.03}]; Legended[ Show[{plots, listplot}, ImageSize -> 400, Frame -> True, GridLinesStyle -> Directive[GrayLevel[.8]], GridLines -> Automatic], Placed[SwatchLegend[pstyle, {"data", "log-normal", "pareto"}, LegendMarkers -> {Graphics[{Red, Circle[{0, 0}, 1]}], Graphics[{Line[{{0, 0}, {2, 0}}]}], Graphics[{Line[{{0, 0}, {2, 0}}]}]}, LegendMarkerSize -> {8, {20, 10}, {20, 10}}, LegendFunction -> "Frame", Background -> White], {{.98, .03}, {1, 0}}]] ]

Import the data and build the friend/foe network.

 In[3]:= Xdata = Import["http://snap.stanford.edu/data/soc-Slashdot0902.txt.gz", "Table"];
 In[4]:= Xgraph = Graph[DirectedEdge @@@ data[[5 ;;]]];

Find the basic statistics.

 In[5]:= Xg = Subgraph[graph, First[WeaklyConnectedComponents[graph]]]; h = Subgraph[graph, Last[SortBy[ConnectedComponents[graph], Length]]]; statGrid[graph, g, h]

Analyze the in-degree distribution.

 In[6]:= Xindegree = VertexInDegree[graph]; lndist = EstimatedDistribution[indegree, LogNormalDistribution[mu, si]]; pdist = EstimatedDistribution[indegree, ParetoDistribution[k, al]]; emdist = EmpiricalDistribution[indegree];
 In[7]:= XdistPlot[emdist, lndist, pdist]
 Out[7]=