Hi everybody,
I'm computing some poverty measures on different subpopulation.
Before I reinvent the wheel, is there a function to produce a cross
tabulation output like this one (including the strings)?
/ Group1 Group2 Group3 Total
Measure1 ... .... ..... ....
Measure2 .... .... ..... ....
Measure3
/
I did test the following script but I'm not satisfied with the output:
printf "1. Headcount index : %g\n, %g\n, %g\n",
my_data[1,1],my_data[1,2],my_data[1,3]
printf "2. Poverty-gap : %g\n, %g\n, %g\n",
my_data[2,1],my_data[2,2],my_data[2,3]
printf "3. Sq poverty-gap : %g\n, %g\n, %g\n",
my_data[3,1],my_data[3,2],my_data[3,3]
printf "4. Mean income : %g\n, %g\n, %g\n",
my_data[4,1],my_data[4,2],my_data[4,3]
Best,
Artur
Show replies by date
On Tue, 11 Oct 2011, artur bala wrote:
I'm computing some poverty measures on different subpopulation.
Before I reinvent the wheel, is there a function to produce a cross
tabulation output like this one (including the strings)?
Have you looked at the "xtab" command?
Allin Cottrell
> > I'm computing some poverty measures on different
subpopulation.
> > Before I reinvent the wheel, is there a function to produce a cross
> > tabulation output like this one (including the strings)?
Have you looked at the "xtab" command?
Well, I apologize Allin. I made a
confusion there.
My purpose is to have a function to**only *display *the matrix - which
has been computed in a script - *by adding* the row and the column
names. Is just like when you print a matrix but I need to print an
additional row (colum names) as well as an additional column (row
names). The result has to be apparently similar to the "xtab" output
that's why I called it "cross tabulation output" but no such computation
is needed. Is only a matter of displaying a matrix.
Best,
Artur
El 12/10/11 10:19, artur bala escribió:
Well, I apologize Allin. I made a confusion there.
My purpose is to have a function to**only *display *the matrix - which
has been computed in a script - *by adding* the row and the column
names. Is just like when you print a matrix but I need to print an
additional row (colum names) as well as an additional column (row
names). The result has to be apparently similar to the "xtab" output
that's why I called it "cross tabulation output" but no such computation
is needed. Is only a matter of displaying a matrix.
look for the functions 'rownames' and 'colnames' at
the gretl command reference in
http://gretl.ecn.wfu.edu/pub/gretl/manual/en/
I think they are what you want.
--
Ignacio Diaz-Emparanza
DEPARTAMENTO DE ECONOMÍA APLICADA III (ECONOMETRÍA Y ESTADÍSTICA)
UPV/EHU Avda. Lehendakari Aguirre, 83 | 48015 BILBAO
T.: +34 946013732 | F.: +34 946013754
www.ea3.ehu.es
Le 13/10/2011 10:31, Ignacio Diaz-Emparanza a écrit :
El 12/10/11 10:19, artur bala escribió:
> Is just like when you print a matrix but I need to print an
> additional row (colum names) as well as an additional column (row
> names). The result has to be apparently similar to the "xtab" output
> that's why I called it "cross tabulation output"
look for the functions 'rownames' and 'colnames' at
the gretl command reference in
http://gretl.ecn.wfu.edu/pub/gretl/manual/en/
I think they are what you want.
Thank you Ignazio! It was exactly what I looked
for!
Best,
artur