help pajek2stata -------------------------------------------------------------------------------

Title

pajek2stata -- Import network data in Pajek's .net format

Syntax

pajek2stata using fname , name(name) [clear replace]

Description

pajek2stata imports data stored in Pajek's ".net" format for relational data. A .net file is an ASCII file consisting of two parts. The first part contains information about the vertices in the network, in the conventional observation-by-variable format. The first column of the vertices part must contain the identifiers for the vertices; optional additional columns may contain vertex labels and other properties of the vertices. pajek2stata stores this part into new Stata variables. By default, these variables are named var1, var2..etc., because Pajek net files do not contain variable names. The new variables are all stored as string variables, and can be converted afterwards as needed.

The second part of the file contains the data on relations between the vertecis, i.e., the network. The network data may take three different formats:

Matrix: The data are stored as a square NxN adjacency matrix.

Edges: The data are stored as a list of edges, in which every line in the data represents a relation between two vertices. The first two values must contain the identifiers of the vertices; a third (optional) value may contain the value of the relation.

Arcs: The data are stored as a list of arcs, in which every line in the data represents a directed a relation from one vertex to another. The first two values must contain the identifiers of the vertices; a third (optional) value may contain the value of the relation.

pajek2stata stores the relational part of the data as a matrix in Mata, from where it may be analyzed further.

Note: this version of pajek2stata can only handle simple .net files containing not more than one network specification. Pajek also supports .net files with multiple network specifications for the same set of vertices. Future versions of pajek2stata may be able to deal with such files.

Options

name() is required: specifies the name of the Mata matrix in which the relational data are to be stored.

clear specifies that the memory is to be cleared before the data are loaded. pajek2stata issues an error message if there are already data in memory and "clear" is not specified.

replace specifies that if the Mata matrix name already exists, it is to be replaced.

Author: Rense Corten, Department of Sociology/ICS, Utrecht Univesity. April 201 > 0.

Also see

Online: [R] mata