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

st: Label instead of var names in a matrix


From   "Herve STOLOWY" <[email protected]>
To   <[email protected]>
Subject   st: Label instead of var names in a matrix
Date   Wed, 15 Dec 2004 20:29:08 +0100

Dear All:

I apply the following code to obtain a matrix with descriptive
statistics and transform it in a .txt (then Excel) file.

capture erase statdes.txt
foreach var of varlist size1 lev2 {
univar `var'
loc N = r(N)
loc mean = r(mean)
loc sd = r(sd)
sktest `var' 
loc chi2= r(chi2)
loc adj_chi2=r(P_chi2)
matrix statdes = (`N', `mean', `sd', `chi2', `adj_chi2')
matrix rownames statdes = `var'
matrix colnames statdes = N mean sd chi2 Prob(chi2)
mat2txt, matrix(statdes) saving(statdes) append

It works.

In the rownames, I get the var names (size1, lev2). However, I would
prefer to get the label names (Size and Leverage). Is there a way to do
this?

Best regards

Herv� Stolowy


***********************************************************
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
[email protected]
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/



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