------------------------------------------------------------------------------- help formatrixof,vectorof-------------------------------------------------------------------------------

Matrix or vector of results for paired or single variables

matrixofcmdvarlist[ifexp] [inrange] [weight] [ , {eclass(result)|rclass(result)|global(result)}cols(column_varlist)listwisematname(matrix_name)cmd_optionsmatrix_list_options]

vectorofcmdvarlist[ifexp] [inrange] [weight] [ , {eclass(result)|rclass(result)|global(result)}y(yvarlist)x(xvarlist)listwisematname(matrix_name)cmd_optionsmatrix_list_options]

Description

matrixofby default computes a matrix of results containing one result forcmdfor each pair of variables invarlist. Alternatively, with thecols()option, it computes a matrix of results containing one result forcmdfor each pair of variables containing one variable fromvarlistand one variable fromcolumn_varlist.

vectorofcomputes a vector of results containing one result forcmdfor each variable invarlist.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

cmdmay be specified.

RemarksAs the names imply, some results may be obtained by using either

matrixofwithcols(varname)orvectorofwithx(varname).

Options

eclass()specifies an eclass result produced bycmd. See the manual entry forcmdor inspect the results ofestimates listaftercmd.

rclass()specifies an rclass result produced bycmd. See the manual entry forcmdor inspect the results ofreturn listaftercmd.

global()specifies a global result produced bycmd. See the manual entry forcmdor inspect the results ofmacro listaftercmd.At most one of

eclass(),rclass()orglobal()may be specified. If none is specified,cmdshould be a graph command.

listwisespecifies that the results ofcmdshould 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 aftermatrixoforvectorofhas executed.

y()andx()are options ofvectorof. The names are suggested by the conventions ofregressandgraph:y()specifies one or more variable names to be specified before each variable fromvarlist, andx()specifies one or more variable names to be specified after each variable fromvarlist.

cols()is an option ofmatrixof. 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,varlistdefines rows of the matrix andcolumn_varlistdefines columns. With a graph command, however, this option specifies the second variables (e.g. thexaxis variables) ofcmd.

cmd_optionsare options ofcmd. Note that these apply to each separate execution ofcmd, except thatsaving()andmargin()are taken to refer to any composite graph shown.

matrix_list_optionsare options ofmatrix list. See help on matutil. Note that ifmatname()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)

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

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

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