Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: Making a bar graph from the row of a matrix

From   Mauricio Esteban Cuak <>
Subject   st: Making a bar graph from the row of a matrix
Date   Wed, 3 Apr 2013 15:18:45 -0500


Sorry if this a question that's been answered before. I've read the
help files, searched statalist and couldn't find an answer.
I need to automate the production of several graphs from the rows of matrices.
Consider this code:

clear all
sysuse auto.dta
qui reg price mpg trunk weight
matrix test = e(V)
matrix rowtest = test["weight", 1...]
matrix list rowtest

Which gives as a result

               mpg         trunk              weight       _cons
weight   42.603766  -28.071666   .50422716  -2043.6635

I'd like to produce a bar graph where the labels "mpg", "trunk",
"weight" and "_cons" are in the horizontal axes and vertical bars
represent the values
(42.60, -28, etc.). If it is possible, the title of the graph should
be "rowtest"
Thanks for your time!

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index