*! version 1.1 8jun2015

Title

network map -- draw a map of a network

Syntax

network map [if] [in]
[,
options]

Main
circle[(#)] Treatments are placed around a circle (the default).

square[(#)] Treatments are placed in a square lattice.

triangular[(#)] Treatments are placed in a triangular lattice.

random[(#)] Treatments are placed at random.

centre[(#)] (only with the circle(#) option) The centre of the circle is also used.

loc(matname) Specifies a matrix containing the locations of the treatments.

replace Existing matrix is to be replaced.

improve[(#)] Requests optimisation of the map to minimise line crossings.

listloc Lists the treatment location matrix.

trtcodes makes the display use the treatment codes A, B, C etc. rather than the full treatment names.

graph_options Other options for graph.

networkplot_options Other options for networkplot.

Description

network map draws a
map of a network: that is, it shows which treatments are directly compared
against which other treatments, and roughly how much information is avaiable for each treatment
and for each treatment comparison.

Options

circle[(#)]
The treatments are placed around a circle. This is the most commonly used system and the default.
The optional argument specifies the number of locations round the circle;
the default is the number of treatments.
Larger numbers can be useful with the improve option.

square[(#)]
The treatments are placed in a square lattice.
The optional argument specifies the number of rows and columns in the lattice;
the default is the square root of the number of treatments (rounded up).
Larger numbers can be useful with the improve option.

triangular[(#)]
The treatments are placed in a triangular lattice.
The optional argument specifies the number of rows in the lattice, which is also the length of the longer rows;
the default is approximately the square root of the number of treatments.
Larger numbers can be useful with the improve option.

random[(#)]
The treatments are placed randomly.
The optional argument specifies the number of locations in the lattice;
the default is the number of treatments.
Larger numbers can be useful with the improve option.

loc(matname) specifies a treatment location matrix.
This specifies where the treatments are placed on the map.
The matrix should have at least as many rows as treatments, and 3 columns, for the x-coordinate, the y-coordinate and the clock position for the label.
If the matrix does not exist, or if replace is specified, then a new matrix is created according to options circle, square or random.
If loc(matname) is not specified then a new matrix is created and stored in _network_map_location.

Note that the rows of matname are taken as the locations of the treatments in alphabetical order.
Row names are ignored.
Thus network map, loc(M) and network map if useit, loc(M) may place the treatments differently.

replace The existing treatment location matrix is to be replaced.

improve[(#)]
requests an iterative procedure to improve the placement of the treatments.
The algorithm swaps pairs of treatments if this reduces the number of line crossings.
The optional argument gives the maximum number of cycles; the default is 10.

listloc lists the treatment location matrix.

graph_options specifies options for graph:
for example, xscale(on) yscale(on) could be used to show the axes.
plotregion(margin(t=-10)) can be used to lower the position of a title.

networkplot_options are any options for networkplot.

Examples

Draw a network map for the thrombolytics data - assumes networkplot is installed

. use http://www.homepages.ucl.ac.uk/~rmjwiww/stata/meta/thromb.dta, clear

. network setup r n, studyvar(study) trtvar(treat)

. network map

The same, with an improved map on the circle

. network map, circle improve

The same, with an improved map on a triangular grid

. network map, triangular(5) improve

That's good (no line crossings at all), but we can tidy up a bit by aligning treatments and moving labels.
First we extract the matrix of stored locations

. mat loc2 = _network_map_location[1..8,.]

Now we edit it by moving C left to the level of A:

. mat loc2[3,1]=loc2[1,1]

and moving D up to the level of A:

. mat loc2[4,2]=loc2[1,2]

and moving E up to the level of B:

. mat loc2[5,2]=loc2[2,2]

and moving F's label to 10 o'clock:

. mat loc2[6,3]=10

and then re-drawing the graph:

. network map, loc(loc2) title(Improved map of thrombolytics network)

Finally, here is a set of locations that gives the best graph of these data:

. mat loc3=( 3,3,9\ 5,4,3\ 1,2,9\ 4.33,3,6\ 6,4.5,3\ 3,3.67,9\ 5,2,3\ 1,4,9)

. network map, loc(loc3) title(Best map of thrombolytics network)

Return to main help page for network