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 at the end of May, and its replacement, statalist.org 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 <cuak2000@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Making a bar graph from the row of a matrix
Date   Wed, 3 Apr 2013 15:18:45 -0500

Hi,

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

rowtest[1,4]
               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!

ME
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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