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

st: Appearance of Matrix row and column labels.

From   "Daniel Schultz" <>
Subject   st: Appearance of Matrix row and column labels.
Date   Mon, 17 Nov 2008 23:38:57 +0000

Hej Stata-users....

maybe this is a trivial problem, but I worked for several days on the
solution and couldn't find one.

So here is the description of the problem:

My purpose is to extract a matrix out of the svy: tab command. So my
do-file (partly) looks like this:

svy: tab `var'
mat `var' = e(Prob)

If I now list the matrix with the

mat list `var'

command, all my rows are named y1 and all my columns are named p11.
Obviously I would like to get the characteristic names as rows. Since
this is part of a loop I can't do it manually with mat rown = a b c.
Here an example how it looks like at the moment:


y1    .578
y1    .321
y1    .111

Do you have an idea how I can get rid of the y1 and put in the characteristics?

Since I do this for around 1800 variables via a loop, I can't do this
every time by hand.
has anybody an idea. This problem also occurs if I want to add the
number of observations with

mat `var' = (e(Prob)/e(N))

This would be the next step to do.

Best Daniel
*   For searches and help try:

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