Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: RE: twoway connect


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: twoway connect
Date   Mon, 10 May 2010 11:11:03 +0100

Other replies focused on recommending -collapse- first, which to me is odd because various programs have been available to the user community to go in one step from frequency tables to corresponding graphs for a decade and more. 

One is -tabplot- (SSC). 

By default this show discrete bars, but a line plot cousin is obtainable too: 

. sysuse auto
(1978 Automobile Data)

. tabplot foreign rep78, percent(foreign) showval 

. tabplot foreign rep78, c(L) percent(foreign) showval recast(connected)

See also -spineplot- (SJ) and -catplot- (SSC). 

-tabplot- comes closest to Ginevra's specific request. 

Incidentally, I don't see how what is below is a frequency table unless weights are involved. 

Pertinent references: 

. search tabplot

Keyword search

        Keywords:  tabplot
          Search:  (1) Official help files, FAQs, Examples, SJs, and STBs

Search of official help files, FAQs, Examples, SJs, and STBs


FAQ     . . . . . . . . . . . . . . . . . . . . . . . . . . .  NJC Stata plots
        . . . . . . . . . . . . . . . . . .  UCLA Academic Technology Services
        7/08    http://www.ats.ucla.edu/stat/stata/faq/graph/njcplot.htm

SJ-8-1  gr0031  . . . . . . . . . . . Speaking Stata: Spineplots and their kin
        (help spineplot if installed) . . . . . . . . . . . . . . .  N. J. Cox
        Q1/08   SJ 8(1):105--121
        discusses spineplots (mosaic plots), a type of bar chart for
        showing frequencies, proportions, or percentages of cross-
        classified categorical variables

SJ-4-2  gr0004  .  Speaking Stata: Graphing categorical and compositional data
        . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N. J. Cox
        Q2/04   SJ 4(2):190--215                                 (no commands)
        discusses graphical possibilities for categorical and
        compositional data

Nick 
[email protected] 

Ginevra Biino

How can I graph data from a frequency table (rows: age classes; col: platelet counts under/over a certain cut-off) in order to have a line type plot (twoway connect). In excel I can make the table from the data set first, and then I can do the plot from the table. In STATA i do the table, but I cant succeed in doing the graph starting from the original data set (each row is an oservation, an individual).
 
This is the table whose data I would like to graph:
 
age        PLT<150        PLT>150
<18        0.7                 4.23
18-39     4.2                 0.3
40-59     7.69               0.62
>=60      11.42             0.28
 

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


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index