Title
grexport -- Extract values out of stata graphs
Syntax
grexport [, list norestore saving(string) replace wide ]
Description
grexport is an alternative to graph export. It extracts all values out of the graph currently in memory and produces a resultset (a dataset that contains all values of the graph). Resultsets can be used to create tables of the values of your graph. grexport is a convinient way to pass the values of your graph to non-stata users. It allows them to use their own software for re-creating your graphs.
Currently grexport doesn't support Stata 9's name_option .
Options
list displays the content of the most recent graph in a table.
norestore replaces the current dataset in memory by the dataset created with grexport.
saving() determines where the content of the most recent graph should be saved as a stata dataset.
replace is only needed if saving() is specified. It allows to replace a former saved dataset.
wide If the most recent graph was a overlaid graph, it may be usefull to change the output fotmat of grexport. By default each new overlay is entered as cases with the same variable names, overlays are indicated with the identifier variable set which is numbered from 1 to n. If wide is specified suffixes to the variable names (varname0, varname1, varnamek) idicating the set number.
Examples
Typical use
. sysuse auto
. scatter price weight in 1/10
. grexport , list
+-----------------------+ | price weight set | |-----------------------| | 4,099 2,930 0 | | 4,749 3,350 0 | | 3,799 2,640 0 | | 4,816 3,250 0 | | 7,827 4,080 0 | |-----------------------| | 5,788 3,670 0 | | 4,453 2,230 0 | | 5,189 3,280 0 | | 10,372 3,880 0 | | 4,082 3,400 0 | +-----------------------+
Advanced use
. tw (scatter price weight in 1/10) (lfit price weight in 1/10)
. grexport , list norestore
+----------------------------------+ | __000000 weight set price | |----------------------------------| | 2781.499 2230 1 . | | 5212.535 3155 1 . | | 7643.571 4080 1 . | | . 2930 0 4,099 | | . 3350 0 4,749 | |----------------------------------| | . 2640 0 3,799 | | . 3250 0 4,816 | | . 4080 0 7,827 | | . 3670 0 5,788 | | . 2230 0 4,453 | |----------------------------------| | . 3280 0 5,189 | | . 3880 0 10,372 | | . 3400 0 4,082 | +----------------------------------+
. outsheet using "myfile.csv" , replace
Author
Lars E. Kroll, email http://www.lkroll.de
Also see
Manual: [G] graph [P] serset
Online: graph, graph export, serset, outsheet