Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Makematrix- Possible title of the matrix?


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Makematrix- Possible title of the matrix?
Date   Fri, 25 Mar 2005 18:06:09 -0000

Michael Blasnik has already solved the problem, 
but the comment on -makematrix-, which is on 
SSC, needs to be put into context. 

As I understand it, the purpose of -makematrix- 
is to make a matrix, and secondarily to display 
it. When you -list- (usually -matrix list-) 
a matrix you just made, you can specify a 
title in the standard way, but that is 
transient. It will not be stored with the 
matrix, with example. 

So in using -makematrix- to create a set 
of matrices the issue is how those titles
-- and perhaps other stuff, like the formats
you want to use, and so forth -- 
could possibly be stored. That is all programmable 
in various ways, but the issues would 
appear to be: 

1. The programmer's time and effort. 

2. Documenting yet more options. The syntax
of -makematrix- is already complicated. 

3. Creating an obligation on the user
to get them out of wherever they're stored
for whatever they're needed for. 

4. Whether this can be done more easily 
in other ways. 

In this particular case, it seems clear
that the answer to #4 is "Yes", as Michael's
example indicates. 

Nick 
n.j.cox@durham.ac.uk 

> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu]On Behalf Of 
> Herve STOLOWY
> Sent: 24 March 2005 12:05
> To: statalist@hsphsun2.harvard.edu
> Subject: st: Makematrix- Possible title of the matrix?
> 
> 
> Dear All:
> 
> I use the -makematrix- command -followed by -mat2txt- to 
> produce tables of descriptive statistics. 
> 
> It works perfectly with the following command:
> 
> makematrix c1, from(r(N) r(mean) r(sd))label : univar var1 
> var2 var3 var4 if president==1
> makematrix c2, from(r(N) r(mean) r(sd)) label : univar var1 
> var2 var3 var4 if president==0
> makematrix c3, from(r(z) 2*normprob(-abs(r(z)))) label : 
> ranksum var1 var2 var3 var4 , by(indep)
> matrix c4 = c1 , c2, c3
> matrix colnames c4 = N "Mean" "Standard deviation" N "Mean" 
> "Standard deviation" "Mann-Whitney U-test (Z)" "Mann-Whitney 
> U-test (p-value)"
> mat2txt, matrix(c4) saving(stat_formation_metier) append
> 
> I only have a little question: I append several tables (I 
> rerun the same command replacing "president" by other 
> variables) and there is no way to distinguish the content of 
> each table without remembering the origin of the computation.
> 
> I searched in the help for -makematrix- and did not find a 
> possibility to give a title to each table (the c4 matrix in 
> my example). It would be nice to have a title in the 
> upper-left cell of the table, for example "President", in the 
> same column as the variables names.
> 
> Do you think this could be possible?
> 
> Best regards
> 
> Hervé Stolowy
> 
> 
> 
> 
> 
> ***********************************************************
> Professeur/Professor
> Coordinateur du Département/Head of Department
> HEC Paris
> Département Comptabilité Contrôle de gestion / Dept of 
> Accounting and Management Control
> 1, rue de la Liberation
> 78351 - Jouy-en-Josas
> France
> Tel: +33 1 39 67 94 42 - Fax: +33 1 39 67 70 86
> stolowy@hec.fr
> http://campus.hec.fr/profs/stolowy/perso/home.htm
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
> 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index