Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: rowshape of a matrix - stata10-


From   Herve STOLOWY <stolowy@hec.fr>
To   statalist@hsphsun2.harvard.edu
Subject   st: rowshape of a matrix - stata10-
Date   Wed, 02 Sep 2009 21:01:06 +0200

Dear Statalisters:

I get the matrix m1 with the following command:

statsmat foreign_rel, s(N mean) by(year_d2) mat(m1), if treatment==1

m1[2,2]
           N       mean
0        379  .18760868
1        484  .31070169

I would like to reshape this matrix to get  everything in one line:

 N       mean    N Mean
0/1       379  .18760868  484  .31070169.

It is possible?

I found the rowshape command but don't know how to use it. I understood that it is based on Mata but never used Mata. I tried something:

mata
rowshape (m1,2)

but get an error message: <istmt>:  3499  m1 not found.

Would you have an idea?

Best regards

Herve Stolowy




       



***********************************************************
Professeur/Professor
HEC Paris
Departement Comptabilite Controle 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
mail: stolowy at hec dot fr
web: http://www.hec.fr/stolowy


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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