*! version 4.07 David Fisher 15sep2023

Title

metani -- Immediate form of metan

Syntax

matrix define-like syntax:

metani ( #, # [, #...]
\ #, # [, #...] [\ [...]] )
[, options]

tabi-like syntax:

metani # # [#...] \ # # [#...] [\ [...]] )
[, options]

Using a previously-defined matrix:

metani A [, options]

npts(numlist) specify participant numbers for each row of data (study)

rownames [quoted] use matrix rownames to label studies in the table and forest plot

rowfullnames [quoted] use matrix rowfullnames to label studies in the table and forest plot

roweq [quoted] use matrix roweqnames to label studies in the table and forest plot

rowtitle(string) specify variable label for studies in the table and forest plot

studytitle(string) synonym for rowtitle()

rowlabel(string) specify value label for studies in the table and forest plot

studylabel(string) synonym for rowlabel()

variances specify that variances are supplied instead of standard errors

metan_options any metan options except npts()
and others requiring a varname

Description

metani performs meta-analysis on figures supplied directly to the command,
and is intended for situations where a quick calculation of the pooled effect of a small number of studies
is desired, without the relevant data being entered into variables.
It may also be useful for constructing a forest plot of estimates from a regression or from margins,
by passing to metani a matrix derived from a coefficient vector and variance-covariance matrix.
metani is not a true immediate command (see immed) since by default it leaves behind
the same new variables as does metan (although this may be suppressed with nokeepvars).
However, the functionality is otherwise similar.

Data may be supplied in any of the structures accepted by metan.
In other words, each row of data (assumed to represent a study or trial) must contain two, three, four or six elements.
If two or three elements, participant numbers may be supplied in the form of a numlist to the npts() option.

Options

npts(numlist) specifies the number of participants associated with each study, for display in tables and forest plots.

rownames, rowfullnames, roweq extract the row names, fullnames (defined as roweqname:rowname)
or equation names from matrix A to form the study names (c.f. study(varname) in metan).
In the absence of one of these options, or if row names are not set,
then observations (rows) will be labelled sequentially as "1", "2", etc.

quoted, used with any of the above, specifies that the contents of the row[eq]names may contain spaces,
and therefore should be enclosed in double quotes during manipulation.
(Note that such quotes will not appear on-screen or in the forest plot.)

rowtitle(string) (or its synonym, studytitle(string)) specifies a title for the observations extracted from the matrix,
equivalent to the variable label of study(varname) in metan.
If not supplied, the default variable label "Matrix rowname" is used.

rowlabel(string) (or its synonym, studylabel(string)) applies an existing value label to numerical values
stored in the row[eq]names of the matrix, if applicable; or to the default sequential numbering (see above under rownames).

variances specifies that the second of two columns supplied to metani contains variances rather than standard errors.
This may be useful if passing a matrix to metani which was derived from a coefficient vector and variance-covariance matrix.

Saved results

By default, metani adds the same same new variables to the data set
and saves the same information in r() as does metan.

Author

David Fisher, MRC Clinical Trials Unit at UCL, London, UK.

Email d.fisher@ucl.ac.uk