-------------------------------------------------------------------------------
help for matrixof, vectorof
-------------------------------------------------------------------------------

Matrix or vector of results for paired or single variables

matrixof cmd varlist [if exp] [in range] [weight] [ , { eclass(result) | rclass(result) | global(result) } cols(column_varlist) listwise matname(matrix_name) cmd_options matrix_list_options ]

vectorof cmd varlist [if exp] [in range] [weight] [ , { eclass(result) | rclass(result) | global(result) } y(yvarlist) x(xvarlist) listwise matname(matrix_name) cmd_options matrix_list_options ]

Description

matrixof by default computes a matrix of results containing one result for cmd for each pair of variables in varlist. Alternatively, with the cols() option, it computes a matrix of results containing one result for cmd for each pair of variables containing one variable from varlist and one variable from column_varlist.

vectorof computes a vector of results containing one result for cmd for each variable in varlist.

In essence, the matrix or vector may be literally that, containing numeric values, or it may be a matrix or vector of graphs. Compare the established meaning of a scatter plot matrix. However, the graph matrix or vector will be wrapped around left to right and top to bottom.

Any weights allowed by cmd may be specified.

Remarks

As the names imply, some results may be obtained by using either matrixof with cols(varname) or vectorof with x(varname).

Options

eclass() specifies an eclass result produced by cmd. See the manual entry for cmd or inspect the results of estimates list after cmd.

rclass() specifies an rclass result produced by cmd. See the manual entry for cmd or inspect the results of return list after cmd.

global() specifies a global result produced by cmd. See the manual entry for cmd or inspect the results of macro list after cmd.

At most one of eclass(), rclass() or global() may be specified. If none is specified, cmd should be a graph command.

listwise specifies that the results of cmd should be determined for as many observations as possible. Note that as a consequence the number of observations used in each calculation may differ. By default casewise deletion is used to ensure consistency in observations selected.

matname() specifies a name to be used for a matrix to store results, which will remain in memory after matrixof or vectorof has executed.

y() and x() are options of vectorof. The names are suggested by the conventions of regress and graph: y() specifies one or more variable names to be specified before each variable from varlist, and x() specifies one or more variable names to be specified after each variable from varlist.

cols() is an option of matrixof. The name is suggested by the usual matrix convention. cols() specifies one or more variable names defining columns of the matrix to be produced. That is, varlist defines rows of the matrix and column_varlist defines columns. With a graph command, however, this option specifies the second variables (e.g. the x axis variables) of cmd.

cmd_options are options of cmd. Note that these apply to each separate execution of cmd, except that saving() and margin() are taken to refer to any composite graph shown.

matrix_list_options are options of matrix list. See help on matutil. Note that if matname() is not specified, the header is suppressed.

Examples

. matrixof ktau price-foreign, r(tau_b) format(%4.3f)

. matrixof correlate price-foreign, r(rho) format(%3.2f) . matrixof correlate price-foreign, r(rho) format(%3.2f) listwise . matrixof correlate price-foreign, r(N) listwise

. vectorof correlate price-foreign, r(rho) y(mpg) format(%4.3f)

. set textsize 140 . vectorof dotplot price-displacement . vectorof quantile price-displacement

. vectorof graph arithmetic algebra geometry calculus, x(age)

. factor x1-x6, pc . score pc1-pc6 . matrixof correlate x1-x6, cols(pc1-pc6) r(rho) format(%4.3f)

Author

Nicholas J. Cox, University of Durham, U.K. n.j.cox@durham.ac.uk

Acknowledgements

Ronan Conroy alerted me to a bug biting on Macintosh platforms. Roger Newson made helpful comments on the helpfile.

Also see

On-line: help for foreach, forvalues, return, tabstat, cpcorr (if installed), cpspear (if installed), cpyxplot (if installed), statsmat (if installed)