1 Star 0 Fork 7

夏汉林/nwcommands

forked from 连享会/nwcommands 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
nwcloseness.sthlp 2.23 KB
一键复制 编辑 原始数据 按行查看 历史
ThomasGrund 提交于 2015-09-18 19:13 . v1.5.1
{smcl}
{* *! version 1.0.0 3sept2014}{...}
{marker topic}
{helpb nw_topical##analysis:[NW-2.6] Analysis}
{title:Title}
{p2colset 9 20 22 2}{...}
{p2col :nwcloseness {hline 2} Calculate closeness centrality}
{p2colreset}{...}
{title:Syntax}
{p 8 17 2}
{cmdab: nwcloseness}
[{it:{help netlist}}]
[{cmd:,}
{opth unconnected(int)}
{opt generate}({it:{help varname:var1 var2 var3}})
{opt nosym}]
{synoptset 30 tabbed}{...}
{synopthdr}
{synoptline}
{synopt:{opth unconnected(int)}}defines the length of the (non-existent) path between two unconnected nodes{p_end}
{synopt:{opt generate}({it:{help varname:var1 var2 var3}})}variables names to save closeness, farness and nearness scores; default:
{it:var1 = _closeness, var2 = _farness, var3 = _nearness}{p_end}
{synopt:{opt nosym}}do not symmetrize network before calculation of shortest paths{p_end}
{title:Description}
{pstd}
Calculates the closeness centrality (and farness and nearness score) for each node {it:i} in a network or network list and
saves the result as Stata variables.
{pstd}
The closeness centrality for node {it:i} is defined in the following way:
{it:farness_i = sum(dist_ik), over all k}
{it:nearness_i = 1 / farness_i}
{it:closeness_i = nearness_i * (nodes - 1)}
{pmore}
with: {it:dist_ik} being the length of the shortest path from node {it:i} to node {it:k} (see {help nwgeodesic})
{pstd}
Closeness centrality is not defined when the network is unconnected. However, scores can still be obtained when
option {bf:unconnected()} is specified. Any integer value can be choosen; {bf:unconnected(max)} assigns non-existent
paths a length based on the longest shortest path length observed in the network (plus one) (see {help nwgeodesic}).
{pstd}
Already existing Stata variables {it:var1, var2, var3} are overwritten. In case, closeness centrality is calculated
for {it:z} networks at the same time (e.g. {bf: nwcloseness glasgow1 glasgow2}), the command generates the variables
{it:var1_z, var2_z, var3_z} for each network.
{title:Examples}
{cmd:. webnwuse gang, nwclear}
{cmd:. nwclosenss gang}
{cmd:. sum _closeness _farness _nearness}
{title:See also}
{help nwgeodesic}, {help nwpath}, {help nwgeodesic}, {help nwbetween}, {help nwdegree}, {help nwevcent}, {help nwkatz}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xiahanlin/nwcommands.git
git@gitee.com:xiahanlin/nwcommands.git
xiahanlin
nwcommands
nwcommands
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385