You are on page 1of 3

USEFUL CLI COMMANDS

Network Measures

Holes structural hole measures


Betweenness betweenness centrality
BetaCentrality compute beta centrality for a range of values of beta
Centrality multiple centrality measures
Indegree, Outdegree outputs measures for multiple relations side-by-side
Centralization centralization with respect to several centrality measures
Cohesion multiple measure that describe whole networks
Geodesic compute geodesic distance matrix
Dependency calculates Freeman dependency matrix
Change counts tie changes over time

Subgroups and Clustering

Cliques identifies all cliques in network


NCD Newman community detection algorithm for partitioning networks
Factions partitions nodes into mutually exclusive groups
Split partitions nodes into exactly two groups

Make Networks & Matrices

Erdos creates Erdos-Renyi random graphs


Random create matrices with uniform random values
MakeClique create a fully connected network
MakePath create a network consisting of a single path
MakeCircle creates a circle network
MakeStar create network in which all nodes are connected (only) to the center node
Diagonal creates a diagonal matrix out of a row or column vector
Identity makes an identity matrix
Ones creates a matrix of all ones
Zeros creates a matrix of all zeros
Mat create matrix filled with a given value

Linear Algebra

Inverse inverse of square matrix


Ginv Moore-Penrose generalized inverse
Prod matrix multiplication of two matrices
Eigen extract eigenvalues and eigenvectors
SVD singular value decomposition
Solve solve matrix equation Ax = b for the values of x
XXT multiplies matrix by its transpose, saving memory (1-mode projection)

XTX pre-multiplies matrix by its transpose (1-mode projection)

Data Transformations

Symmetrize make adjacency matrix symmetric


Dichotomize convert matrix to 1s and 0s
Transpose interchange rows, columns and/or levels of a 3D matrix
ReplaceNa replace missing values with values from another matrix
RemoveIsolates create new dataset with isolates removed

Arithmetic Transformations

Log, ln, exp elementwise transformation of values


Round, trunc -- elementwise transformation of values
Linear takes each value of matrix and multiplies by constant and adds constant
RowStochastic makes each row add up to 1
ColStochastic makes each column add up to 1
Zscore convert rows, columns or whole matrices to z-scores

Environmental Variables

Decimals set the number of decimal places in displays


Width set the width of columns of output tables
Timing show computation time after each command

Automation

Forfiles run a command for every file in folder that has a given prefix
Run execute a script contained in a text file

Editing & Display

Display shows matrix values


Edit opens matrix data in spreadsheet
Tedit opens a text file using the default text editor
Notepad opens a text file using Windows Notepad
Wordpad opens a text file using Windows Wordpad (allows unlimited line length)

Statistics

Corr computes correlations between columns of one or two datasets


QAP correlates matrices and provides permutation-based significance test
Corrmat correlates matrices
Univariate computes univariate statistics on rows, cols, levels or entire datasets
Logistic logistic regression of column variables
Xtabs construct crosstabs of any two variables, whether matrices or vectors
SpatialAutocorrelation calculate Moran and Geary statistics

Import/Export

Excel opens Excel and transfers UCINET matrix to it


Export saves UCINET data to csv, Excel, txt (format determined by file extension)
Loadgml loads a text file in gml format
Loaddl loads a text file in DL format
Loadcsv loads a matrix from a csv text file
LoadExcel loads an Excel file into a UCINET matrix

Within-Dataset Aggregations

Total sum the values of a dataset by rows, columns, levels or overall


Wavg average the values of a dataset by any dimension
Aggby aggregate a matrix based on a partition (create reduced blockmodel)

Across-dataset Element-wise Operations

Add sums values of all listed matrices


bAverage averages values across matrices
Multiply multiplies matrices elementwise (not matrix multiplication)

Data Properties

Dim outputs the dimensions (number of rows, cols and levels) of a dataset
Colnames outputs the labels of each column of a dataset
Levnames outputs the labels of matrix/relation contained in a dataset

Extracting Rows, Columns or Matrices

Col copies specified columns of a dataset to a new matrix


Row copies specified rows of a dataset to a new matrix
Lev extracts specified matrices from a dataset and places in new dataset
Getdiagonal extracts diagonal of a matrix and saves it as a column vector

Combining Datasets

Joincols combine columns of multiple datasets to create wide matrix with all columns
Joinrows combine rows of multiple datasets to create tall matrix with all rows
Joinmats combines matrices from different datasets into a single multi-level dataset

You might also like