Thanks to Kit Baum, a program -makematrix- is now available for
Stata 8 on SSC. This posting is fairly long, so let me indicate
its structure, so you can bail out when desired.
1 Context: the production-selection-presentation problem
2 -makematrix-: short description
3 -makematrix-: longer discussion, with many examples
1 Context: the production-selection-presentation problem
========================================================
-makematrix- is yet another take on a old problem:
1 produce lots of results
2 select those you really want
3 present them fairly compactly and neatly
There are also many ways of tackling this, both using official
Stata and with user-written commands (such as Roger Newson's
suite). This one replays some favourite personal themes, notably
I like matrices. One advantage of matrices, naturally, is
that you can _do_ things with them, like joining them to
other matrices. In working with matrices in Stata, one
occasionally has to struggle with the consequences of an
Official Attitude, namely, that matrices are primarily
what you use on the fly to fit models. To me, matrices
are the nearest thing yet to table objects in Stata,
and I try to get as far as I can with them.
I like -list-. -list- is of course a staple interactive
command, but in Stata 8 it is enhanced as a programmer's
command, and now offers improved ways of presenting data
and results.
In offering yet another program, there is some good news, insofar
as this one more or less supersedes various others of mine, namely
-biv-
-cpcorr-
-cpspear-
-matrixof-
-vectorof-
unless you are using Stata < 8, in which case some or all of those
programs may potentially be of use to you.
2 -makematrix-: short description
=================================
-makematrix- runs a command repeatedly for a specified variable
list (optionally, two variable lists) to produce a matrix of
results. As usual, a matrix could be a vector. The matrix will be
listed using -matrix list-, unless the -list- option is specified,
in which case it will be listed using the -list- command.
3 -makematrix-: longer discussion, with many examples
=====================================================
(Some examples may get wrapped by mailer software. The examples
here can also be generated using the ancillary file -makematrix.do-,
also available from SSC.)
There are various modes of operation.
First, some terminology. I call a Stata (statistical) command
essentially univariate if it requires only one variable; it may
repeat itself if supplied with two or more variables. -summarize-
is an essentially univariate command; it does work for two or more
variables, by repeating its operation for those variables. I call
such a command essentially bivariate if it requires only two
variables, and may repeat itself otherwise. -correlate- is an
essentially bivariate command; it does work for three or more
variables, by repeating its operation for pairs of those
variables. -spearman- is also an essentially bivariate command,
although it does not in fact accept more than two variables.
Finally, I call such a command essentially multivariate if it
produces just one set of results even if supplied with three or
more variables. -regress- is an essentially multivariate command.