1 Star 0 Fork 7

夏汉林/nwcommands

forked from 连享会/nwcommands 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
nwcomponents.sthlp 2.27 KB
一键复制 编辑 原始数据 按行查看 历史
ThomasGrund 提交于 2015-02-18 23:41 . v1.1.6D
{smcl}
{* *! version 1.0.6 23aug2014 author: Thomas Grund}{...}
{marker topic}
{helpb nw_topical##analysis:[NW-2.6] Analysis}
{title:Title}
{p2colset 9 21 22 2}{...}
{p2col :nwcomponents {hline 2} Calculate network components / largest component}
{p2colreset}{...}
{title:Syntax}
{p 8 17 2}
{cmdab: nwcomponents}
[{it:{help netlist}}]
[, {opt lgc}
{opth generate(newvarname)}]
{synoptset 25 tabbed}{...}
{synopthdr}
{synoptline}
{synopt:{opth generate(newvarname)}}name of the Stata variable that stores information about components; default = {it:_component} or {it:_lgc}{p_end}
{synopt:{opt lgc}}calculate membership to largest component{p_end}
{p2colreset}{...}
{title:Description}
{pstd}
Calculate the components of a network or a list of networks. A component is a set of nodes that are
only connected among each other. All calculations are performed on the non-directed version of the networks. Nodes can only belong to one component.
{pstd}
By default, {cmd:nwcomponents} generates
a new variable {it:_components} which stores the component membership.
When option {bf:lgc} is specified, the command generates a new variable
{it:_lgc} which stores information about membership to the largest component.
{title:Stores results}
Scalars
{bf:r(components)} number of components
Matrices
{bf:r(comp_sizeid)} distribution over components
{title:Examples}
{cmd:. webnwuse florentine, nwclear}
{cmd:. nwcomponents flomarriage}
{res}{hline 40}
{txt} Network name: {res}flomarriage
{txt} Components: {res}2
{txt}_component {c |} Freq. Percent Cum.
{hline 12}{c +}{hline 35}
{txt} 1 {c |}{res} 15 93.75 93.75
{txt} 2 {c |}{res} 1 6.25 100.00
{txt}{hline 12}{c +}{hline 35}
Total {c |}{res} 16 100.00{txt}
{pstd}
This shows that there are two components in the Florentine marriage network. All except one node belong to the first
components. Some alternative ways how the commands can be used.
{cmd:. webnwuse glasgow}
{cmd:. nwcomponents glasgow1, generate(mycomponent)}
{cmd:. nwcomponents _all, lgc}
{cmd:. nwcomponents _all, lgc generate(mylgc)}
{title:See also}
{help nwgen}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xiahanlin/nwcommands.git
git@gitee.com:xiahanlin/nwcommands.git
xiahanlin
nwcommands
nwcommands
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385